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

IDENTITY column in LOAD & Insert with multi-select


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Wed May 13, 2009 1:40 pm
Reply with quote

Hi,

I am trying to use CROSS-LOADER feature of DB2 z/OS to load data from production to development, since i have only few rows to load. And this job failed because of table having IDENTITY COLUMN GENERATED ALWAYS.

Code:
LOAD DATA LOG NO RESUME NO REPLACE INCURSOR NSSI
INTO TABLE ASFDDATP.SITTPNSSI                   
FIELD PK_ROW_NUM IS NOT ALLOWED                   


So, i specified IGNOREFIELDS YES in my loadcard, again i got the same error.
Code:
LOAD DATA LOG NO RESUME NO REPLACE INCURSOR NSSI
INTO TABLE ASFDDATP.SITTPNSSI IGNOREFIELDS YES   
FIELD PK_ROW_NUM IS NOT ALLOWED                 

How should i load using CROSS LOADER function if the table to be loaded has IDENTITY COLUMNS ?

So, i tried the next available option. Just an ordinary insert.
Code:
  INSERT INTO ASFDDATP.SITTPNSSI OVERRIDING USER VALUE                         
     SELECT * FROM NLVPROD.ASFDDATP.SITTPNSSI;                                 
I got an
Code:
SQLCODE = -512, ERROR:  STATEMENT REFERENCE TO REMOTE OBJECT IS INVALID

If i comment out the INSERT statment and run the SELECT query
Code:
SELECT * FROM NLVPROD.ASFDDATP.SITTPNSSI;

I am able to get the data.


Am i missing something in LOAD as well the INSERT query ?

Thank You,
Sushanth
Back to top
View user's profile Send private message
Raghu navaikulam

Active User


Joined: 27 Sep 2008
Posts: 193
Location: chennai

PostPosted: Fri May 15, 2009 1:41 am
Reply with quote

Hi sushanth bobby

How do you defined the cursor NSSI ?
Did you avoid the IDENTITY column while defining it?
I think you can avoid the IDENTITY column while declaring Cursor(Instead of using a SELECT * FROM..) since both tables (prod & dev)having the same structure.

If you are using Load control statement without using Cursor, then you can use the combination of IGENOREFIELDS with dummy fields (DSN_IDENTITY). This will avoid loading IDENTITY columns.

This is only a logical thinking. I never tried it. Try it. Good luck.

Regards
Raghu
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Sat May 16, 2009 12:04 am
Reply with quote

Raghu,

Your logical thinking is correct about the LOAD. Thank You RAGHU.

The INSERT statement is not working, only when i am using THREE-PART names.

Thank You Very Much,
Sushanth
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 Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Load new table with Old unload - DB2 DB2 6
No new posts How to load to DB2 with column level ... DB2 6
No new posts RC query -Time column CA Products 3
No new posts REASON 00D70014 in load utility DB2 6
Search our Forums:

Back to Top