|
of_ConvertToRow
|
|
Full name
|
pfc_n_cst_lvsrv_datasource.of_ConvertToRow
|
Access
|
public
|
Extend of
|
integer
|
Return value
|
integer
|
Prototype
|
public function integer of_ConvertToRow(any[],ref n_ds,ref long)
|
Name
|
Datatype
|
li_cnt
|
Integer
|
li_columns
|
Integer
|
ls_Sqlerr
|
string
|
lw_parentwindow
|
window
|
public function integer of_ConvertToRow (any aa_columnvalues[], ref n_ds ads_obj, ref long al_row);//////////////////////////////////////////////////////////////////////////////
// Public Function: of_ConvertToRow
// Arguments: aa_ColumnValues[] The array containing the data to be used for the new row.
// ads_obj The datastore to place the new row in (the dataobjects should have
// the same column types). Passed by reference
// al_Row The new row of the array in the datastore. Passed by reference
// Returns: Integer
// 1 if successful
// -1 if an error occurrs.
// Description: Convert an array of values which corresponded to columns in the
// source dataobject to a row in a datastore. A row does not have to
// be added to the data source first using this method
//////////////////////////////////////////////////////////////////////////////
// Rev. History: Version
// 6.0 Initial version
//////////////////////////////////////////////////////////////////////////////
// Copyright © 1996-1999 Sybase, Inc. and its subsidiaries. All rights reserved. Any distribution of the
// PowerBuilder Foundation Classes (PFC) source code by other than Sybase, Inc. and its subsidiaries is prohibited.
//////////////////////////////////////////////////////////////////////////////
Integer li_columns, li_cnt
string ls_Sqlerr
window lw_parentwindow
// check reference variables
if IsNull(ilv_requestor) or not IsValid(ilv_requestor) then return -1
if UpperBound(aa_columnvalues) < 1 then return -1
// Populate the storage datastore
if inv_Attrib.is_Method = inv_Cache.SQL then
ads_obj.Create( inv_Attrib.is_DataObject, ls_sqlerr )
if Len(ls_sqlerr) > 0 then return -1
else
ads_obj.DataObject = inv_Attrib.is_DataObject
end if
ads_obj.of_SetBase(true)
ilv_requestor.of_GetParentWindow(lw_parentwindow)
ads_obj.of_SetParentWindow(lw_parentwindow)
al_row = ads_obj.InsertRow(0)
if al_row < 1 then return -1
// copy the argument array to the datastore column by column
li_columns = UpperBound(aa_columnvalues)
for li_cnt = 1 to li_columns
ads_obj.Object.Data[al_row, li_cnt] = aa_columnvalues[li_cnt]
end for
return 1
end function