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

Problem with Loading table with IDENTITY COLUMN ALWAYS


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: Tue Oct 07, 2008 7:30 pm
Reply with quote

Hi Guyz,

I am having a table with 2 Columns and one of them is a IDENTITY COLUMN with ALWAYS defined(ID). So the ID will be DB2 generated.
Iam suppose to load the other column DNAME, which is of CHAR(30).

So, only the DNAME column is UNLOADED and kept in a DATASET
For example UNLOAD file will be like this (with quotes)
Code:
'HUMAN RESOURCE                '
'HIRING                        '
'FIRING                        '
'FINANCE                       '
'MARKETING                     '
'PLANNING                      '


I need to load the table with these data.

Iam using FASTLOAD utility,

This is my PARMCARD
Code:
FASTLOAD               
COPY-BUFFERS 30         
SPACE-DEFN YES         
DISPLAY-STATUS 10000   
INPUT-FORMAT DELIMITED 
COMMA ';'               
IO-BUFFERS 60           
MAXTASKS 1             
NONLEAF-PCTFREE LEAF   
UNLOAD CONTINUE         
COLLECT-PDASTATS       
RESUME NO REPLACE       
RECLUSTER NO SORT-CLINDX
ENFORCE CONSTRAINTS     
STARTUP-ACCESS FORCE   
SORTSIZE 8M             
SORTNUM  6         
STOP-LIMIT 1       
UPDATE-CATSTATS ALL
VSAM-BUFFERS 96     


This is my loadcard
Code:
INTO TABLE  HXSULL.DEPARTMENT                                         
 (                                                                   
  DNAME                          POSITION(            1:          30 )
    CHAR               (    30)                                       
 )                                                                   



This is error i am getting,
Code:
Object SHANDB.SIMPLETS in STOP PENDING Mode - Utility will Retry
Column(s) defined as GENERATED ALWAYS.  Each datum in           
a column of this type must be generated, not loaded.           
FASTLOAD application did not complete successfully             


The thing is iam not loading the IDENTITY COLUMN. I am only loading the DNAME. Assuming the ID column will be automatically generated.

How to load this table ?

HELP ME!
Sushanth Bobby
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Wed Oct 08, 2008 1:47 pm
Reply with quote

Hello to anyone,

I have found a way to load a table with IDENTITY column using IBM LOAD.

publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=/com.ibm.db29.doc.ugref/db2z_loadtableidentitycolumnsrowid.htm

But, i am using PLATINUM TOOL, is there any syntax for this

Thank You in Advance,
Sushanth Bobby
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Fri Oct 10, 2008 12:09 pm
Reply with quote

Hello,
I have found out a way to load the tables with IDENTITY COLUMNS using unload file in SEQUENTIAL Datasets(ouput in unload & input in load)

1. Unload the only the columns which you want to load(exclude identity columns)
2. Prepare the LOAD CARDS for loading the Data.(Identity column will be having a dummy prefix).
Code:
INTO TABLE  HXSULL.DEPARTMENT                                         
 (                                                                   
  DUMMY_IDENT_00001              POSITION(            1:           4 )
    INTEGER                                                           
   ,                                                                 
  DNAME                          POSITION(            5:          34 )
    CHAR               (    30)                                       
 )                                                                   



3. Load the table.

That's it.

But my prob is similar but entirely different.
This is my scenario,
Input Table : Has 2 columns
Code:
      Column 1 : ID    - Identity Column
      Column 2 : Dname - Char(30)

1. I have unloaded only the Dname column from the input-table, using output format delimited-comma comma ';'

unload file will be like

Code:
'AAAAAAAAAAAAAAA                '
'AAAAAAAAAAAAAAA          BCD   '
'AAAAAAAAAAAAAAA          III   '

2. Same LoadCards


3. In Loading process i have specified, input-format delimited comma ';'

This actually, should have worked. It didn't.

Same error which i had previously. Shouldn't load identity column. But, i am not loading the identity column.
1. I am unloading only the DNAME column
2. LoadCards has a dummy prefix, so that i won't be loading any data there.
3. In the load process input-format is delimited comma ';'

Help Needed,
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 Pulling a fixed number of records fro... DB2 2
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts How to load to DB2 with column level ... DB2 6
Search our Forums:

Back to Top