sqldynsetn() — Define a Cursor Name
Defines and associates a cursor name with a prepared dynamic ESQL statement. This function supports the dynamic EXEC SQL DECLARE... statement.
This function returns normalized values. For more information, see the function return values in the "General Diagnostics" section in this chapter:
sqln
A pointer to the request handle that a previous call to
sqldynprep()
returns. For more information on request handles, see the "SQL Request Handles" section.pname
A pointer to a NULL-terminated string that contains a cursor name (limited to 18 characters) to associate with the SQL statement to which
sqln
refers. If you use the preprocessor, it supplies this value.NOTES
EXAMPLE
- The SQL statements that use a cursor name are FETCH and positioned UPDATE and DELETE statements:
- All cursor names within an ESQL session must be unique. If the application does not define a cursor name with a call to
sqldynsetn()
, ESQL generates one automatically when a SELECT statement is compiled.- Character strings for cursor names are limited to ESQL_MAXCURSNAME characters (plus the NULL terminator), as defined in
proesql.h
. The cursor name must be less than or equal to ESQL_MAXCURSNAME + 1 characters in length.- The application cannot modify a cursor name once that cursor is opened with a call to
sqldynexec()
.This example prepares a cursor specification and declares a cursor for it using the DECLARE statement, converted to a call to
sqldynsetn()
. It also shows how you can use the declared cursor to execute a positioned UPDATE:
SEE ALSO
sqldynexec() — Execute a Dynamic SQL Statement, sqldynprep() — Prepare a Dynamic SQL Statement, sqldyngetn() — Get a Cursor Name
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |