Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insterting from a flat file

Status
Not open for further replies.

gochris

Programmer
Mar 12, 2000
1
US
I am working with a DB2 database on an AS/400 and I would like to insert data from a flat file. The problem is I don't know how to specify how to insert it. I know how to make derived fields using query by using the substring command. Is there a way to use the substring command and substring out part of a flat file record. Thanks in advance for any help.
 
Try Programmers DBMS IBM:DB2 forum. <p>Ged Jones<br><a href=mailto:gedejones@hotmail.com>gedejones@hotmail.com</a><br><a href= > </a><br>
 
Try the IBM Web site&nbsp;&nbsp;<A HREF=" TARGET="_new"> and search on DB2 this should bring up a link to the IBM DB2 on-line library.<br>you should be able to find an answer there. I believe that you can use the substring to break up the data but unless you are planning on writing a program to insert the data I am not sure if you can do the read/substring/insert in 1 pass.<br>Let me know what you find out.<br>Thanks <br>&nbsp;&nbsp;&nbsp;&nbsp;Greg <p>Greg Amos<br><a href=mailto:amosgreg@ix(dot)netcom(dot)com replace(dot)>amosgreg@ix(dot)netcom(dot)com replace(dot)</a><br><a href= > </a><br>
 
I 've done Pro*C programming on Unix. Where I did the same thing. That is retrieving and inserting data from Oracle to flat files and vice-versa. But I can tell you the concept . If you are familiar with COBOL language , then you need to know some SQL commnds to manipulate data. For eg. You need to access data from flat file and then take them into your COBOL host variables , then insert them into DB2 database using EXEC SQL commands. If you want some code I can ask my friend because he is doing the same. <br><br>Thanx<br>Siddhartha Singh<br><A HREF="mailto:ssingh@aztecsoft.com">ssingh@aztecsoft.com</A>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top