Skip to content

SQLFetch Command

SQLFetch

Obsolete

Refer to the SQLFetch method in the cSQLStatement class.

SQLFetch hstmt [To Var1 [Var2]]

The SQLFetch command will fetch the next row of a statement's result set. The columns are placed in the variables passed as arguments.

Example Usage

Open Customer
SQLFileConnect Customer To hdbc
SQLOpen hdbc To hstmt
SQLExecDirect hstmt "SELECT Name, Address FROM CUSTOMER WHERE AccntMngr = 'Mary'"

Repeat
    SQLFetch hstmt To Customer.Name Customer.Address
    If (SQLResult = SQLSuccess) ;
        Showln Customer.Name ", " Customer.Address
Until (Not(SQLResult))

Open Customer
SQLFileConnect Customer To hdbc
SQLOpen hdbc To hstmt
SQLExecDirect hstmt "SELECT count(*) FROM CUSTOMER WHERE AccntMngr = 'Mary'"
SQLFetch hstmt To iCount

If (SQLResult) ;
    Showln "There are " iCount " customers for account manager Mary"
Else ;
    Showln "There are no customers for account manager Mary"