PUT Statement [ESQL]

Inserts a row into the specified cursor.

Quick Links:

Go to Parameters

Go to Examples

Go to Usage

Go to Standards

Go to Permissions

Syntax

PUT cursor-nameUSING DESCRIPTOR sqlda-name 
   | FROM hostvar-list ] [ INTODESCRIPTOR into-sqlda-name 
   | into-hostvar-list } ] [ ARRAY :nnn ]

Parameters

(back to top)

Examples

(back to top)

Usage

(back to top)

Inserts a row into the named cursor. Values for the columns are taken from the first SQLDA or the host variable list, in a one-to-one correspondence with the columns in the INSERT statement (for an INSERT cursor) or the columns in the select list (for a SELECT cursor).

The PUT statement can be used only on a cursor over an INSERT or SELECT statement that references a single table in the FROM clause, or that references an updatable view consisting of a single base table.

If the sqldata pointer in the SQLDA is the null pointer, no value is specified for that column. If the column has a DEFAULT VALUE associated with it, that is used; otherwise, a NULL value is used.

The second SQLDA or host variable list contains the results of the PUT statement.

For information on putting LONG VARCHAR or LONG BINARY values into the database, see SET statement [ESQL].

Side Effects
  • When inserting rows into a value-sensitive (keyset-driven) cursor, the inserted rows appear at the end of the result set, even when they do not match the WHERE clause of the query or if an ORDER BY clause would normally have placed them at another location in the result set.

Standards

(back to top)

  • SQL—ISO/ANSI SQL compliant.
  • SAP Sybase Database product—Supported by Open Client/Open Server.

Permissions

(back to top)

Requires INSERT privilege.

Related reference
DELETE (positioned) Statement [ESQL] [SP]
INSERT Statement
SET Statement [ESQL]
UPDATE Statement
UPDATE (positioned) Statement [ESQL] [SP]