Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / March 2006

Tip: Looking for answers? Try searching our database.

load from cursor

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Raj - 13 Mar 2006 18:00 GMT
Hi,

We have a process ( a stored proc)  that exports data ( about 10
million records) from a huge table,t1 and loads it into another huge
table t2. The export runs for 3 hours everyday because of a very
complex sql...

My question is can we load from the table directly instead of exporting
the data and loading it from the falt file??

like using load from cursor??

does it have any disadvantages?? when we declare a cursor where is the
result stored?? can it overflow to the disk?? people here had lots of
performance issues using cursors in a Stored proceedure...

Thanks,
Raj
Brian Tkatch - 13 Mar 2006 18:36 GMT
I do not know the answer to your question. However, a side note:

>The export runs for 3 hours everyday because of a very complex sql...

I do not know if this applies, but using a temp TABLE, a splitting up
the actions of the complex SQL to multiple simple SQL statements may
speed things up a bit.

I just sped up a query that took aboutone minute and forty seconds to
under a second by using a temp table instead.

B.
Shashi Mannepalli - 13 Mar 2006 19:01 GMT
I don't see any disadvantages with using CURSOR except make sure only
after the LOAD only you issue a commit.
Regarding memory issues check other posts..

http://groups.google.com/group/comp.databases.ibm-db2/browse_frm/thread/257d2f46
0ebe5576/4f0905d2ad389953?q=declare+cursor+load&rnum=1#4f0905d2ad389953


cheers...
Shashi Mannepalli
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.