of_sqlpreview


pfcutil.pbl   >   pfc_n_cst_sqlspy   >   of_sqlpreview   

Full name pfc_n_cst_sqlspy.of_sqlpreview
Access public
Extend of integer
Return value integer
Prototype public function integer of_sqlpreview(string,sqlpreviewfunction,sqlpreviewtype,ref string,dwbuffer,long)

Name Datatype
No Data

Name Datatype
lnv_conversion n_cst_conversion
ls_newentry_heading string
ls_sqltype string

public function integer of_sqlpreview (string as_controlname, sqlpreviewfunction a_sqlpreviewfunction, sqlpreviewtype a_sqlpreviewtype, ref string as_sqlsyntax, dwbuffer a_dwbuffer, long al_row);//////////////////////////////////////////////////////////////////////////////
//
//	Function:  		of_SQLPreview
//
//	Access:  		public
//
//	Arguments:
//	as_controlname				Control name. (i.e.,dw_1.ClassName() or ds_1.ClassName())
//	a_sqlpreviewfunction		SQLPreview arg from control: sqlpreviewfunction
//	a_sqlpreviewtype			SQLPreview arg from control: sqlpreviewtype
//	as_sqlsyntax				SQLPreview arg from control: sqlsyntax by Reference
//	a_dwbuffer					SQLPreview arg from control: dwbuffer
//	al_row						SQLPreview arg from control: row
//
//	Returns:  		integer
//						0 if it succeeds and the caller's processing should 
//							continue as normal.
//						1 if it suceeds but the caller's proccessing should stop.
//						2 if it succeeds but the caller's processing should skip 
//							this request and execute the next request (if any).
//						-1 if an error occurs.
//						If any argument's value is NULL, function returns NULL.
//
//	Description:  	Called from a datawindow's SQLPreview event.
//						Receive all the arguments from the SQLPreview event of the 
//						calling datawindow.  Create the appropriate heading and 
//						then call the function to process the SQL syntax.
//
//////////////////////////////////////////////////////////////////////////////
//
//	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.
//
//////////////////////////////////////////////////////////////////////////////

string	ls_newentry_heading
string	ls_sqltype
n_cst_conversion lnv_conversion

//Check arguments
If IsNull(as_controlname) or IsNull(a_sqlpreviewfunction) or &
		IsNull(a_sqlpreviewtype) or IsNull(as_sqlsyntax) or IsNull(a_dwbuffer) or &
		as_sqlsyntax = '' Then
	Return -1
End If


//Get the string that represents a_sqlpreviewtype
ls_sqltype = lnv_conversion.of_string(a_sqlpreviewtype)

//Create the heading based on the type of SQLPreview
	ls_newentry_heading = ls_sqltype + ' - ' + as_controlname 
If Pos(Lower(ls_sqltype),Lower('Retrieve')) = 0  Then
	ls_newentry_heading = ls_newentry_heading + '(' + string(al_row) + ')'
End If

//There is now a Heading for the Syntax.
If Pos(Lower(ls_sqltype),Lower('Retrieve')) > 0  Then
	//There is no Pause capabilities for Retrive actions
	Return of_SQLSyntax(ls_newentry_heading, as_sqlsyntax, False )
End If

//There is Pause capabilities for all other actions
Return of_SQLSyntax(ls_newentry_heading, as_sqlsyntax, True )

end function

     
Name Owner
pfc_u_dw.sqlpreview pfc_u_dw
pfc_n_ds.sqlpreview pfc_n_ds

     
Name Owner
systemfunctions.isnull systemfunctions
systemfunctions.lower systemfunctions
systemfunctions.pos systemfunctions
systemfunctions.string systemfunctions
pfc_n_cst_conversion.of_string pfc_n_cst_conversion
pfc_n_cst_sqlspy.of_sqlsyntax pfc_n_cst_sqlspy

     
Full name
No Data

     
Name Scope
No Data