Open topic with navigation

TIBCO ActiveSpaces® - Enterprise Edition 5.0.0

# ResultSetMetaData and Function Return Values

ActiveSpaces determines the data types of the return values of functions used in queries at runtime. When the ResultSet for a query contains the return value of a function, VARCHAR is always reported as the data type for the value in the ResultSetMetaData.

To retrieve a function return value from the ResultSet as its actual data type, you must wait until the query is run. After the query has been run, the custom method ResultSetImplDG.getColumnType() can be called, which returns the actual result value type.

For example, suppose you have the following query:

    SELECT COUNT(key) FROM mytable

The ResultSetMetaData reports that the data type for column 1 is VARCHAR. To retrieve the actual data type for column 1 of the query result do the following:

Procedure

1. Unwrap the ResultSet object retrieved when the query is run. For example,

       ResultSetImplDG rsImpl = resultSet.unwrap(com.tibco.datagrid.jdbc.ResultSetImplDG.class);

2. Retrieve the data type of column 1 in the ResultSet. For example,

       int columnType = rsimpl.getColumnType(1);

   The `columnType` must be set to a value from java.sql.Types to indicate the type of the value in the column. The java.sql.Types.NULL value is returned for columns in the row, which do not contain a value.

Did you find this helpful?

Yes No
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO ActiveSpaces® - Enterprise Edition

Copyright © 2009-2025. Cloud Software Group, Inc. All Rights Reserved.