NAME
SQLdeclareCursor - Declare an SQL cursor inside tcl

SYNOPSIS
SQLdeclareCursor cursor

DESCRIPTION

The SQLdeclareCursor command allocates space for an SQL cursor. SQL cursors are used to retrieve data from select commands that return multiple rows of data.

Cursor names must be unique among all the cursors across all tcl interpreters. Defining a second cursor with the same name as the first will produce an error message, and SQLdeclareCursor will return TCL_ERROR.

EXAMPLE

This command will select all the columns in table vertex2 of database dbdict:
        SQLopendb dbdict
        SQLdeclareCursor curs
        SQLprepareCursor curs "select * from tables";
        SQLdescribeCursor curs header;
        #Print out the header.
        parray header
        SQLopenCursor -readonly curs;
        while {[SQLmoreRows curs]} {
          SQLfetchCursor curs row 1;
          #Print out a row.
          parray row;
        }

KEYWORDS
database, cursor

SEE ALSO
SQLcloseCursor(3)