| Stonefield Query SDK |
| GetTableFromSQLStatement |
Parameters
The SQL statement to parse.
Return Value
The table specified in the FROM clause.
Example
This example shows code that could be used in the DataEngine.FinalizeSQLStatement script to automatically add a sales person ID to the filter of any report.
Visual FoxPro
lparameters toApplication as SQApplication, tcSelect
local lcSalespersonID, lcTable, lcSelect
lcSalespersonID = toApplication.GetRegistryValue('ID', '', ;
'Software\MyCompany\SalesApplication')
lcTable = toApplication.DataEngine.GetTableFromSQLStatement(tcSelect)
lcSelect = toApplication.DataEngine.AddToWhere(tcSelect, ;
lcTable + ".SalespersonID = '" + lcSalespersonID + "'")
return lcSelect VBScript
function Main(Application, SelectStatement)
SalespersonID = Application.GetRegistryValue("ID", "", _
"Software\MyCompany\SalesApplication")
Table = Application.DataEngine.GetTableFromSQLStatement(SelectStatement)
Main = Application.DataEngine.AddToWhere(SelectStatement, _
Table + ".SalespersonID = " + chr(34) + SalespersonID + chr(34))
end function JavaScript
function Main(Application, SelectStatement) {
var SalespersonID, Table, ReturnValue ;
SalespersonID = Application.GetRegistryValue('ID', ' ',
'Software\MyCompany\SalesApplication') ;
Table = Application.DataEngine.GetTableFromSQLStatement(SelectStatement) ;
ReturnValue = Application.DataEngine.AddToWhere(SelectStatement,
Table + '.SalespersonID = "' + SalespersonID + '"') ;
return ReturnValue ;
}See Also
DataEngine Object
| Last Updated: 02/05/2008 |