INSERT MORE THAN ONE ROWS IN SPUFI
Moderators: Kalicharan, Moderator Group
-
- Member
- Posts: 6
- Joined: Wed Jun 17, 2009 11:56 am
- Location: Bangalore
INSERT MORE THAN ONE ROWS IN SPUFI
HI,
can anyone help me out in inserting two rows at a time
i tried with the following syntax but it gave me error.
INSERT INTO EMPLOYEE(EMPNAME,SALARY,LOCATION)
VALUES('RAJU',8888,'BANGALORE'),
('JOHN',7777,'CHENNAI'),
('KEVIN',7676,'NEW YORK');
can anyone help me out in inserting two rows at a time
i tried with the following syntax but it gave me error.
INSERT INTO EMPLOYEE(EMPNAME,SALARY,LOCATION)
VALUES('RAJU',8888,'BANGALORE'),
('JOHN',7777,'CHENNAI'),
('KEVIN',7676,'NEW YORK');
-
- Member
- Posts: 6
- Joined: Wed Jun 17, 2009 11:56 am
- Location: Bangalore
-
- Member
- Posts: 6
- Joined: Wed Jun 17, 2009 11:56 am
- Location: Bangalore
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
DB2 MULTI-ROW INSERT COBOL - DB2
with DB2 version 8 multi-row insert will work.
Not sure whether it will work with spufi or not.
This DB2 feature work with any application program like COBOL.
This syntax may work on DB2 LUW for windows, unix and Linux.
Not sure whether it will work with spufi or not.
This DB2 feature work with any application program like COBOL.
This syntax may work on DB2 LUW for windows, unix and Linux.
Last edited by Natarajan on Wed Jun 17, 2009 3:10 pm, edited 1 time in total.
Natarajan
Chennai
Chennai
-
- Member
- Posts: 6
- Joined: Wed Jun 17, 2009 11:56 am
- Location: Bangalore
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
INSERT INTO EMPLOYEE(EMPNAME,SALARY,LOCATION)Can u plz modify the above query for using UNION ???
VALUES('RAJU',8888,'BANGALORE')
UNION
INSERT INTO EMPLOYEE(EMPNAME,SALARY,LOCATION)
('JOHN',7777,'CHENNAI')
UNION
INSERT INTO EMPLOYEE(EMPNAME,SALARY,LOCATION)
('KEVIN',7676,'NEW YORK')
UNION
INSERT INTO EMPLOYEE(EMPNAME,SALARY,LOCATION)
('JOHN',7777,'CHENNAI')
UNION
INSERT INTO EMPLOYEE(EMPNAME,SALARY,LOCATION)
('KEVIN',7676,'NEW YORK');
could you please provide an example?with DB2 version 8 multi-row insert will work.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
Hi Dick,
My statement has come from following ibm material on DB2.
http://publib.boulder.ibm.com/infocente ... g/fmlt.htm
My statement has come from following ibm material on DB2.
http://publib.boulder.ibm.com/infocente ... g/fmlt.htm
Natarajan
Chennai
Chennai
DB2 MULTI-ROW INSERT
Technokrat,
You can also use following sytax for multi-row insert from spufi.
It is very similar to what dick has suggested.
You can also use following sytax for multi-row insert from spufi.
It is very similar to what dick has suggested.
Code: Select all
INSERT INTO EMPLOYEE
SELECT 'RAJU',8888,'BANGALORE' from SYSIBM.SYSDUMMY1
UNION ALL
SELECT 'JOHN',7777,'CHENNAI' from SYSIBM.SYSDUMMY1
UNION ALL
SELECT 'KEVIN',7676,'NEW YORK' FROM SYSIBM.SYSDUMM1;
Natarajan
Chennai
Chennai
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
RaviTejaG,
you need to read a little bit. SYSIBM.SYSDUMMY1 is a table (provided by db2-ibm) that allows you to select something that does not exist in a table.
you can set :timestamp = current_timestamp
or you can
select current_timestamp into :timestamp from sysibm.sysdummy1
you need to read a little bit. SYSIBM.SYSDUMMY1 is a table (provided by db2-ibm) that allows you to select something that does not exist in a table.
you can set :timestamp = current_timestamp
or you can
select current_timestamp into :timestamp from sysibm.sysdummy1
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page