title | desc | img | html | ||||
---|---|---|---|---|---|---|---|
Execute an SQL query and get a record |
The command executes an SQL query and stores the first record in a variable. |
|
|
The SQL Row command executes an SQL query to select data and writes the first record found to an object variable.
%html.sql-row%
SQL Connection
Provide a variable name with the SQL connection identifier. This variable must be defined in the SQL Connection command.
SELECT Statement
Specify an SQL SELECT query to retrieve a record from the database. If the query finds more than one record, the first record is returned. If the query finds no records, an error will be returned.
select * from #dbtable# where id=1
Parameters.
It is recommended to use parameters when using values in an SQL query.
For example, you need to add one parameter when using this query. You can use #varname# variable substitution in parameter values.
select * from #dbtable# where iduser = ?
#iduser#
Result Variable
Specify the name of the variable to which the resulting associative array with column values will be saved.
#item.name#
#myrec.count#