Script functions reference > Script functions in alphabetical order > O > OdbcGetOne

OdbcGetOne
Syntax
OdbcGetOne(str_dbidentifier, str_sql_statement,                  var_1[, var_2, var_n]);
str_dbidentifier 
str_sql_statement
var_n
Description
Executes an SQL statement and copies the values from the first row in the result set to script variables. The query is closed when the first row has been retrieved, and all resources allocated by the query will be released. Using this function is equivalent to calling OdbcGetFirst and then calling OdbcCloseQuery.
Returns
1
0
-1
Example
$st="SELECT CUSTNAME FROM CUSTOMER WHERE CUSTID="+$cnr + ";";
OdbcGetOne("my_identifier", $st, $custname);
OpenText StreamServe 5.6 Updated: 2013-03-01