|
pfc_values
|
|
Full name
|
pfc_n_cst_dwsrv_querymode.pfc_values
|
Access
|
public
|
Extend of
|
integer
|
Return value
|
integer
|
Prototype
|
event integer pfc_values()
|
Name
|
Datatype
|
la_args
|
any[]
|
la_colvalue
|
any[]
|
li_rc
|
integer
|
ll_pos
|
long
|
lnv_selection
|
n_cst_selection
|
ls_col
|
string
|
ls_colreturn
|
string[]
|
ls_dbname
|
string
|
ls_sqlsyntax
|
string
|
ls_table
|
string
|
ls_value
|
string
|
event pfc_values;call super::pfc_values;//////////////////////////////////////////////////////////////////////////////
//
// Event: pfc_values
//
// Arguments: none
//
// Returns: integer
// 1 = success
// 0 = user cancelled from selection window
// -1 = error
//
// Description:
// Allows user to select from a list of available database
// values for the current column of idw_requestor
//
//////////////////////////////////////////////////////////////////////////////
//
// Revision History
//
// Version
// 5.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.
//
//////////////////////////////////////////////////////////////////////////////
any la_colvalue[]
any la_args[]
integer li_rc
long ll_pos
string ls_col
string ls_dbname
string ls_table
string ls_value
string ls_colreturn[]
string ls_sqlsyntax
n_cst_selection lnv_selection
SetPointer (hourglass!)
// Validate requestor
if IsNull(idw_requestor) Or not IsValid (idw_requestor) then
return -1
end if
// Validate transaction object on requestor
if IsNull(idw_requestor.itr_object) Or &
not IsValid (idw_requestor.itr_object) then
return -1
else
if not idw_requestor.itr_object.of_IsConnected() then
return -1
end if
end if
// Get current column
ls_col = idw_requestor.GetColumnName()
if Len (ls_col) = 0 then
return -1
end if
// Get column DBname
ls_dbname = idw_requestor.Describe (ls_col + ".dbname")
if Len (ls_dbname) = 0 then
return -1
end if
// Determine table for column DBname
ll_pos = Pos (ls_dbname, ".")
ls_table = Left (ls_dbname, ll_pos - 1)
if Len (ls_table) = 0 then
return -1
end if
// Form SQL syntax
ls_sqlsyntax = "select distinct " + ls_dbname + " from " + ls_table
// Open selection window
li_rc = lnv_selection.of_Open (ls_sqlsyntax, la_colvalue[], idw_requestor.itr_object, ls_colreturn[], la_args[], "Values")
if li_rc > 0 then
ls_value = String (la_colvalue[1])
idw_requestor.ReplaceText (ls_value)
end if
return li_rc
end event
Name
|
Owner
|
datawindow.describe |
datawindow
|
datawindow.getcolumnname |
datawindow
|
datawindow.replacetext |
datawindow
|
systemfunctions.isnull |
systemfunctions
|
systemfunctions.isvalid |
systemfunctions
|
systemfunctions.left |
systemfunctions
|
systemfunctions.len |
systemfunctions
|
systemfunctions.pos |
systemfunctions
|
systemfunctions.setpointer |
systemfunctions
|
systemfunctions.string |
systemfunctions
|
pfc_n_cst_selection.of_open |
pfc_n_cst_selection
|
pfc_n_tr.of_IsConnected |
pfc_n_tr
|