Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » UltraLite - Database Management and Reference » UltraLite SQL Elements Reference » Expressions in UltraLite

Subqueries in expressions Next Page

Input parameters

Acts as placeholders to allow end-users to supply values to a prepared statement. These user-supplied values are then used to execute the statement.


{ ? | :name [ : indicator-name ] }


Use the placeholder character of ? or the named form in expressions. You can use input parameters whenever you can use a column name or constant.

The precise mechanism used to supply the values to the statement are dependent upon the API you use to create your UltraLite client.

Using the named form    The named form of an input parameter has special meaning. In general, name is always used to specify multiple locations where an actual value is supplied.

For embedded SQL applications only, the indicator-name supplies the variable into which the null indicator is placed. If you use the named form with the other components, indicator-name is ignored.

Deducing data types    The data type of the input parameter is deduced when the statement is prepared from one of the following patterns:

If the type cannot be deduced, UltraLite generates an error. For example:

See also

The following embedded SQL statement has two input parameters:

INSERT INTO MyTable VALUES ( :v1, :v2, :v1)

The first instance of v1 supplies its value to both the v2 and v1 locations in the statement.