Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How do you do a Multi row insert?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
ajay_udl

New User


Joined: 10 Oct 2006
Posts: 29

PostPosted: Wed Aug 13, 2008 6:22 am    Post subject: How do you do a Multi row insert?
Reply with quote

Hi All,

Could any one tell me how to do a multi row insert in to a table.
The below should be an eg to insert data in to the table.

Eg:

EXEC SQL
INSERT INTO test-table
VALUES (:HV-ACT-NMBR-ARRAY,
:HV-ACT-CITY-ARRAY,
:HV-ACT-NAME-ARRAY )
FOR 50 ROWS
ATOMIC
END-EXEC.


Can I remove the imsert value 50 with a variable. So that if the input file is having only 25 records then the variable would get 25 as value. So tat we will be looking forward to insert only 25 records.

More over which one is best to use? ATOMIC or NOT ATOMIC CONTINUE ON SQLEXCEPTION

If am using the second one where do I give the GET DIAGNOSTICS statement?? Is this statement to be given immediately after the insert tabe statement?.

Since this is a new feature. Can any body guide me? So tat i could code it effectively.

Many thanks
Ajay.
Back to top
View user's profile Send private message

birdy K

New User


Joined: 05 Mar 2008
Posts: 72
Location: chennai

PostPosted: Wed Aug 13, 2008 11:03 am    Post subject:
Reply with quote

Please Search in the forum. This is already discussed. This is the linkhttp://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/admin/r0000970.htm
I think this link will give answers for u.
Back to top
View user's profile Send private message
ashimer

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Wed Aug 13, 2008 3:01 pm    Post subject:
Reply with quote

Another good link

http://it.toolbox.com/blogs/db2zos/kewl-db2-for-zos-version-8-feature-part-2a-multirow-insert-fetch-7377
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Insert Lines in JCL with Rexx after a... Willy Jensen CLIST & REXX 3 Tue Aug 30, 2016 4:18 pm
No new posts How to insert a lengthy string havin... vidyaa DB2 7 Thu Aug 25, 2016 5:20 pm
No new posts Multi row fetch - "for read only... Nileshkul DB2 3 Sun Aug 14, 2016 12:52 am
No new posts Reading selected volumes of a multi-v... RickBig JCL & VSAM 6 Wed Jul 13, 2016 7:26 pm
No new posts How do I right justify a string in an... rakesh17684 DB2 1 Wed Jun 08, 2016 8:01 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us