IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

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.

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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Duplicate transid's declared using CEDA CICS 3
No new posts How to load to DB2 with column level ... DB2 6
No new posts REASON 00D70014 in load utility DB2 6
No new posts exploiting Z16 performance PL/I & Assembler 2
Search our Forums:

Back to Top