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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
david_levineCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jefflansAuthor Commented:
It worked!! Thank you!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Sybase Database

From novice to tech pro — start learning today.