TABLEDB

The TABLEDB function outputs the results of a database query.

If the query results in the output of a single field's data, this data is cast to an appropriately similar data type. For example, a VARCHAR is cast to a String.

If the query results in the output of multiple fields, the data is separated by the specified Delimiter and output as a single String.

Input

Number of Connections: Min: 0/Max:Infinite
InputData TypeDescription
InputNAllData

Output

OutputData TypeDescription
Output1AllThe query result.

Property

NameProperty TypeDescription
ConnectionString

Specifies the ASMC(ASTERIA Server Management Console) defined connection to use to connect to the database.

SQLString

The SQL query statement. Use the Java PreparedStatement, using the question mark ("?") to locate where field names are to be inserted in the statement.

For example, if the TABLEDB function's SQL property statement is defined as "select field2 from tablename where field1=?", this function component's first input will be inserted in the statement in place of the question mark ("?") and then used to query the database.

Multiple keys can be defined in a statement. An example of a statement using multiple keys is "select field2 from tablename where field1=? and field3=?". In this case, the TABLEDB function requires two inputs, with each input replacing their respective question mark ("?") in the statement.

Similarly, a statement such as "select * from tablename" that does not require any inputs can be used.

If the number of inputs does not match the number of question marks ("?") in the statement, a bind error will occur resulting in an Exception.

DelimiterStringThe delimiter used to separate multiple field data resulting from a query.
Zero RecordchoiceSpecifies the result to be returned if no matching data is found:

Null - A Null is output.
Key - The first input key is passed directly as output.
DefaultValue - The DefaultValue is output.
Exception - An Exception is thrown.
More recordschoiceSpecifies how result data is returned if a query results in multiple records:

1 record - Returns only the first record.
Null - Returns an empty String ("").
Exception - An Exception is thrown.
DefaultValueString

The default value to be output when Zero Record is set to DefaultValue and no matching data is found.