dblookup
Assigns the input record to the placeholder of the SQL query and execute the query. The column values of the first loaded record is assigned to the fields.
Syntax
dblookup PROFILE [bypass=BOOL_EXPR] SQL_STATEMENT
Required Parameter
PROFILE
-
JDBC connect profile. You can configure the connect profile in the web console.
SQL_STATEMENT
-
SQL query statement to run.
-
You can define the input parameter that starts with a colon (
:
) in the SQL query command. The input parameter is in the form of:name
, and the field value of the input record is assigned.
Optional Parameter
bypass=BOOL_EXPR
- Boolean expression as condition for not executing the SQL query command. If the condition is true, the command exports the output without executing the SQL query statement.Tipbypass=BOOLEAN_EXPR generally configures the conditional expression so that the command does not execute SQL unless there is a field value that falls into the conditional clause.
Usage
Expand the field by importing the user name (name
) and gender (sex
) with the login value.
json "{'login':'logpresso'}"
| dblookup USERDB bypass="isnull(login)"
select name, sex from users where login = :login