Extensions.SQL.GetResultValueAsString
Jump to navigation
Jump to search
Contents
Classification
Name | GetResultValueAsString |
Short Description | Returns the value of the given column inside the row as a String. |
Class | Term |
Extension | OTX SQL extension |
Group | SQL related Terms |
Exceptions | OutOfBoundsException TypeMismatchException |
Checker Rules | SQL_Chk001 |
Standard Compliant | Yes |
OTL Syntax
StringTerm SQL.GetResultValueAsString(ResultSetTerm resultSet, SimpleTerm column);
Description
The GetResultValueAsString returns the value of the given column (via index or name) inside the row as a String.
Return Value
The Term returns the value, see table below.
In OTX, Terms are categorized according to its return data type!
Data Type | Description |
String | The value of the given column (via index or name) inside the row as a String. |
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;
String String1;
/// 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.offices", ResultSet1);
while (SQL.NextResult(ResultSet1)) : WhileLoop1
{
String1 = SQL.GetResultValueAsSting(ResultSet1, "country");
}
SQL.CloseConnection(Connection1);