Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

DB2 High Performance Load - By using a declared Cursor

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
TS70363

New User


Joined: 07 Apr 2010
Posts: 94
Location: Bangalore, India

PostPosted: Wed Oct 16, 2013 5:29 pm    Post subject: DB2 High Performance Load - By using a declared Cursor
Reply with quote

Hello,

The requirement is to Load data from 1 table to another within the same system. The tables have same columns.

I read thru the manuals and found that declaring a cursor to select from 1 table and then using the cursor to load the other table would help.

Code:
EXEC SQL                                   
    DECLARE C1 CURSOR FOR                   
    SELECT * FROM T1.TABLE1 
ENDEXEC                                     
LOAD DATA                                   
INCURSOR(C1)                               
RESUME YES                                 
INTO TABLE T2.TABLE1         
STATISTICS                                 


I am getting the below error:
Code:
INZU039E FATAL SYNTAX ERROR BEFORE LINE 1 COLUMN 17   
INZU366I UTILITY RETURN CODE 8 (REASON CODE 0x107a002)


Can some one suggest what could be the issue?
Back to top
View user's profile Send private message

Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1770
Location: Bloomington, IL

PostPosted: Wed Oct 16, 2013 10:37 pm    Post subject:
Reply with quote

LOAD is a DB2 utility, not a SQL statement; you cannot mix the two.

Unload the first, change the generated LOAD statement necessary, and then load the second.
Back to top
View user's profile Send private message
TS70363

New User


Joined: 07 Apr 2010
Posts: 94
Location: Bangalore, India

PostPosted: Thu Oct 17, 2013 11:10 am    Post subject: Reply to: DB2 High Performance Load - By using a declared Cu
Reply with quote

Hi,

I have picked up this example from IBM Manuals.

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/handheld/Connected/BOOKS/DSNUGK10/2.14.6?DT=20070125001207

refering to example 15
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Thu Oct 17, 2013 2:34 pm    Post subject:
Reply with quote

it's called crossloading.
I don't see an error but I don't know whether HPU can do this.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts CONTIG for performance? JPVRoff JCL & VSAM 7 Fri Jun 09, 2017 8:39 am
No new posts Db2 load job abending in SORT mistah kurtz DB2 4 Mon Jun 05, 2017 3:58 pm
No new posts Testing rerad cursor for status with ... John F Dutcher DB2 8 Fri May 19, 2017 9:35 pm
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm
No new posts Copy load modules and alias vasanthz IBM Tools 5 Thu Apr 20, 2017 6:31 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us