f2s_esql_move_previous

Applies to: Oracle, MS SQL, MySql/MariaDB, PostgreSQL Drivers

Syntax

f2s_esql_move_previous [{ Boolean variable}] [using {variant}]

Parameter

Description

Boolean variable

Optional Boolean variable to indicate the success or failure of the command

variant

Optional variant type variable that will receive a statement interface

Description

This command is used to fetch the previous row returned by the associated SQL statement.

The command will set the Found property, if the optional Boolean variable is not used.

The optional “using” syntax allows you to pass around the interface created by this command. The variable passed MUST be a variant. This allows for multiple statements to be active concurrently in some cases. If you use the “using” syntax, it must be used on all subsequent commands. Mixing the using syntax is not supported. So for instance, if you plan on having multiple statements active concurrently, all active statements must make use of the using syntax.

Note that the columns are fetched in the order that the SQL statement generates them, so the variables must follow the same order.

Error Codes

Error Code

Error Message

25006

There is no active result set to advanced on for this statement.

Examples

** A SQL Server example **
    Variant vStat
    Variant[] vRow

    f2s_esql_create_stmt "Select * from sys.databases" using vStat
    f2s_esql_set_cursor_type f2s_olecursor_server using vStat
    f2s_esql_prepare_stmt using vStat

    f2s_esql_execute_stmt using vStat
    f2s_esql_move_next using vStat
    While (Found)
        f2s_esql_get_row vRow using vStat
        Showln "Forward direction Item: " vRow[0]
        f2s_esql_move_next using vStat
    Loop

    //reverse direction
    f2s_esql_move_previous using vStat
    While (Found)
        f2s_esql_get_row vRow using vStat
        Showln "Back direction item: "  vRow[0]
        f2s_esql_move_previous using vStat
    Loop
    f2s_esql_close_stmt using vStat
    inkey windowIndex

Related Commands

Replaces: n/a