OTX Reference  
OpenTestSystem.Otx.Extensions.SQL.Terms.GetResultValueAsFloat Class Reference

Gets the value from a ResultSet as Float type More...

Inheritance diagram for OpenTestSystem.Otx.Extensions.SQL.Terms.GetResultValueAsFloat:
Inheritance graph

Public Attributes

SimpleTerm column
 Cardinality [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). More...
 
ResultSetTerm resultSet
 Cardinality [1]
This element represents the ResultSet from which the value of the current row will be read. More...
 
- Public Attributes inherited from OpenTestSystem.Otx.Core.Terms.Term
MetaData metaData
 Cardinality [0..1]
The MetaData type allows tools to store additional, mainly tool-specific data. More...
 

Detailed Description

Gets the value from a ResultSet as Float type

The GetResultValueAsFloat returns the value of the given column (via index or name) inside the row as a Float.

Exceptions
Core.Exceptions.OutOfBoundsException
  • If result is empty.
  • If the index of the given column is not within the range [0, n-1], where n is the number of the data record columns.
  • If the name of the given column does not exists in the data record.
Core.Exceptions.TypeMismatchExceptionIf the data type of the column value is not a Float.
Checker rules
CheckerRule.SQL_Chk001 - Correct column data type

Syntax
FloatTerm = SQL.GetResultValueAsFloat(ResultSetTerm resultSet, SimpleTerm column);
ResultSetTerm resultSet
Cardinality [1] This element represents the ResultSet from which the value of the current row will be...
Definition: SQL.cs:1038
SimpleTerm column
Cardinality [1] This element represents the column from which the value will be read....
Definition: SQL.cs:1048
Examples
// Local Declarations
SQL.Connection Connection1;
SQL.ResultSet ResultSet1;
Float Float1;
// Flow
try
{
// connect with DotNet platform
Connection1 = SQL.CreateConnection("DRIVER={SQL Server};Server=.;InitialCatalog=classicmodels;username=sa;password=saas");
}
catch (Exception)
{
// connect with Java platform
Connection1 = SQL.CreateConnection("jdbc:sqlserver://localhost;databaseName=classicmodels;username=sa;password=saas");
}
catch (Exception Exception1)
{
throw Exception1;
}
SQL.ExecuteQuery(Connection1, "select * from classicmodels.dbo.orderdetails", ResultSet1);
while (SQL.NextResult(ResultSet1)) : WhileLoop1
{
Float1 = SQL.GetResultValueAsFloat(ResultSet1, "priceEach");
}
SQL.CloseConnection(Connection1);

Member Data Documentation

◆ column

SimpleTerm OpenTestSystem.Otx.Extensions.SQL.Terms.GetResultValueAsFloat.column

Cardinality [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).

◆ resultSet

ResultSetTerm OpenTestSystem.Otx.Extensions.SQL.Terms.GetResultValueAsFloat.resultSet

Cardinality [1]
This element represents the ResultSet from which the value of the current row will be read.