|
View previous topic :: View next topic
|
| Author |
Message |
asirisha09
New User
Joined: 29 Mar 2010 Posts: 2 Location: bangalore
|
|
|
|
Hi,
I am trying to use Multi row insert in DB2 version 8 but every time when the insert runs only one row is inserted.Is there any setting that needs to be enabled.
Can any one provide a suggestion for this |
|
| Back to top |
|
 |
Ranjithkumar
New User
Joined: 10 Sep 2008 Posts: 93 Location: India
|
|
|
|
| Please post the query you used in your code. |
|
| Back to top |
|
 |
asirisha09
New User
Joined: 29 Mar 2010 Posts: 2 Location: bangalore
|
|
|
|
Here is the code.
| Code: |
INSERT INTO CUST_INCL_ON_RQST
(STMT_RQST_ID
, CUSTOMER_ID
, SMPL_CUST_YN
, RSLT_CD)
VALUES
(:ZNHDCUIR-STMT-RQST-ID
, :WS-CUSTOMER
, :ZNHDCUIR-SMPL-CUST-YN
, :ZNHDCUIR-RSLT-CD)
FOR :NUM-ROWS ROWS
NOT ATOMIC CONTINUE ON SQLEXCEPTION |
Declaration
| Code: |
05 WS-CUSTOMER OCCURS 1000 TIMES.
07 WS-CUSTOMER-ID PIC S9(09) COMP
05 NUM-ROWS PIC S9(06) COMP |
all others are table variables. |
|
| Back to top |
|
 |
ashimer
Active Member

Joined: 13 Feb 2004 Posts: 551 Location: Bangalore
|
|
|
|
First of all your array declaration is not same as your insert.
Change your array to
| Code: |
01 CUSTOMER.
05 WS-STMT-ID ... OCCURS 1000 TIMES.
05 WS-CUSTOMER-ID PIC S9(9) COMP OCCURS 1000 TIMES.
|
Here the group name should not be using the occurs, instead each element should be defined with occurs for mass inserts. |
|
| Back to top |
|
 |
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
| Back to top |
|
 |
CICS Guy
Senior Member

Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Host-variable-arrays in PL/I, C, C++, and COBOL
| Quote: |
Host-variable-arrays are defined by statements of the host language as explained in DB2 Application Programming and SQL Guide, SC18-9841-00.
|
Does anybody have a url for this or IBM's DB2 shelf? |
|
| Back to top |
|
 |
dbzTHEdinosauer
Global Moderator

Joined: 20 Oct 2006 Posts: 6965 Location: porcelain throne
|
|
| Back to top |
|
 |
Anuj Dhawan
Superior Member

Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
| Back to top |
|
 |
Thangaprabhu
New User
.jpg)
Joined: 15 Jul 2009 Posts: 16 Location: INDIA
|
|
|
|
Hi,
Asrisha whether the problem is solved?
Thanks,
Thangaprabhu |
|
| Back to top |
|
 |
|
|