View previous topic :: View next topic
|
Author |
Message |
sakrat
Active User
Joined: 05 Feb 2014 Posts: 164 Location: India
|
|
|
|
HI,
I want insert the records from a ps file into a table using REXX without using any utilities.
I gave some 5 fields in my ps file and the field data type of the those fields will be same as what is present into the destination table where i want to load the file. How can I do this....?
and the number of fields in the ps file and the table may differ always. but both will always have same number of fields. like if ps file has 10 fields then table will also have 10 fields and if ps file has 50 table will have 50.
So I want to dynamically insert the records into the table....
Any help from you people will be very greatful.....
Thanks,
Sakrat |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Have you looked at how to access DB2 via Rexx in the SQL Users Guide? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
I want insert the records from a ps file into a table using REXX without using any utilities. |
You will have to write a program,
the logic will not depend on the language being used |
|
Back to top |
|
|
sakrat
Active User
Joined: 05 Feb 2014 Posts: 164 Location: India
|
|
|
|
My Question is not about the INSERT syntax it is like when i have fields that may vary not contant number of fields, in that case how will i write the INSERT syntax statement. |
|
Back to top |
|
|
Smita.t2
New User
Joined: 17 Apr 2012 Posts: 31 Location: Bangalore
|
|
Back to top |
|
|
sakrat
Active User
Joined: 05 Feb 2014 Posts: 164 Location: India
|
|
|
|
Can I use the below to insert the records in the ps file to the db2 table.
Code: |
DRAW schemaname.tablename (TYPE=INSERT SSID=***
|
|
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
What language is that? You asked about Rexx and that is not Rexx.
As to a variable number of fields then you code your program to do that. but your program needs to know the format of any data that is passed to it. How you do that is up to you but you may want to read in not only the dataset but also the DCLGEN for the table that is to be updated. |
|
Back to top |
|
|
|