sc_set_fetchmode(parm);
|
|
This macro allows to change the type of return from the dataset of the select commands. The macro will processed before running the SQL command. Informing the parameter, the dataset will return the index or the name of the column.
parm = 0 : Returns an array with the index and the name of columns (Scriptcase's Default) parm = 1 : Returns an array only with indexes of the columns
Example 1: Returning an array with the name of the columns.
sc_set_fetchmode(0); sc_select(my_data, "SELECT customerid, stateid, birthdate, creditlimit FROM customers where customerid = 'ALFKI'");
while (!$my_data->EOF){ $meus_dados->fields['customerid']; $customer = $my_data->fields['stateid']; $customer = $my_data->fields['birthdate'];
$my_data->MoveNext(); } $my_data->Close();
--------------------------------------------------------------------------------------
Example 2: Returning an array with the index of the columns.
sc_set_fetchmode(1); sc_select(my_data, "SELECT customerid, stateid, birthdate, creditlimit FROM customers where customerid = 'ALFKI'");
while (!$my_data->EOF){ $my_data->fields[1]; $customer = $my_data->fields[2]; $customer = $my_data->fields[3];
$my_data->MoveNext(); } $my_data->Close();
|
Macro Scope
|
Blank application
|
calendar application
|
chart application
|
Grid application
|
Search application
|
Form application
|
Control Form
|
Menu application
|
Tree menu
|
ReportPDF application
|
allMacros onExecute
|
ajaxFieldonBlur ajaxFieldonChange ajaxFieldonClick ajaxFieldonFocus allMacros onAfterDelete onAfterInsert onAfterUpdate onBeforeDelete onBeforeInsert onBeforeUpdate onInit onLoadAll onRefresh onValidate onValidateFailure onValidateSuccess
|
allMacros onFooter onHeader onInit
|
ajaxFieldonClick allMacros onFooter onGroupBy onHeader onInit onNavigate onRecord
|
allMacros onFilterInit onFilterRefresh onFilterSave onFilterValidate
|
ajaxFieldonBlur ajaxFieldonChange ajaxFieldonClick ajaxFieldonFocus allMacros onAfterDelete onAfterDeleteAll onAfterInsert onAfterInsertAll onAfterUpdate onAfterUpdateAll onBeforeDelete onBeforeDeleteAll onBeforeInsert onBeforeInsertAll onBeforeUpdate onBeforeUpdateAll onClick onInit onLoadAll onNavigate onRecord onRefresh onValidate onValidateFailure onValidateSuccess
|
ajaxFieldonBlur ajaxFieldonChange ajaxFieldonClick ajaxFieldonFocus allMacros onClick onInit onLoadAll onRefresh onValidate onValidateFailure onValidateSuccess
|
allMacros onExecute onLoad
|
allMacros onExecute onLoad
|
allMacros onFooter onHeader onInit onRecord
|
|