Extensions.SQL.GetResultValueAsInteger
Jump to navigation
Jump to search
Contents
Classification
Name | GetResultValueAsInteger |
Short Description | Returns the value of the given column inside the row as a Integer. |
Class | Term |
Extension | OTX SQL extension |
Group | SQL related Terms |
Exceptions | OutOfBoundsException TypeMismatchException |
Checker Rules | SQL_Chk001 |
Standard Compliant | Yes |
OTL Syntax
IntegerTerm SQL.GetResultValueAsInteger(ResultSetTerm resultSet, SimpleTerm column);
Description
The GetResultValueAsInteger returns the value of the given column (via index or name) inside the row as a Integer.
Return Value
The Term returns the value, see table below.
In OTX, Terms are categorized according to its return data type!
Data Type | Description |
Integer | The value of the given column (via index or name) inside the row as a Integer. |
Properties
Name | Data Type | Class | Default | Cardinality | Description |
resultSet | ResultSet | Term | - | [1..1] | This element represents the ResultSet from which the value of the current row will be read. |
column | Simple | Term | - | [1..1] | This element represents the column from which the value will be read. A column can be accessed via name or via index. Therefore the data type of the column property will be String (name) or Integer (index). |
OTL Examples
/// Local Declarations
SQL.Connection Connection1;
SQL.ResultSet ResultSet1;
Integer Integer1;
/// Flow
try
{
// for DotNet platform
Connection1 = SQL.CreateConnection("DRIVER={SQL Server};Server=.;InitialCatalog=classicmodels;username=sa;password=saas");
}
catch (Exception)
{
// for Java platform
Connection1 = SQL.CreateConnection("jdbc:sqlserver://localhost;databaseName=classicmodels;username=sa;password=saas");
}
SQL.ExecuteQuery(Connection1, "select * from classicmodels.dbo.orderdetails", ResultSet1);
while (SQL.NextResult(ResultSet1)) : WhileLoop1
{
Integer1 = SQL.GetResultValueAsInteger(ResultSet1, "quantityOrdered");
}
SQL.CloseConnection(Connection1);