Introduction Installation Beginning Admin Quick Ref FTP Server SMTP Server Database Security
Statements Objects String Parsing Events Queues Samples Special names Error Handling Accessories   Back
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)=" 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>

         
Home       Back