Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 1790
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 Get line number where cursor is from ... satish.ms10 CLIST & REXX 3 Wed Oct 24, 2018 12:23 am
No new posts Delete Multiple rows in chunks by usi... dharmaraok DB2 5 Tue Sep 11, 2018 8:44 pm
No new posts Need help on TDQ load from file using... subratarec CICS 4 Wed Jun 13, 2018 11:32 pm
No new posts can we hardcode a value in db2 load c... ram_vizag DB2 2 Wed Feb 28, 2018 11:04 pm
No new posts Need all records with high key kalidasvs SYNCSORT 15 Fri Feb 09, 2018 10:38 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us