You are here: Transaction Rules > Transaction Elements > Math Element > SQL

Oracle® Insurance XML Configuration Guide Release 9.4.1.0 E23637_01

# SQL

## Description

SQL is used to retrieve a value from the database using a query. The SQL statement should be constructed to return one value. If the results have more than one column and/or more than one row, only the first column of the first row is fetched. The SQL query can have dynamic items within its construct. These items take the form of [VariableName]. VariableName can also include system provided variables like PolicyGUID and SegmentGUID.

## SQL Element/Attribute Table

TYPE=SQL

Element | Attributes | Attribute Value | Element Value
--- | --- | --- | ---
<MathVariable> | TYPE | SQL | A SELECT statement.
LOG | Yes: the result is stored in AsActivityMath table to be used by other activities. No: result is not stored. This is the default behavior. |
DEFAULT | Must be defined when the datatype of the SQL is integer or decimal. | Best practice is to make your default value a value that will indicate you did not retrieve data as expected. Useful for debugging.

## XML Example

<MathVariable VARIABLENAME="RoleGUID" TYPE="SQL" DATATYPE="TEXT">SELECT AsRole.RoleGUID FROM AsRole</MathVariable>

Copyright © 2009, 2011, Oracle and/or its affiliates. All rights reserved. Legal Notices

Open table of contents