View previous topic :: View next topic
|
Author |
Message |
TS70363
New User
Joined: 07 Apr 2010 Posts: 94 Location: Bangalore, India
|
|
|
|
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 |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
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 |
|
|
TS70363
New User
Joined: 07 Apr 2010 Posts: 94 Location: Bangalore, India
|
|
Back to top |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
it's called crossloading.
I don't see an error but I don't know whether HPU can do this. |
|
Back to top |
|
|
|