Please enable JavaScript to view this site.

Navigation: Advanced topics > Programming topics > Database API > Methods

Database API: DBLookup

Scroll Prev Next More

 

Executes a SQL query passed as a parameter. Returns the first value of the first entry or null if nothing is found.

Syntax

DB.DBLookup(XVar sql)

Arguments

sql

a SELECT clause. Example: "select name from UsersTable where ID=32".

Return value

Returns the first value of the first entry or null if nothing is found.

Example

Returns the zip value where userid is 25:

 

XVar zip = DB.DBLookup("select zip from carsmake where userid=25");

See also:

Database API

DB API: Exec