Volume 6, Number 1 -- January 4, 2006

V5R3 SQL Insert Improvement

Published: January 4, 2006

by Ted Holt

SQL's INSERT command adds records to a table (physical file) or view (logical file). There are three forms of INSERT. The VALUES form allows you to create a record from constants. For example, assume a table PLANT with two columns (fields)--ID and NAME.

create table qtemp/Plants
  (ID   char(4),         
   Name char(12))

To create rows (records) for two factories, you could use two insert commands.

insert into qtemp/plants values('1492', 'Lost Angeles')
insert into qtemp/plants values('2001', 'New Yolk')

In V5R3, IBM enhanced the VALUES form of INSERT to permit you to insert more than one row at a time. The following INSERT command inserts two rows.

insert into qtemp/plants
   values ('1492', 'Lost Angeles'), ('2001', 'New Yolk')

Each row's values are enclosed in parentheses and separated from other rows with commas.

This is not an IBM-only feature. Other SQL platforms support it as well.

Sponsored By

SEQUEL can be used for virtually ALL data access functions on the iSeries.

A Windows-based user interface makes it easy to design queries and reports.

SEQUEL offers executive dashboards, drill-down data analysis and run-time prompts to deliver important iSeries data to managers and other non-technical users.

E-mail and FTP delivery let you deliver information to remote users and servers.


Senior Technical Editor: Ted Holt
Technical Editors: Howard Arner, Joe Hertvik, Shannon O'Donnell, Kevin Vandever
Contributing Technical Editors: Joel Cochran, Wayne O. Evans, Raymond Everhart,
Bruce Guetzkow, Marc Logemann, David Morris
Publisher and Advertising Director: Jenny Thomas
Advertising Sales Representative: Kim Reed
Contact the Editors: To contact anyone on the IT Jungle Team
Go to our contacts page and send us a message.

Sponsored Links

COMMON:  Join us at the Spring 2006 conference, March 26-30, in Minneapolis, Minnesota
Arkeia:  Linux backup solutions for SMBs and enterprises with heterogeneous environments
BCD:  Try WebSmart - the easiest and most complete iSeries Web development tool


Subscription Information:
You can unsubscribe, change your email address, or sign up for any of IT Jungle's free e-newsletters through our Web site at http://www.itjungle.com/sub/subscribe.html.

Copyright © 1996-2008 Guild Companies, Inc. All Rights Reserved.
Guild Companies, Inc., 50 Park Terrace East, Suite 8F, New York, NY 10034
Privacy Statement