Extensions.SQL.GetResultValueAsFloat

From emotive
Jump to navigation Jump to search

Classification

Name GetResultValueAsFloat
Short Description Returns the value of the given column inside the row as a Float.
Class Term
Extension OTX SQL extension
Group SQL related Terms
Exceptions OutOfBoundsException
TypeMismatchException
Checker Rules SQL_Chk001
Standard Compliant Yes

OTL Syntax

FloatTerm SQL.GetResultValueAsFloat(ResultSetTerm resultSet, SimpleTerm column);

Description

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

Return Value

The Term returns the value, see table below.

Icons Note.png In OTX, Terms are categorized according to its return data type!
Data Type Description
Float The value of the given column (via index or name) inside the row as a Float.

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;
	Float Float1;

	/// 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
	{
		Float1 = SQL.GetResultValueAsFloat(ResultSet1, "priceEach");
	}

	SQL.CloseConnection(Connection1);

See also

CloseConnection
ExecuteQuery
ExecuteUpdate
ConnectionTerm
ConnectionValue
CreateConnection
GetResultValueAsBoolean
GetResultValueAsByteField
GetResultValueAsFloat
GetResultValueAsInteger
GetResultValueAsString
NextResult
ResultSetTerm
ResultSetValue