OdbcMoreResults Function

Action

Determines whether more result data sets or row counts are available for a cursor, and if so, initializes processing for the next result data set or row count information available.

Include file

ODBC.bdh

Syntax

OdbcMoreResults( in cCursor: cursor ) : boolean;

Return value

  • true if more result data sets or row counts are available for the cursor

  • false otherwise

Parameter Description
cCursor Cursor associated with a database connection.

Example

var
  hEnv, hDbc : number;
  cCursor : cursor;

dcltrans
  transaction TMain
  begin
    OdbcAlloc(SQL_HANDLE_ENV, hEnv);
    OdbcAlloc(SQL_HANDLE_DBC, hDbc, hEnv);
    OdbcConnect(hDbc, "DSN=database;UID=user;PWD=pass;");
    OdbcOpen(cCursor, hDbc);
    OdbcPrepare(cCursor, sqlSelect);
    OdbcExecute(cCursor);
    OdbcDefine(cCursor, "1", SQL_C_CHAR, 32);
    OdbcDefine(cCursor, "2", SQL_C_LONG);
    OdbcFetch(cCursor);
    write("name: " + OdbcGetString(cCursor, "1"));
    writeln(" age: " + (string)OdbcGetInt(cCursor, "2"));
    if OdbcMoreResult(cCursor) then
      writeln("more entries available");
    end;
    OdbcClose(cCursor, SQL_DROP);
    OdbcCommit(hDbc);
    OdbcDisconnect(hDbc);
    OdbcFree(hDbc);
    OdbcFree(hEnv);
  end TMain;

dclsql
  sqlSelect:
  SELECT * FROM persons;