Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Thu Mar 13, 2003 11:38 am Post subject:
Jashu,
There are 2 ways of doing it.
Option:1
Run the text file thru sort/easytrieve to remove the delimiter and just load the data using
the following control card
Code:
LOAD DATA INDDN(SYSREC00) REPLACE YES
INTO TABLE TABLENAME
Option:2
Unload the table which you are trying to load so that it will generate a load card.use a where clause in the sql with primary key > 999999999 , so that it will not unload any rows.
Now the syspunch data set will have something like this
Code:
LOAD DATA INDDN(SYSREC00) REPLACE YES
INTO TABLE TABLENAME
(COL1 POSITION (1:3) CHAR(3),
COL2 POSITION (4:39) CHAR(36),
COL3 POSITION (40:45) CHAR(6),
COL4 POSITION (46:48 ) CHAR(3),
COL5 POSITION (49:64) CHAR(16) )
Now you can edit this syspunch dataset by incrementing the start position and load the table using the edited control cards.
Joined: 29 Nov 2002 Posts: 382 Topics: 27 Location: Chennai, India
Posted: Thu Mar 13, 2003 11:24 pm Post subject:
Hi all,
The question by Jashu got me thinking. Even in very small DBMS systems like MS-Access, we have got the option to load a table from a flat file using delimiters. Isn't it odd that in a well established RDBMS like DB2, you do not have the option to load a table using delimiters. Logically, a delimited file should be enough to load into a table without any load card. I, of course do not know whether the same is possible in other popular RDBMS like Oracle or Sybase.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum