of_updatebottomup


pfcdwsrv.pbl   >   pfc_n_cst_dwsrv_linkage   >   of_updatebottomup   

Full name pfc_n_cst_dwsrv_linkage.of_updatebottomup
Access public
Extend of integer
Return value integer
Prototype public function integer of_updatebottomup()

Name Datatype
No Data

Name Datatype
ldw_updatedw u_dw[]
li_i Integer
li_max Integer
ls_sqlspyheading String
ls_sqlspymessage String

public function integer of_updatebottomup ();//////////////////////////////////////////////////////////////////////////////
//
//	Function:  		of_UpdateBottomUp
//
//	Access:    		Public
//
//	Arguments: 		None
//
//	Returns:   		Integer
//   					1 if it succeeds and -1 if an error occurs.
//
//	Description:  	Updates the datawindows in the linked chain, starting with
//					  	the lowest-level datawindow and going up the chain.
//
//	   Note:	This function is not typically called by the developer.  
//         	To cause an update from the bottom-up, call 
//				of_SetUpdateStyle (...), then call of_update.
//
//////////////////////////////////////////////////////////////////////////////
//
//	Revision History
//
//	Version
//	5.0   Initial version
//
//////////////////////////////////////////////////////////////////////////////
//
//	Copyright © 1996-1997 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_i
Integer	li_max
String	ls_sqlspyheading
String	ls_sqlspymessage
u_dw		ldw_updatedw[]

// Create an array of the linked datawindows for update.
If of_CreateUpdateSequence ( ldw_updatedw ) <> 1 Then Return FAILURE 

//If available notify the SQLSpy service.
If IsValid(gnv_app.inv_debug) Then
	If IsValid(gnv_app.inv_debug.inv_sqlspy) Then

		//Create the heading and message for the SQLSpy.
		ls_sqlspyheading = idw_requestor.ClassName() + '.Linkage'
		ls_sqlspymessage = 'Update single-pass BottomUp (inserts/updates/deletes)'
		
		//Send the information to the service for processing.
		gnv_app.inv_debug.inv_sqlspy.of_sqlSyntax  &
			(ls_sqlspyheading, '/*** ' + ls_sqlspymessage + ' ***/')
	End If
End If

// Loop thru the array backwards to create a reverse update sequence ( Bottom-Up ).
li_max = UpperBound ( ldw_updatedw ) 
For li_i = li_max to 1 Step -1
	// Update the datawindow.
	If ldw_updatedw[li_i].Event pfc_update ( FALSE, False ) <> 1 Then Return FAILURE
Next 

Return 1
end function

     
Name Owner
pfc_n_cst_dwsrv_linkage.of_update pfc_n_cst_dwsrv_linkage

     
Name Owner
powerobject.classname powerobject
systemfunctions.isvalid systemfunctions
systemfunctions.upperbound systemfunctions
pfc_n_cst_dwsrv_linkage.of_createupdatesequence pfc_n_cst_dwsrv_linkage
pfc_n_cst_sqlspy.of_sqlsyntax pfc_n_cst_sqlspy
pfc_u_dw.pfc_update pfc_u_dw

     
Full name
demopfc

     
Name Scope
No Data