Log full on tempdb!!!

  I am executing a program that reads data from an text file and write that data on a sybase's table. The code goes like this:

   Open Sybase's Connection
   USE <DATABASE>
   Open Text File
   While not EOF
      Read Row
      INSERT INTO <TABLE> (Fields) values (Values)
      Move to next File's row
   End While    
   Close Text File
   Close Sybase's Connection
   
   The problem is that I'm receiving a log full's message on database tempdb and I am not using tempdb at all!

   I am connecting top SYBASE using a 16 bit ODBC driver (from Intersolv Q+E) and the the version of the server is Sybase 11.0.3.3 for Linux. I've tryed to check the Trunc Log on Chkpt option true on tempdb but it didn´t worked.

   Hope someone can help me!

   jefflans
jefflansAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
david_levineConnect With a Mentor Commented:
Let me know if this is possible..

Can you perform a COMMIT inside your code? If so, then you can look at commiting every few thousand records. Since you aren't using a database to get your information, just write it, executing a COMMIT won't efefct reading the next record. And a COMMIT should clear out anything you were using in tempdb.

So your code would go something like:

Open Sybase's Connection
   USE <DATABASE>
   Open Text File
   processed_rec = 0
   While not EOF
      Read Row
      INSERT INTO <TABLE> (Fields) values (Values)
      processed_rec = processed_rec + 1
      if processed_rec = 5000 then
         COMMIT
         processed_rec = 0
      end if
      Move to next File's row
   End While    
   Close Text File
   Close Sybase's Connection
   

If it works, I'll re-submit as an answer.
0
 
jkotekCommented:
I think, that you are probably manipulating with temporary tables (they are in tempdb).

Anyway the best approach to import data into the ASE is to use utility named 'bcp' or bulkcopy. It is much faster and you have wide choice of parameters to set the caolumn delimiters etc.
0
 
ajith_29Commented:
Your problem is with the tempdb size beging small.It is best pratice to have a large temp db.Please do make your tempdb large and then your problem will be solved.It must be in the deafult 2MB make it to 5MB or 10 MB and your problem will be solved.
0
 
jefflansAuthor Commented:
  My tempdb has 120 MB!!! I think the problem may be a bug on the OBDC drivers of Intersolv (Q+E 16bits)...

   I can not use the BCP because the text file is already generated and it´s format is peculiar.

   Thank you for your attention!

   jefflans
0
 
jefflansAuthor Commented:
It worked!! Thank you!
0
All Courses

From novice to tech pro — start learning today.