Caravan Business Server>Help>Database>Select statement>
Properties>
Using Form Fields, Variables and Constants
|
Name
|
Using Form Fields, Variables and Constants
|
Text
|
You can use Form Fields, Var sql Variables and Constants in a select statement. Form fields and Var sql variables should be enclosed within curly brackets {…} when they are used in the where clause in the select statement. Constants need not be enclosed within double quotes ('..') in select statements.
|
Syntax
|
|
Sample
|
Form field <CARAVAN> table contacts = contacts.contacts select from contacts where firstname={formfieldname} </CARAVAN>
//formfiledname is the text field containing the name. This is passed to the current web page by Post method from a previous web page.
//Constants <CARAVAN> table contacts = contacts.contacts select from contacts where firstname="John" </CARAVAN>
Var sql <CARAVAN> table contacts = contacts.contacts var sql sql(varname)="John" select from contacts where firstname={varname}
</CARAVAN>
//Dynamic query statements <CARAVAN> table contacts = contacts.contacts var sql sql(varname)=" firstname=John and title=manager" select from contacts where {varname} </CARAVAN>
|