Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

INTO

USING

More Information

cursor name

RDB/VMS SQL FETCH — VMS RDB_4.1_M

 FETCH ─┬─> cursor-name ─┬─┐
        └─> parameter ───┘ │
       ┌───────────────────┘
       └┬───────────────────>───────────────────┬──> typebox (;)
        ├──> 
I

N

T

O
─┬─> parameter ─┬─────────────┤ │ └───── , <─────┘ │ └──> 
U

S

I

N

G

D

E

S

C

R

I

P

T

O

R
descriptor-name ──┘

Additional information available:

INTOUSING

More Informationcursor name

More Information

 The FETCH statement advances a cursor to the next row of its
 result table and retrieves the values from that row.

 You can use the FETCH statement in interactive SQL, in
 precompiled programs, or as part of an SQL module language
 procedure.  When used in precompiled programs or as part of an
 SQL module language procedure, FETCH assigns the values from the
 row to parameters.  In interactive SQL, FETCH displays the value
 of the row on the terminal screen.

 When used with a list cursor, the FETCH statement positions the
 cursor on a specified place within a list and retrieves a
 portion of the list.  When you fetch a list cursor in
 interactive SQL, you cannot use the USING clause.  With list
 cursors, you can only use the USING clause in a dynamic FETCH
 statement.

 When you use the FETCH statement with a table cursor, you cannot
 use the INTO and USING clauses in interactive SQL.  You must use
 either the INTO or USING clause in FETCH statements that are
 embedded in precompiled programs or are part of an SQL module
 language procedure.

cursor name

 The name of the cursor from which you want to retrieve a row.

INTO

 The INTO clause specifies a list of parameters to receive the
 values SQL retrieves from the cursor.  The number of parameters
 in the list must be the same as the number of values in the row
 of the cursor.  (If any of the parameters are host structures,
 SQL counts the number of variables in that structure when it
 compares the number of parameters in the INTO clause with the
 number of values in the row.)

 The data types of parameters must be compatible with the values
 of the corresponding column of the cursor row.

USING

 Specifies the name of a descriptor that corresponds to an SQL
 Descriptor Area (SQLDA).  In a precompiled program, if you used
 the INCLUDE statement to insert the SQLDA into your program, the
 descriptor name is simply SQLDA.  Programs that call SQL module
 language procedures must explicitly declare an SQLDA descriptor
 and can give it any name.

 An SQLDA is a collection of variables used only in dynamic SQL.
 In a FETCH statement, the SQLDA points to a number of parameters
 SQL uses to receive the values of the row.  The number of
 variables must match the number of values in the row.

 The data types of parameters must be compatible with the values
 of the corresponding column of the cursor row.

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026