If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > sample stored procedure??

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-06-06, 10:20
vijay253 vijay253 is offline
Registered User
 
Join Date: Jan 2006
Posts: 7
Smile sample stored procedure??

Hi all,

If you have a stored procedure to read a fixedwith file and insert it into a Db2 table one line to one record at a time... please forward it to me at vijay253@yahoo.com.


thanks
Reply With Quote
  #2 (permalink)  
Old 01-09-06, 04:13
Peter.Vanroose Peter.Vanroose is offline
Registered User
 
Join Date: Sep 2004
Location: Belgium
Posts: 1,079
Try using the LOAD utility.
Depending on your platform and DB2 version, the syntax may vary slightly.
E.g., have a look at http://publib.boulder.ibm.com/infoce...e/r0008305.htm

It contains the following example:
Code:
db2 load from ascfile1 of asc
      method L (1 20, 21 22, 24 27, 28 31)
      null indicators (0,0,23,32)
      insert into table1 (col1, col5, col2, col3)
where table1 at least has the following columns:
* COL1 CHAR(20) NOT NULL
* COL2 SMALLINT
* COL3 CHAR(4)
* COL5 CHAR(2) NOT NULL
__________________
--_Peter Vanroose,
__IBM Certified Database Administrator, DB2 9 for z/OS
__IBM Certified Application Developer
__ABIS Training and Consulting
__http://www.abis.be/

Last edited by Peter.Vanroose; 01-09-06 at 04:19.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On