Home
Main Introduction Features Constants Statements Database Objects Parser Serial-Communication Samples Misc
Database>Select statement>Properties>Using Form Fields, Variables and Constants
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)="where firstname=John and title=manager"
select from contacts where {varname}

</CARAVAN>
Caravan Business Server>Help>Database>Select statement> Properties> Wild Card Search
Name Wild Card Search
Text Wildcard characters are used to search for words in the table. They are used with the keyword Like and represent any character in a string.
Caravan uses the wildcard *.
Syntax Expression Like string
Sample Pattern matching
<CARAVAN>
table contacts = contacts.contacts
select from contacts where firstname like "John*"
// returns records with firstname beginning with John
</CARAVAN>

<CARAVAN>
table contacts = contacts.contacts
select from contacts where firstname like "*John"
// returns records with firstname ending with with John
</CARAVAN>

<CARAVAN>
table contacts = contacts.contacts
select from contacts where firstname like "*John*"
// returns records with firstname having John anywhere in the string
</CARAVAN>
Back