
Data Retrieval and Modification
HP NonStop SQL/MP Programming Manual for C—429847-008
4-8
INSERT Statement
Do not code this request with this WHERE clause:
WHERE LAST_NAME > :LAST-LNAME
AND FIRST_NAME > :LAST-FNAME
This clause does not retrieve names with the same last name as :LAST-LNAME and a
first name greater than :LAST-FNAME.
Also, do not code this request with this WHERE clause:
WHERE ( (LAST_NAME = :LAST-LNAME
AND FIRST_NAME > :LAST-FNAME)
OR LAST_NAME > :LAST-LNAME)
This clause would produce the correct results, but very slowly. Whenever possible,
avoid the OR disjunctive in a WHERE clause.
INSERT Statement
The INSERT statement inserts one or more rows into a table or protection view. To
insert data, a program moves the new data to a series of host variables and then runs
an INSERT statement to transfer these host variable values to the table.
To run an INSERT statement, a process started by the program must have read and
write access to the table or view receiving the data and read access to tables or views
that you include in a SELECT statement. For details, see
Required Access Authority
on page 7-1.
NonStop SQL/MP returns these values to
sqlcode
after an INSERT statement.
If an INSERT statement runs successfully, the SQLCA structure contains the number
of rows inserted. (If the INSERT statement fails, do not rely on the SQLCA structure for
an accurate count of the number of rows inserted.) To return the contents of the
SQLCA, use the SQLCADISPLAY or SQLCATOBUFFER procedure.
For more information, see
Section 5, SQL/MP System Procedures
and
Section 9, Error
and Status Reporting
.
sqlcode
Value
Description
0
The INSERT statement was successful.
100
No rows qualified for an insert using a SELECT statement
specification.
<0
An error occurred;
sqlcode
contains the error number.
>0 (¦100)
A warning occurred;
sqlcode
contains the first warning number.
Содержание NonStop SQL/MP
Страница 4: ......
Страница 14: ...Contents HP NonStop SQL MP Programming Manual for C 429847 008 x ...
Страница 34: ...Introduction HP NonStop SQL MP Programming Manual for C 429847 008 1 8 SQL MP Version Management ...
Страница 60: ...Host Variables HP NonStop SQL MP Programming Manual for C 429847 008 2 26 VARCHAR Data Type ...
Страница 68: ...SQL MP Statements and Directives HP NonStop SQL MP Programming Manual for C 429847 008 3 8 Finding Information ...
Страница 156: ...Explicit Program Compilation HP NonStop SQL MP Programming Manual for C 429847 008 6 40 SQL Program Files ...
Страница 264: ...Dynamic SQL Operations HP NonStop SQL MP Programming Manual for C 429847 008 10 66 Detailed Dynamic SQL Program ...
Страница 294: ...SQL MP Sample Database HP NonStop SQL MP Programming Manual for C 429847 008 A 6 ...
Страница 300: ...Memory Considerations HP NonStop SQL MP Programming Manual for C 429847 008 B 6 Avoiding Memory Stack Overflows ...
Страница 304: ...Maximizing Local Autonomy HP NonStop SQL MP Programming Manual for C 429847 008 C 4 Skipping Unavailable Partitions ...