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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compound statement in Cobol370

Status
Not open for further replies.

sauravdb2

Programmer
Dec 10, 2002
3
US
Can we have compound SQLs in cobol370 and DB2 V 6.1 . Something like :-

EXEC SQL BEGIN COMPOUND ATOMIC STATIC
INSERT INTO SPEC_INSTR (INSTR_CDE,INSTR_DESC)
VALUES (2001,'TEST ONE');
INSERT INTO SPEC_INSTR (INSTR_CDE,INSTR_DESC)
VALUES (2002,'TEST TWO');
INSERT INTO SPEC_INSTR (INSTR_CDE,INSTR_DESC)
VALUES (2003,'TEST THREE');
INSERT INTO SPEC_INSTR (INSTR_CDE,INSTR_DESC)
VALUES (2004,'TEST FOUR');
INSERT INTO SPEC_INSTR (INSTR_CDE,INSTR_DESC)
VALUES (2005,'TEST FIVE');
INSERT INTO SPEC_INSTR (INSTR_CDE,INSTR_DESC)
VALUES (2006,'TEST SIX');
END COMPOUND.


 
Hi,
I'm quite happy to be proved wrong on this one, but I don't think you can. Everywhere where I have worked we have used SPUFI to do multiple inserts delimited by ';' as in your example. This leads me to believe that you can't do it, and that SPUFI is the path you ought to be following. Unless somebody knows different!
HTH
Marc
 
you can insert multiple rows if all the data is there like:

Code:
EXEC SQL
  INSERT INTO SPEC_INSTR (INSTR_CDE,INSTR_DESC)   
   VALUES (2001,'TEST ONE',
           2002,'TEST TWO',
           2003,'TEST THREE',
           2004,'TEST FOUR',
           2005,'TEST FIVE',
           2006,'TEST SIX')
END-EXEC.
Each value will get insert into the correct column as long as a value is assinged to that column.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top