f2s_split_array_helper

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

Syntax

f2s_split_array_helper  {variant[]} to {variables…}

Parameter

Description

variant

Optional variant type variable that will receive a statement interface

variables

The variables that will receive the values from the variant

Description

This command accepts a variant[] and moves the array elements into separate variables. Although it can be used anytime, it was designed to work with f2s_esql_get_row so that minimal code changes are needed for code that was using the older SQL_FETCH_NEXT_ROW into command. The variables that will receive the values from the variant must be in the same order as the dataset that is returned.

The variant is an array that will fetch an entire row to a single variable. The f2s_split_array_helper is used to break this variant array back into separate variables to make your code easier to convert. Also, we have a new version of cMertechStructAnalyzer.pkg that includes functions to take a variant array and load it into a structure variable.

Example
    Variant[] vRow
    f2s_esql_create_stmt "select * from customer"
    f2s_esql_prepare_stmt
    f2s_esql_execute_stmt
    f2s_esql_move_next
    While (Found)
    f2s_esql_get_row vRow
    f2s_split_array_helper vRow to iRecnum iCustomerId sName sAddress sCity sState sZip sPhone sFax
    Showln ("Customer Name:" * sName * "Address" * sAddress)
    f2s_esql_move_next
    Loop
    f2s_esql_close_stmt
    inkey WindowIndex

Related Commands