IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

DB2 High Performance Load - By using a declared Cursor


 
IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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: 1788
Location: Bloomington, IL

PostPosted: Wed Oct 16, 2013 10:37 pm
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
Reply with quote

Hi,

I have picked up this example from IBM Manuals.

Use [URL] BBCode for Links

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
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 All times are GMT + 6 Hours
Forum Index -> DB2
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Forum Replies
No new posts COBOL PERFORMANCE TUNING COBOL Programming 0
No new posts Job is loading load modules several t... COBOL Programming 12
No new posts Is SQLCODE -811 possible while fetchi... DB2 1
No new posts Restart logic by using cursor name in... DB2 1
No new posts Seeking Resolution for SQKCODE -991 o... DB2 2

Back to Top