oajava.sql
Class jdam

java.lang.Object
  |
  +--oajava.sql.jdam

public class jdam
extends java.lang.Object

Expose Data Access Manager (DAM) API using Java.


Constructor Summary
jdam()
           
 
Method Summary
static int dam_add_damobj(int iType, int pList, int pSearchObj, int pObj)
          Add a schema object to the list of objects returned to the DAM.
static int dam_addCharValToRow(int dam_hstmt, int hRow, int hCol, java.lang.String pColVal, int lColValLen)
          Add the String value for the Column.
static int dam_addDoubleValToRow(int dam_hstmt, int hRow, int hCol, double pColVal, int lColValLen)
          Add the Double value for the Column.
static void dam_addError(int hdbc, int hstmt, int iErrorIndex, int iNativeError, java.lang.String sErrorText)
          Add an error to the error list maintained by the DAM.
static int dam_addFloatValToRow(int dam_hstmt, int hRow, int hCol, float colVal, int lColValLen)
          Add the Float value for the Column.
static int dam_addIntValToRow(int dam_hstmt, int hRow, int hCol, int pColVal, int lColValLen)
          Add the Integer value for the Column.
static int dam_addJoinRowSet(int hrowset, int hrow)
          Associate the join rowset of the inner table with the outer table row.
static int dam_addOutputRow(int hstmt, int hrow)
          Provide the row to the DAM for returning return values and output parameters from stored procedures.
static int dam_addRowToRowSet(int hrowset, int hrow)
          Add the row to the join rowset.
static int dam_addRowToTable(int dam_hstmt, int hrow)
          Add the row to the result set.
static int dam_addShortValToRow(int dam_hstmt, int hRow, int hCol, short pcolVal, int lColValLen)
          Add the Short value for the Column.
static int dam_addTimeStampValToRow(int dam_hstmt, int hRow, int hCol, xo_tm pColVal, int lColValLen)
          Add the Time Stamp value for the Column.
static int dam_allocOutputRow(int hstmt)
          Allocate a output and return its handle.
static int dam_allocRow(int dam_hstmt)
          Allocate a new row and return its handle.
static int dam_allocRowSet(int hstmt)
          Allocate a new rowset (result table) and return its handle.
static int dam_compareCol(int hcol1, int hcol2)
          Check if the column handles refer to the same column.
static int dam_createVal(int pMemTree, int iXoType, java.lang.Object pVal, int iValLen)
          This function is used to build the output value of a scalar function.
static void dam_describeCol(int hcol, xo_int piColNum, java.lang.StringBuffer pColName, xo_int piXOType, xo_int piColType)
          This function is used to retrieve the description of the specified column.
static xo_type dam_describeColDetail(int hcol, xo_int piPseudoColumn, xo_int piColumnType, xo_int piSortOrder, xo_int piFuncType, xo_int piIndexType, java.lang.StringBuffer pUserData)
          This function is used to retrieve the details of the specified column.
static int dam_describeCond(int hcond, xo_int piLeftOpType, xo_int piLeftXoType, xo_int piRightOpType, xo_int piRightXoType)
          This function is used to retrieve the description of the condition.
static int dam_describeIndex(int hindex, java.lang.StringBuffer sIndexQualifier, java.lang.StringBuffer sIndexName, xo_int piType, xo_int piNonUnique, xo_int piIndexLength)
          This function is used to retrieve the description of the optimal index returned by the dam_getOptimalIndexAndConditions function.
static int dam_describeIndexCol(int hindex_col, xo_int piSeqInIndex, java.lang.StringBuffer sColumnName, xo_int piCollation)
          This function is used to retrieve the description of a column associated with the optimal index returned by the dam_getOptimalIndexAndConditions function.
static int dam_describeJoinCond(int hstmt, xo_int piInnerTableColNum, xo_int piOpType, xo_int piOuterTableProcessOrder, xo_int piOuterTableColNum)
          This function is used by IP when building pushdown join result set.
static int dam_describeJoinTable(int dam_hstmt, int iTableProcessOrder, java.lang.StringBuffer pCatalog, java.lang.StringBuffer pSchema, java.lang.StringBuffer pTableName, java.lang.StringBuffer pTablePath, java.lang.StringBuffer pUserData)
          Returns the attributes of the table with given TableProcessOrder in the join query being processed.
static void dam_describeProcedure(int hstmt, java.lang.StringBuffer pCatalog, java.lang.StringBuffer pSchema, java.lang.StringBuffer pProcedureName, java.lang.StringBuffer pUserData)
          This function is called from the PROCEDURE function of the IP to find out about the stored procedure for which the IP has been called.
static void dam_describeTable(int dam_hstmt, java.lang.StringBuffer pCatalog, java.lang.StringBuffer pSchema, java.lang.StringBuffer pTableName, java.lang.StringBuffer pTablePath, java.lang.StringBuffer pUserData)
          Returns the attributes of the current table being processed.
static int dam_describeTableByProcessOrder(int hstmt, int iTableProcessOrder, xo_int piTableNum, java.lang.StringBuffer pCatalog, java.lang.StringBuffer pSchema, java.lang.StringBuffer pTableName, java.lang.StringBuffer pTablePath, java.lang.StringBuffer pUserData)
          Returns the attributes of the table with given TableProcessOrder in the join query being processed.
static int dam_evaluateColCond(int hstmt, int hcond, int iXoType, java.lang.Object pColVal, int lColValLen)
          Evaluate a search or restriction condition for the IP.
static void dam_freeRow(int hrow)
          Free a row of data.
static int dam_freeSetOfConditionList(int hset_of_condlist)
          Free the condition lists allocated by the dam_getOptimalIndexAndConditions and the dam_getSetOfConditionLists.
static int dam_getCol(int dam_hstmt, java.lang.String sColName)
          Get column handle.
static int dam_getColByNum(int hstmt, int iColNum)
          Returns the column handle for the given column number in schema.
static int dam_getColCount(int hstmt, int iColType, xo_int piColCount)
          This function is used to find out how many columns are in the various categories.
static int dam_getColInCond(int hcond)
          Gets the handle to the column on which a given condition applies.
static int dam_getColToSet(int hRowElem)
          Gets the column handle portion of a value set for update, insert or input row.
static java.lang.Object dam_getCondRightVal(int hcond)
          This function is used to retrieve the right value of a condition.
static java.lang.Object dam_getCondVal(int hcond)
          This function is used to retrieve the left value of a condition.
static int dam_getFirstCol(int hstmt, int iColType)
          This function is used to navigate through the columns that appear in the select and where clause of the SQL query or through the columns in the schema definition of the table.
static int dam_getFirstCond(int hstmt, int hlist)
          This function is used to navigate through the conditions in the condition list.
static int dam_getFirstCondList(int hset_of_condlist)
          Gets the first conditions list from the set of condition lists.
static int dam_getFirstGrantedObject(int hstmt, java.lang.StringBuffer pcCatalog, java.lang.StringBuffer pcSchema, java.lang.StringBuffer pcObjName)
          This function is used to navigate the granted object list in the GRANT and REVOKE commands.
static int dam_getFirstGrantee(int hstmt, java.lang.StringBuffer pcCatalog, java.lang.StringBuffer pcGranteeName)
          This function is used to navigate the granted user list in the GRANT and REVOKE commands.
static int dam_getFirstIndexCol(int hindex)
          Gets the first column associated with the optimal index returned by the dam_getOptimalIndexAndConditions function.
static int dam_getFirstInsertRow(int hstmt)
          Gets the first row of data to be used for inserting into your data source.
static int dam_getFirstPrivilege(int hstmt, xo_int piPrivId, java.lang.StringBuffer pcCatalog, java.lang.StringBuffer pcPrivRoleName)
          This function is used to navigate the privilege list in the GRANT and REVOKE commands.
static int dam_getFirstSchemaObject(int pList)
          This function is used to navigate through the items in the schema object list returned by the dam_getSchemaObjectList call.
static int dam_getFirstValExp(int hValExpList)
          Gets the first argument passed into a scalar function implemented by the IP.
static int dam_getFirstValueSet(int hstmt, int hrow)
          Gets the first value set of a row that has been retrieved from the DAM for the purpose of update, insert or stored procedure processing.
static int dam_getFirstView(int hdbc, java.lang.StringBuffer pTableQualifier, java.lang.StringBuffer pTableOwner, java.lang.StringBuffer pTableName)
          Gets the first view from all currently active views.
static int dam_getGroupByCol(int hstmt, int iGroupByColNum, xo_int piColNum, java.lang.StringBuffer pColName)
          Obtain column information about the columns specified as part of the GROUP BY clause.
static int dam_getInfo(int hdbc, int hstmt, int iInfoType, java.lang.StringBuffer pStrInfoValue, xo_int pIntInfoValue)
          Returns the requested connection and statement level information from the DAM.
static int dam_getInputRow(int hstmt)
          Retrieves the input arguments for a stored procedure call.
static int dam_getIP_hstmt(int hstmt)
          This function is used to retrieve the state information for a statement that is being processed.
static java.lang.Object dam_getJoinColValue(int hstmt, int hcol, int iXoType, xo_int piValLen, xo_int piValStatus)
          Gets the column value of the table already processed.
static int dam_getMemTree(int hstmt)
          Returns the tree to use for allocating memory associated with the specified statement.
static int dam_getNextCol(int hstmt)
          This function is used to navigate through the columns that appear in the select and where clause of the SQL query or through the columns in the schema definition of the table.
static int dam_getNextCond(int hstmt, int hlist)
          This function is used to navigate through the conditions in the search and restriction condition list.
static int dam_getNextCondList(int hset_of_condlist)
          This function is used to navigate through the set of condition lists that was obtained by calling the dam_getSetOfConditionLists or the dam_getOptimalIndexAndConditions function.
static int dam_getNextGrantedObject(int hstmt, java.lang.StringBuffer pcCatalog, java.lang.StringBuffer pcSchema, java.lang.StringBuffer pcObjName)
          This function is used to navigate the granted object list in the GRANT and REVOKE commands.
static int dam_getNextGrantee(int hstmt, java.lang.StringBuffer pcCatalog, java.lang.StringBuffer pcGranteeName)
          This function is used to navigate the granted user list in the GRANT and REVOKE commands.
static int dam_getNextIndexCol(int hindex)
          Gets the next column associated with the optimal index returned by the dam_getOptimalIndexAndConditions function.
static int dam_getNextInsertRow(int hstmt)
          Gets the next row of data to be used for inserting into your data source.
static int dam_getNextJoinStmt(int hstmt_outer)
          Get the DAM statement handle for the next table in the join.
static int dam_getNextPrivilege(int hstmt, xo_int piPrivId, java.lang.StringBuffer pcCatalog, java.lang.StringBuffer pcPrivRoleName)
          This function is used to navigate the privilege list in the GRANT and REVOKE commands.
static int dam_getNextSchemaObject(int pList)
          This function is used to navigate through the items in the schema object list returned by the dam_getSchemaObjectList call.
static int dam_getNextValExp(int hValExpList)
          Gets the next argument passed into a scalar function implemented by the IP.
static int dam_getNextValueSet(int hstmt)
          Gets the next value set of an update or an insert row.
static int dam_getNextView(int hdbc, java.lang.StringBuffer pTableQualifier, java.lang.StringBuffer pTableOwner, java.lang.StringBuffer pTableName)
          Gets the next view from all currently active views.
static int dam_getOptimalIndexAndConditions(int dam_hstmt, xo_int phindex, xo_int phset_of_condlist)
          This function is used to get the optimal index and the set of search conditions associated with the columns of that index.
static int dam_getOrderByCol(int hstmt, int iOrderByColNum, xo_int piColNum, java.lang.StringBuffer pColName, xo_int piSortOrder)
          Obtain information about columns specified in the ORDER BY clause.
static java.lang.Object dam_getQueryFirstResultValue(int hquery, xo_int piXoType, xo_int piValLen, xo_int piValStatus)
          Returns the first result value of the subquery.
static java.lang.Object dam_getQueryNextResultValue(int hquery, xo_int piXoType, xo_int piValLen, xo_int piValStatus)
          Returns the next result value of the subquery.
static int dam_getRestrictionList(int hstmt, int hcol)
          This function is used to get the handle to the list of restriction conditions on a column.
static void dam_getRole(int hstmt, java.lang.StringBuffer pcCatalog, java.lang.StringBuffer pcRoleName)
          Returns the user information in the CREATE ROLE and DROP ROLE commands.
static int dam_getSchemaObjectList(int hstmt, int iSchemaType)
          Returns the list of schema objects of the specified type.
static int dam_getSetOfConditionListsEx(int hstmt, int iType, int hcol, xo_int pbPartialLists)
          This function is used to retrieve expressions from the where clause on one or more columns in the form of AND or OR expressions.
static int dam_getTableSearchExp(int hstmt, int iTableProcessOrder, xo_int phSearchExp, xo_int piJoinType, xo_int phJoinExp, xo_int pbPartial)
          Returns the search conditions (filter conditions) and join conditions for the given table.
static int dam_getTableStmt(int hstmt, int iTableNum)
          Gets the DAM statement handle for the tableNum in the join.
static int dam_getUpdateRow(int hstmt, int pTargetRow)
          Gets the row of data to be used for updating the selected rows in the database.
static int dam_getUpdateRowAsExp(int hstmt)
          Gets the update row that contains the values of columns and the corresponding update expressions.
static void dam_getUser(int dam_hstmt, java.lang.StringBuffer pCatalog, java.lang.StringBuffer pcUserName, java.lang.StringBuffer pcPassword, java.lang.StringBuffer pUserData)
          Returns the user information in the CREATE USER and DROP USER commands.
static java.lang.Object dam_getValueOfExp(int pMemTree, int hValExpList, int hValExp, int iXoType, xo_int iValStatus)
          Gets the value of the argument passed into a scalar function implemented by the IP.
static java.lang.Object dam_getValueToSet(int hRowElem, int iXoType, xo_int iValStatus)
          Gets the value portion of a value object.
static int dam_isTargetRow(int dam_hstmt, int hrow)
          This function evaluates the row against the where clause of the active SQL statement.
static java.lang.Object dam_mapSchemaObj(int iType, int pSearchObj)
          Returns the search object mapped into the corresponding schema object.
static int dam_new_damobj_column(int pMemTree)
          Create an empty object of type DAMOBJ_TYPE_COLUMN to be used to return schema information about columns.
static int dam_new_damobj_fkey(int pMemTree)
          Create an empty object of type DAMOBJ_TYPE_FKEY to be used to return schema information about primary and foreign keys.
static int dam_new_damobj_proc_column(int pMemTree)
          Create an empty object of type DAMOBJ_TYPE_PROC_COLUMN to be used to return schema information about columns of stored procedures.
static int dam_new_damobj_proc(int pMemTree)
          Create an empty object of type DAMOBJ_TYPE_PROC to be used to return schema information about available stored procedures.
static int dam_new_damobj_stat(int pMemTree)
          Create an empty object of type DAMOBJ_TYPE_STAT to be used to return schema information about indexes.
static int dam_new_damobj_table(int pMemTree)
          Create an empty object of type DAMOBJ_TYPE_TABLE to be used to return schema information about tables.
static int dam_set_damobj_column(int pObj, java.lang.String table_qualifier, java.lang.String table_owner, java.lang.String table_name, java.lang.String column_name, short data_type, java.lang.String type_name, int char_max_length, int numeric_precision, short numeric_precision_radix, short numeric_scale, short nullable, short scope, java.lang.String userdata, java.lang.String operator_support, short psuedo_column, short column_type, java.lang.String remarks)
          Set the values of the schema object of type DAMOBJ_TYPE_COLUMN to be used to return schema information about columns.
static int dam_set_damobj_fkey(int pObj, java.lang.String pktable_qualifier, java.lang.String pktable_owner, java.lang.String pktable_name, java.lang.String pkcolumn_name, java.lang.String fktable_qualifier, java.lang.String fktable_owner, java.lang.String fktable_name, java.lang.String fkcolumn_name, short key_seq, short update_rule, short delete_rule, java.lang.String fk_name, java.lang.String pk_name)
          Set the values of the schema object of type DAMOBJ_TYPE_FKEY to be used to return schema information about primary and foreign keys.
static int dam_set_damobj_proc_column(int pObj, java.lang.String qualifier, java.lang.String owner, java.lang.String name, java.lang.String column_name, short column_type, short data_type, java.lang.String type_name, int precision, int length, short scale, short radix, short nullable, java.lang.String userdata, java.lang.String remarks)
          Set the values of the schema object of type DAMOBJ_TYPE_PROC_COLUMN to be used to return schema information about procedure columns.
static int dam_set_damobj_proc(int pObj, java.lang.String proc_qualifier, java.lang.String proc_owner, java.lang.String proc_name, int num_input_params, int num_output_params, int num_result_sets, short proc_type, java.lang.String userdata, java.lang.String remarks)
          Set the values of the schema object of type DAMOBJ_TYPE_PROC to be used to return schema information about procedures.
static int dam_set_damobj_stat(int pObj, java.lang.String table_qualifier, java.lang.String table_owner, java.lang.String table_name, short non_unique, java.lang.String index_qualifier, java.lang.String index_name, short type, short seq_in_index, java.lang.String column_name, java.lang.String collation, int cardinality, int pages, java.lang.String filter_conditions)
          Set the values of the schema object of type DAMOBJ_TYPE_STAT to be used to return schema information about indexes.
static int dam_set_damobj_table(int pObj, java.lang.String table_qualifier, java.lang.String table_owner, java.lang.String table_name, java.lang.String table_type, java.lang.String table_struct, java.lang.String table_path, java.lang.String table_userdata, java.lang.String function_support, java.lang.String remarks)
          Set the values of the schema object of type DAMOBJ_TYPE_TABLE to be used to return schema information about tables.
static int dam_setInfo(int hdbc, int hstmt, int iInfoType, java.lang.String pStrInfoValue, int pIntInfoValue)
          Sets the specified global, connection or statement level information for use by the DAM.
static void dam_setIP_hstmt(int hstmt, int ip_hstmt)
          This function is used to save state information for a statement that is being processed.
static int dam_setOption(int iOptionType, int ObjectHandle, int iOption, int lOptionValue)
          Set the options related to the operations of the DAM.
static int damex_describeCol(int hcol, xo_int piTableNum, xo_int piColNum, java.lang.StringBuffer pColName, xo_int piXOType, xo_int piColType, java.lang.StringBuffer pUserData, xo_int piResultColNum)
          This function is used to retrieve the description of the column when working in pass through or table expression pushdown modes.
static int damex_describeCond(int hcond, xo_int piType, xo_int phLeftValExp, xo_int phRightValExp, xo_int phExtraValExp)
          This function is used to retrieve the description of the condition.
static int damex_describeLogicExp(int hLogExp, xo_int piType, xo_int phLeftLogExp, xo_int phRightLogExp, xo_int phCond)
          Gets the description of a logical expression.
static int damex_describeScalarValExp(int hScalarValExp, java.lang.StringBuffer pName, xo_int phValExpList)
          Retrieve the description of the scalar value expression.
static java.lang.Object damex_describeVal(int hVal, xo_int piType, xo_int piXoType, xo_int phCol, xo_int phQuery, xo_int piValStatus)
          Retrieve the description of the value.
static int damex_describeValExp(int hValExp, xo_int piType, xo_int piFuncType, xo_int phLeftValExp, xo_int phRightValExp, xo_int phVal, xo_int phScalarValExp)
          Retrieve the description of the value expression.
static int damex_getFirstUpdateSet(int hquery, int hrow, xo_int phcol)
          Return the details of the first update column-value pair in the update query.
static int damex_getFirstValExp(int hValExpList)
          Return the first value expression in the list.
static int damex_getNextUpdateSet(int hquery, xo_int phcol)
          Return the details of the next update column=value pair in the update query.
static int damex_getNextValExp(int hValExpList)
          Return the next value expression in the list.
static int damex_isCorrelatedCol(int hcol)
          Returns a Boolean to indicate if the column is a correlated column.
static void initStaticVars()
          Reserved for internal use only.
static void tm_trace(int tm_handle, int masklevel, java.lang.String pszMesg)
          This function is used to trace a message in the trace file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

jdam

public jdam()
Method Detail

initStaticVars

public static void initStaticVars()
Reserved for internal use only.

dam_describeTable

public static void dam_describeTable(int dam_hstmt,
                                     java.lang.StringBuffer pCatalog,
                                     java.lang.StringBuffer pSchema,
                                     java.lang.StringBuffer pTableName,
                                     java.lang.StringBuffer pTablePath,
                                     java.lang.StringBuffer pUserData)
Returns the attributes of the current table being processed. This function is called from the EXECUTE function of the IP to find out about the table for which the IP has been called. You must pass buffers with enough memory for each of the values you need.

Parameters:
dam_hstmt - Handle of the Statement.
pCatalog - The table qualifier as entered in the OA_TABLES table.
pSchema - The table owner as entered in the OA_TABLES table.
pTableName - The name of the table. hhhh
pTablePath - Path of the table specified in the path column of the OA_TABLES table. This is IP specific field.
pUserData - The Table_Userdata as entered in the OA_TABLES table. This can be any string that the IP wants to know about the table.

dam_getCol

public static int dam_getCol(int dam_hstmt,
                             java.lang.String sColName)
Get column handle.

Parameters:
dam_hstmt - Handle of the Statement.
sColName - Column name
Returns:
Column handle

dam_allocRow

public static int dam_allocRow(int dam_hstmt)
Allocate a new row and return its handle. The DAM allocates the memory required by the row. A row should be freed if the dam_isTargetRow call fails. A new row must be allocated for each data set you want to put through the dam_isTargetRow evaluator.

Parameters:
dam_hstmt - Handle of the Statement.
Returns:
Handle to a new row. A 0 is returned if a row could not be allocated.

dam_addCharValToRow

public static int dam_addCharValToRow(int dam_hstmt,
                                      int hRow,
                                      int hCol,
                                      java.lang.String pColVal,
                                      int lColValLen)
Add the String value for the Column.

Parameters:
dam_hstmt - Statement Handle
hRow - Row Handle
hCol - Column Handle
pColVal - String value for the column
lColValLen -
  • XO_NULL_DATA - indicates a null value
  • XO_NTS - for non-null strings
Returns:
  • DAM_SUCCESS - Added the column value to row
  • DAM_FAILURE - Failed to add the value

dam_addIntValToRow

public static int dam_addIntValToRow(int dam_hstmt,
                                     int hRow,
                                     int hCol,
                                     int pColVal,
                                     int lColValLen)
Add the Integer value for the Column.

Parameters:
dam_hstmt - Statement Handle
hRow - Row Handle
hCol - Column Handle
pColVal - Integer value for the column
lColValLen -
  • XO_NULL_DATA - indicates a null value
  • 0 Otherwise.
Returns:
  • DAM_SUCCESS - Added the column value to row
  • DAM_FAILURE - Failed to add the value

dam_addDoubleValToRow

public static int dam_addDoubleValToRow(int dam_hstmt,
                                        int hRow,
                                        int hCol,
                                        double pColVal,
                                        int lColValLen)
Add the Double value for the Column.

Parameters:
dam_hstmt - Statement Handle
hRow - Row Handle
hCol - Column Handle
pColVal - Double value for the column
lColValLen -
  • XO_NULL_DATA - indicates a null value
  • 0 Otherwise.
Returns:
  • DAM_SUCCESS - Added the column value to row
  • DAM_FAILURE - Failed to add the value

dam_addTimeStampValToRow

public static int dam_addTimeStampValToRow(int dam_hstmt,
                                           int hRow,
                                           int hCol,
                                           xo_tm pColVal,
                                           int lColValLen)
Add the Time Stamp value for the Column.

Parameters:
dam_hstmt - Statement Handle
hRow - Row Handle
hCol - Column Handle
pColVal - Time Stamp value for the column
lColValLen -
  • XO_NULL_DATA - indicates a null value
  • 0 Otherwise.
Returns:
  • DAM_SUCCESS - Added the column value to row
  • DAM_FAILURE - Failed to add the value

dam_addShortValToRow

public static int dam_addShortValToRow(int dam_hstmt,
                                       int hRow,
                                       int hCol,
                                       short pcolVal,
                                       int lColValLen)
Add the Short value for the Column.

Parameters:
dam_hstmt - Statement Handle
hRow - Row Handle
hCol - Column Handle
pColVal - Short value for the column
lColValLen -
  • XO_NULL_DATA - indicates a null value
  • 0 Otherwise.
Returns:
  • DAM_SUCCESS - Added the column value to row
  • DAM_FAILURE - Failed to add the value

dam_addFloatValToRow

public static int dam_addFloatValToRow(int dam_hstmt,
                                       int hRow,
                                       int hCol,
                                       float colVal,
                                       int lColValLen)
Add the Float value for the Column.

Parameters:
dam_hstmt - Statement Handle
hRow - Row Handle
hCol - Column Handle
pColVal - Float value for the column
lColValLen -
  • XO_NULL_DATA - indicates a null value
  • 0 Otherwise.
Returns:
  • DAM_SUCCESS - Added the column value to row
  • DAM_FAILURE - Failed to add the value

dam_isTargetRow

public static int dam_isTargetRow(int dam_hstmt,
                                  int hrow)

This function evaluates the row against the where clause of the active SQL statement. It returns DAM_TRUE if the row matches the where clause and DAM_FALSE if it does not. If DAM_TRUE, then the dam_addRowToTable should be called. If DAM_FALSE is returned, then the row should be freed by calling the dam_freeRow. DAM_ERROR will be returned if the row handle is invalid or if all the required column values have not been set. In cases where the table had index(s) defined and the query contains restrictions on index columns, this function assumes that all rows provided by the IP satisfy the index conditions and will not do further validation.

Parameters:
dam_hstmt - Handle of the Statement
hrow - Handle of the Row
Returns:
  • DAM_TRUE - The row matches the restrictions
  • DAM_FALSE - The row does not match the restrictions
  • DAM_ERROR - The row handle is invalid or if all the required column values have not been set.

dam_addRowToTable

public static int dam_addRowToTable(int dam_hstmt,
                                    int hrow)
Add the row to the result set. This function should be called if dam_isTargetRow returns DAM_TRUE. All rows added to the result set will be sent back to the client.

Parameters:
dam_hstmt - Statement Handle
hrow - Handle of the Row
Returns:
  • DAM_SUCCESS - Added the rown
  • DAM_FAILURE - Failed to add the row

dam_freeRow

public static void dam_freeRow(int hrow)
Free a row of data. All memory associated to the row is freed by the DAM. This function should be called after a call to the dam_isTargetRow fails.

Parameters:
hrow - Handle of the Row

tm_trace

public static void tm_trace(int tm_handle,
                            int masklevel,
                            java.lang.String pszMesg)
This function is used to trace a message in the trace file. The value specified for maskLevel will determine if the message will be displayed or not at run-time.


dam_getOptimalIndexAndConditions

public static int dam_getOptimalIndexAndConditions(int dam_hstmt,
                                                   xo_int phindex,
                                                   xo_int phset_of_condlist)
This function is used to get the optimal index and the set of search conditions associated with the columns of that index. This information is used by the IP to restrict the rows that are read. Each condition list will contain conditions on all or some of the columns in the index.

The relationship between the individual condition elements in the list is that of AND (in the past versions the dam_getSearchList retrieved a single condition list where the relationship between each of the condition elements was that of OR). This means that each row the DAM builds for a condition list must satisfy all the conditions in that list and must then be validated using the dam_isTargetRow function. The order of the conditions will correspond to the order of the columns in the index.

The relationship between each of the condition lists is that of OR. This means the IP builds a set of rows for each of the condition lists. Note that you must have the following setup in order for the DAM to generate an optimal index:

Parameters:
dam_hstmt - Handle of the Statement
phindex - The handle of the index identified as the optimal for the statement. This value is 0 if no optimal index was identified. Use the function dam_describeIndex to get details about the index, and functions dam_getFirstIndexCol, dam_damGetNextIndexCol, and dam_describeIndexCol to get details about the columns making up the index.
Your code must create this object before calling this function.

phset_of_condlist - If an optimal index is found, then this is a handle to the set of conditions that are present in the query. Otherwise this is 0. Navigate it by using the dam_getFirstCondList and dam_getNextCondList functions. The IP must call the dam_freeSetOfConditionList to this handle when finished with the query.
Your code must create this object before calling this function.
Returns:
Status of the call:
  • DAM_SUCCESS - on success
  • DAM_FAILURE - error

dam_describeIndex

public static int dam_describeIndex(int hindex,
                                    java.lang.StringBuffer sIndexQualifier,
                                    java.lang.StringBuffer sIndexName,
                                    xo_int piType,
                                    xo_int piNonUnique,
                                    xo_int piIndexLength)
This function is used to retrieve the description of the optimal index returned by the dam_getOptimalIndexAndConditions function. The information for the index is retrieved from the OA_STATISTICS table. Pass in NULL for any descriptor you are not interested in. The output parameters to this function are objects that must be created before this method is called.

Parameters:
hindex - Index handle
sIndexQualifier - Qualifier of the index. Must create an object of type StringBuffer of size DAMOBJ_MAX_ID_LEN .

sIndexName - Name of the index. Must create an object of type StringBuffer of size DAMOBJ_MAX_ID_LEN .
piType - Type of information being returned.
  • SQL_TABLE_STAT (0) - indicates a statistic for the table
  • SQL_INDEX_CLUSTERED(1) - indicates a clustered
  • SQL_INDEX_HASHED(2)- indicates a hashed index
  • SQL_INDEX_OTHER(3) - indicates another type of index
Must create an objec of type xo_int.

piNonUnique - Indicates whether the index prohibits duplicate values
  • TRUE (1) if the index values can be non-unique.
  • FALSE (0) if the index values must be unique.
piIndexLength - The number of columns in this index. This number is as indicated in the OA_STATISTICS and does not reflect how many of the columns belonging to the index are part of the query.
Returns:
  • DAM_SUCCESS - valid information returned
  • DAM_FAILURE - failure

dam_freeSetOfConditionList

public static int dam_freeSetOfConditionList(int hset_of_condlist)
Free the condition lists allocated by the dam_getOptimalIndexAndConditions and the dam_getSetOfConditionLists. The memory used by this list must be freed once the IP is finished with the execution of the query.

Parameters:
hSetOfCondList - Handle to the set of condition list returned by the dam_getOptimalIndexAndConditions or the dam_getSetOfConditionLists functions.
Returns:
  • DAM_SUCCESS - memory freed
  • DAM_FAILURE - error

dam_getFirstCondList

public static int dam_getFirstCondList(int hset_of_condlist)
Gets the first conditions list from the set of condition lists. This function is used to navigate through the set of condition lists that was obtained by calling the dam_getSetOfConditionLists or the dam_getOptimalIndexAndConditions function. This list will contain either a intersection or an union style set of expressions. Use the function dam_getNextCondList to go through the list.

Parameters:
hset_of_condlist - Handle to the set of condition lists
Returns:
The first condition list. A 0 is returned if the list is empty.

dam_getFirstCond

public static int dam_getFirstCond(int hstmt,
                                   int hlist)
This function is used to navigate through the conditions in the condition list. It gets the first condition in the search or restriction list. Use the function dam_getNextCond to go through the list.

Parameters:
hstmt - Statement handle
hlist - Either the search or the restriction condition list.
Returns:
The first condition. A 0 is returned if the list is empty.

dam_describeCond

public static int dam_describeCond(int hcond,
                                   xo_int piLeftOpType,
                                   xo_int piLeftXoType,
                                   xo_int piRightOpType,
                                   xo_int piRightXoType)
This function is used to retrieve the description of the condition. Use this function to find out what the condition is ( =, >, <, etc.) and what the value of the operand is ('TAG', 100, etc.). The condition is returned as a left and right pair. The right part only applies in the case of BETWEEN or LIKE type of conditions. Otherwise it is to be ignored. Each condition is described by the operator type and the data type of the operand value. You must use the function dam_getCondVal and/or dam_getCondRightVal to get the data for the condition.

Parameters:
hcond - Condition handle
piLeftOpType - Left operator type. See table below for the operators and the associated value. All conditions always have a left value. You must create and pass an object of type xo_int in for this argument.

piLeftXoType - Data type. You must create and pass an object of type xo_int in for this argument.
piRightOpType - Right operator type. See table below for the operators and the associated value. This value only present in BETWEEN and LIKE type of statements. A value of 0 is returned if there is no right value. You must create and pass an object of type xo_int in for this argument.

piRightXoType - Data type. You must create and pass an object of type xo_int in for this argument.
Returns:
  • DAM_SUCCESS - valid condition returned
  • DAM_FAILURE - error getting a condition because the arguments to the call are invalid or the format of the data in the condition cannot be converted to the column type.

dam_getCondVal

public static java.lang.Object dam_getCondVal(int hcond)
This function is used to retrieve the left value of a condition. All conditions always have a left value. If call to dam_describeCond returned a value value for the pi. All conditions except BETWEEN return only one value. If the query contains a BETWEEN or a LIKE operator then the condition may contain a right value which you can obtain by calling dam_getCondRightVal.

Parameters:
hcond - Condition handle
Returns:
Object that represents the data portion of the condition. The format of the data depends on the type of the condition. This value is NULL for col=NULL condition.

dam_getCondRightVal

public static java.lang.Object dam_getCondRightVal(int hcond)
This function is used to retrieve the right value of a condition. If the condition is for a BETWEEN or a LIKE operator then the condition may contain a right value. A right value is available if dam_describeCond returned non-zero value for the piRightOpType.

Parameters:
hcond - Condition handle
Returns:
Object that represents the data portion of the condition. The format of the data depends on the type of the condition. This value is NULL for col=NULL condition.

dam_getNextCondList

public static int dam_getNextCondList(int hset_of_condlist)
This function is used to navigate through the set of condition lists that was obtained by calling the dam_getSetOfConditionLists or the dam_getOptimalIndexAndConditions function. It gets the next condition list from the set of conditions.

Parameters:
hset_of_condlist - Handle to the set of condition lists
Returns:
Next condition list handle. A 0 is returned at the end of the list.

dam_getNextCond

public static int dam_getNextCond(int hstmt,
                                  int hlist)
This function is used to navigate through the conditions in the search and restriction condition list. Call it after calling the dam_getFirstCond function.

Parameters:
hstmt - Statement handle
hlist - Condition list that was returned by dam_getSearchList or dam_getRestrictionList
Returns:
Handle to the next condition in the list. A NULL is returned at the end of the list.

dam_getFirstCol

public static int dam_getFirstCol(int hstmt,
                                  int iColType)
This function is used to navigate through the columns that appear in the select and where clause of the SQL query or through the columns in the schema definition of the table. Call this function with what column types are to be navigated and then use the dam_getNextCol to step through the list. This function is used to:

Parameters:
hstmt - Statement handle
sColName - Identifies the column list to navigate, Use a bitwise OR ( | ) of the following flags to scan through columns that are in multiple categories.:
  • DAM_COL_IN_SCHEMA - list of all columns as defined in the schema database
  • DAM_COL_IN_RESULT - list of columns that are part of the result set
  • DAM_COL_IN_CONDITION - list of columns that are in the where clause
  • DAM_COL_IN_USE - list of columns that are either part of the result or are in the where clause
Returns:
Handle to the first column that has the attributes of iColType. A 0 otherwise.

dam_getNextCol

public static int dam_getNextCol(int hstmt)
This function is used to navigate through the columns that appear in the select and where clause of the SQL query or through the columns in the schema definition of the table. Call this function after calling dam_getFirstCol.

Parameters:
hstmt - Statement handle
Returns:
Handle to the next column in the list. A NULL is returned at the end of the list.

dam_describeCol

public static void dam_describeCol(int hcol,
                                   xo_int piColNum,
                                   java.lang.StringBuffer pColName,
                                   xo_int piXOType,
                                   xo_int piColType)
This function is used to retrieve the description of the specified column. You must setup string buffers of at least (DAM_MAX_ID_LEN+1) for the identifier names returned by this function. Pass in NULL for any attributes you do not want. The attributes of how the column is used in the query are returned as a bitwise OR (|) of the column attributes. You must perform a bitwise AND (&) of the output with the column type (i.e. DAM_COL_IN_COND) to check for all the ways the column is used.

Parameters:
hcol - Column Handle
piColNum - Column number as defined in the schema database. Create and pass in a xo_int object.
pColName - Column name. Create and pass in a StringBuffer of DAM_MAX_ID_LEN+1.
piXOType - Data type ( refer to the X/Open Data types table). Create and pass in a xo_int object.
piColType - How the column appears in the query is specified by the setting of one or more of the following flags:
  • DAM_COL_IN_SCHEMA - column is defined in the schema database. This flag applies to all columns.
  • DAM_COL_IN_RESULT - column is part of the select list
  • DAM_COL_IN_CONDITION - column is part of the where clauseCreate and pass in a xo_int object.

dam_describeColDetail

public static xo_type dam_describeColDetail(int hcol,
                                            xo_int piPseudoColumn,
                                            xo_int piColumnType,
                                            xo_int piSortOrder,
                                            xo_int piFuncType,
                                            xo_int piIndexType,
                                            java.lang.StringBuffer pUserData)
This function is used to retrieve the details of the specified column. Pass in NULL for any attributes you do not want. The IP uses this function to:

Parameters:
hcol - Column Handle
piPseudoColumn - Indicates if the column is marked as a PSEUDO column in which case the user is not allowed to insert or update its value. The output will be one of the following:
  • SQL_PC_UNKNOWN - not set
  • SQL_PC_NOT_PSEUDO - the column is not a PSEUDO column and should be treated like a normal user column.
  • SQL_PC_PSEUDO - the column is a PSEUDO column that is been used for
piColumnType - If the column has been marked as a SQL_PC_PSEUDO to indicate it is a pseudo column, then this field indicates whether it is a ROWID or ROWVER.
  • DAM_NOT_SET - if column is not a pseudo column
  • SQL_BEST_ROWID - the column is used to uniquely identify the row
  • SQL_ROWVER - the column is used to track the version of the row is typically modified by the database during update operations.
piSortOrder - No longer used in version 3.3 and higher
piFuncType - Reserved for future use.
piIndexType - No longer used in version 3.3 and higher
pUserData - User data as specified in the schema. Create and pass in a StringBuffer of DAM_MAX_ID_LEN+1.
Returns:
Object of type xo_type detailing the precision, scale, length, radix, null attributes of the column as defined in the schema.

dam_addError

public static void dam_addError(int hdbc,
                                int hstmt,
                                int iErrorIndex,
                                int iNativeError,
                                java.lang.String sErrorText)
Add an error to the error list maintained by the DAM. An error is added at the environment, connection or statement level. This error string will be returned to the client. This is the only way to pass specific error information to the client. An IP function returns error by adding an error using this function and then returning DAM_FAILURE.

Each error code has an error message string associated with it. This is the string sent to the client by default. You can override this string with your own. Refer to the OpenAccess Programmer's Referecne for a list of defined error codes.

Parameters:
hdbc - Connection handle. Set to NULL if the error is related to a statement and not to the connection.
hstmt - Statement handle. Set to NULL if the error is related to a connection.
iErrorIndex - Index into the error message list.
iNativeError - Native error as defined by the IP.
sErrorText - Text to use in place of the standard text. Data from this buffer is copied into the error queue. Set to NULL to use the default error string.

dam_compareCol

public static int dam_compareCol(int hcol1,
                                 int hcol2)
Check if the column handles refer to the same column. The column handles returned by different function may not be equal even if they refer to the same column.

Parameters:
hcol1 - Handle to a column.
hcol2 - Handle to a column.
Returns:
  • TRUE - the column handles refer to the same column.
  • FALSE - the column handles do not refer to the same column.

dam_getColByNum

public static int dam_getColByNum(int hstmt,
                                  int iColNum)
Returns the column handle for the given column number in schema. The column number is based on the order they are defined in the OA_COLUMNS table of the schema database. Column numbers start from 0.

Parameters:
hstmt - Statement handle
iColumn - Column number in the schema. Numbers start from 0.
Returns:
Handle to specified column. A zero is returned if the column does not exist.

dam_getColCount

public static int dam_getColCount(int hstmt,
                                  int iColType,
                                  xo_int piColCount)
This function is used to find out how many columns are in the various categories. This function can be called to find out how many columns are in any one category or are in multiple categories.

Parameters:
hstmt - Statement handle
iColType - Identifies the column type. Use a bitwise OR ( | ) of the following flags to scan through columns that are in multiple categories.:
  • DAM_COL_IN_SCHEMA - list of all columns as defined in the schema database
  • DAM_COL_IN_RESULT - list of columns that are part of the result set
  • DAM_COL_IN_CONDITION - list of columns that are in the where clause
  • DAM_COL_IN_USE - list of columns that are either part of the result or are in the where clause
piColCount - Number of columns of the specified iColType. Create and pass in an object of type xo_int.
Returns:
Status of the function execution:
  • DAM_SUCCESS - valid column count returned
  • DAM_FAILURE - Error due to invalid iColType

dam_getColInCond

public static int dam_getColInCond(int hcond)
Gets the handle to the column on which a given condition applies. Use this function if you are using the dam_getSetOfConditionLists function to get restrictions on multiple columns and then stepping through these conditions. For each condition obtained using the dam_getFirstCond or dam_getNextCond, call this function to determine the column involved in the condition.

Parameters:
hcond - Condition obtained from a DAM_HCONDLIST using dam_getFirstCond or dam_getNextCond functions.
Returns:
Handle to the column associated with the condition

dam_getFirstIndexCol

public static int dam_getFirstIndexCol(int hindex)
Gets the first column associated with the optimal index returned by the dam_getOptimalIndexAndConditions function. Use the function dam_getNextIndexCol to navigate to the next one and the function dam_describeIndexCol to find out about each of the index columns.

Parameters:
hindex - Index handle as returned by the dam_getOptimalIndexAndConidtions function.
Returns:
The first column making up the index.

dam_getGroupByCol

public static int dam_getGroupByCol(int hstmt,
                                    int iGroupByColNum,
                                    xo_int piColNum,
                                    java.lang.StringBuffer pColName)
Obtain column information about the columns specified as part of the GROUP BY clause.

Parameters:
hstmt - Statement handle
iGroupByColNum - Group By column number to return information about. Valid numbers are 0 - (Value returned from dam_getInfo(DAM_INFO_GROUP_BY_OPTIMIZABLE) -1)

piColNum - Column number as defined in the schema database
pColName - Column name as defined in the schema database
Returns:
Status of the call:
  • DAM_SUCCESS - on success
  • DAM_FAILURE - wrong value for iGroupByColNum

dam_getIP_hstmt

public static int dam_getIP_hstmt(int hstmt)
This function is used to retrieve the state information for a statement that is being processed. It is primarily of use when performing cursor based execution of the statement in which the IP returns partial results in each call. It must save the state as to know where to begin next time. The IP uses dam_setIP_hstmt function to save its state in the form of a Object.

Parameters:
hstmt - Statement handle
Returns:
The index into a vector the IP is using to store the object that is created by the IP for storing information at statement level.

dam_getNextIndexCol

public static int dam_getNextIndexCol(int hindex)
Gets the next column associated with the optimal index returned by the dam_getOptimalIndexAndConditions function. Use the function dam_getFirstIndexCol to navigate to the first one and the function dam_describeIndexCol to find out about each of the index columns.

Parameters:
hindex - Index handle as returned by the dam_getOptimalIndexAndConditions function.
Returns:
The next column making up the index. Call dam_describeIndexCol to find out details about this column. A null is returned if at end of the list.

dam_getOrderByCol

public static int dam_getOrderByCol(int hstmt,
                                    int iOrderByColNum,
                                    xo_int piColNum,
                                    java.lang.StringBuffer pColName,
                                    xo_int piSortOrder)
Obtain information about columns specified in the ORDER BY clause.

Parameters:
hstmt - Statement handle.
iOrderByColNum - Order By column number to return information about. Valid numbers are 0 - (Value returned from dam_getInfo(DAM_INFO_ORDER_BY_OPTIMIZABLE) -1)

piColNum - Column number as defined in the schema database
pColName - Column name as defined in the schema database
piSortOrder - Sort order for the column
  • SQL_ORDER_ASC - Ascending
  • SQL_ORDER_DESC - Descending
Returns:
Status of the call:
  • DAM_SUCCESS - on success
  • DAM_FAILURE - wrong value for iOrderByColNum

dam_getRestrictionList

public static int dam_getRestrictionList(int hstmt,
                                         int hcol)
This function is used to get the handle to the list of restriction conditions on a column. This function is used in conjunction with the dam_getOptimalIndexAndConditions to process as few rows as possible. When using restriction lists, a row is built for evaluation if and only if it matches a search condition (returned by dam_getOptimalIndexAndConditions), and it matches at least one restriction condition in each of the restriction lists. The IP navigates through search condition list returned by the dam_getOptimalIndexAndConditions (if any), and for each search condition, builds rows that satisfy at least one condition in each of the restriction lists. Use this function with the dam_getFirstCond, dam_getNextCond, and dam_describeCond functions. Use the dam_getRestrictionList on other columns to further restrict the number of rows processed. Use the function dam_setOption to mark a restriction expression as evaluated by the IP to prevent the DAM from attempting to evaluate it.

Parameters:
hstmt - Statement handle
ip_hstmt - Handle of the column for which the restriction is requested.
Returns:
Restriction condition list. Navigate it by using the dam_getFirstCond and dam_getNextCond functions. A zero is returned if no restrictions apply on the specified column.

dam_setIP_hstmt

public static void dam_setIP_hstmt(int hstmt,
                                   int ip_hstmt)
This function is used to save state information for a statement that is being processed. It is primarily of use when performing cursor based execution of the statement in which the IP returns partial results in each call. It must save the state as to know where to begin next time. The saved state is in the form of an Object that can latter be retrieved by calling dam_getIP_hstmt. Your IP should create a vector to store these objects in and then save the index into this vector using this function call.

Parameters:
hstmt - Statement handle
ip_hstmt - A index into a vector into which the object allocated by the IP for storing information at statement level is saved.

dam_describeProcedure

public static void dam_describeProcedure(int hstmt,
                                         java.lang.StringBuffer pCatalog,
                                         java.lang.StringBuffer pSchema,
                                         java.lang.StringBuffer pProcedureName,
                                         java.lang.StringBuffer pUserData)
This function is called from the PROCEDURE function of the IP to find out about the stored procedure for which the IP has been called. You must pass buffers with enough memory for each of the values you need. Pass in NULL for any descriptor you are not interested in.

Parameters:
hstmt - Statement handle of the currently active statement
pCatalog - The qualifier as entered in the OA_PROC table.
pSchema - The owner as entered in the OA_PROC table.
pProcedureName - The name of the procedure
pUserData - The OA_USERDATA as entered in the OA_PROC table. This can be any string that the IP wants to know about the procedure.

dam_describeIndexCol

public static int dam_describeIndexCol(int hindex_col,
                                       xo_int piSeqInIndex,
                                       java.lang.StringBuffer sColumnName,
                                       xo_int piCollation)
This function is used to retrieve the description of a column associated with the optimal index returned by the dam_getOptimalIndexAndConditions function. The information for the index column is retrieved from the OA_STATISTICS table. Pass in NULL for any descriptor you are not interested in.

Parameters:
hindex_col - Index column handle as returned by dam_getFirstIndexCol and dam_getNextIndexCol functions.
piSeqInIndex - The sequence of this column in the index starting at 1.
sColumnName - Name of the column
piCollation - Collation sequence.
  • SQL_ORDER_ASC - for ascending
  • SQL_ORDER_DESC - for descending
Returns:
  • DAM_SUCCESS - valid information returned
  • DAM_FAILURE - failure

dam_getInfo

public static int dam_getInfo(int hdbc,
                              int hstmt,
                              int iInfoType,
                              java.lang.StringBuffer pStrInfoValue,
                              xo_int pIntInfoValue)
Returns the requested connection and statement level information from the DAM.

Parameters:
hdbc - DAM connection handle to be used for connection level options. Set to NULL for statement level options.
hstmt - Statement handle to be used for statement level options. Set to NULL for connection level options.
iInfoType - Type of information requested. See Error! Reference source not found. below for list of options.
pStrInfoValue - String information type is returned in this object.
pIntInfoValue - Uint16 and Unit32 information types are returned in this object.
Returns:
Status of the call:
  • DAM_SUCCESS - retrieved the iInfoType value
  • DAM_FAILURE - wrong value for iInfoType or the output buffer is not large enough

dam_setInfo

public static int dam_setInfo(int hdbc,
                              int hstmt,
                              int iInfoType,
                              java.lang.String pStrInfoValue,
                              int pIntInfoValue)
Sets the specified global, connection or statement level information for use by the DAM.

Parameters:
hdbc - DAM connection handle to be used for connection level options. Set to NULL for statement level options.
hstmt - Statement handle to be used for statement level options. Set to NULL for connection level options.
iInfoType - The information to set. See the table below for list of options.
pStrInfoValue - String type options are passed in through this argument.
pIntInfoValue - Interger type options are passed in through this argument.
Returns:
Status of the call:
  • DAM_SUCCESS - set the iInfoType value
  • DAM_FAILURE - wrong value for iInfoType or the input buffer is not large enough

dam_setOption

public static int dam_setOption(int iOptionType,
                                int ObjectHandle,
                                int iOption,
                                int lOptionValue)
Set the options related to the operations of the DAM. Options can be set at the connection, the statement or the conditions list level.

Parameters:
iOptionType - Type of option:
  • DAM_CONN_OPTION
  • DAM_STMT_OPTION
  • DAM_CONDLIST_OPTION
ObjectHandle - Object handle to which the option applies. It can be the connection handle DAM_HDBC, statement handle DAM_HSTMT or the condition list handle DAM_HCONDLIST.

iOption - The option to set. See details below for the option.
lOptionValue - The value to set for the option iOption. See details below for the option.
Returns:
Status of the function call
  • DAM_SUCCESS - option set
  • DAM_FAILURE - error in setting the specified option for the specified object type

dam_evaluateColCond

public static int dam_evaluateColCond(int hstmt,
                                      int hcond,
                                      int iXoType,
                                      java.lang.Object pColVal,
                                      int lColValLen)
Evaluate a search or restriction condition for the IP. Use it in cases when you have specified support for a condition type but cannot support for certain columns.

Parameters:
hstmt - Statement handle
hcond - Condition handle
iXoType - Type of the data. Must be as defined in the schema database or XO_TYPE_CHAR.
pColVal - The Java object containing the value of type iXoType.
lColValLen - Length of the data.
  • XO_NULL_DATA - indicates a null value
  • For VARCHAR, CHAR either the length of the string or XO_NTS if the string is null terminated
  • For binary, the length of the data
Returns:
  • 1 - condition evaluates to true
  • 0 - condition evaluates to false

dam_addJoinRowSet

public static int dam_addJoinRowSet(int hrowset,
                                    int hrow)
Associate the join rowset of the inner table with the outer table row. After all the child rows have been added to the rowset, it should be added to the current row of the outer table.

Parameters:
hrowset - Handle of the outer table row
hrow - Handle to the inner table rowset to be associated with the outer table row.
Returns:
  • DAM_SUCCESS - associated the rowset to the row
  • DAM_FAILURE - error

dam_addOutputRow

public static int dam_addOutputRow(int hstmt,
                                   int hrow)
Provide the row to the DAM for returning return values and output parameters from stored procedures.

Parameters:
hstmt - Statement handle
hrow - Row handle obtained from dam_allocOutputRow
Returns:
  • DAM_SUCCESS - Added the row
  • DAM_FAILURE - Failed to add the row

dam_addRowToRowSet

public static int dam_addRowToRowSet(int hrowset,
                                     int hrow)
Add the row to the join rowset. Each row that is built for the a specific row of the outer table should be added using this function.

Parameters:
hrowset - Handle to the rowset
hrow - Handle to the row
Returns:
  • DAM_SUCCESS - added the row to the rowset
  • DAM_FAILURE - error adding the row

dam_allocOutputRow

public static int dam_allocOutputRow(int hstmt)
Allocate a output and return its handle. The DAM allocates the memory required by the row. Use this row to provide return values and output values from stored procedure calls.

Parameters:
hstmt - Statement handle
Returns:
Handle to a new row. A NULL is returned if a row could not be allocated.

dam_allocRowSet

public static int dam_allocRowSet(int hstmt)
Allocate a new rowset (result table) and return its handle. The DAM allocates the memory required by the rowset. A new rowset must be allocated for each rowset you want to associate with a outer table row.

For example, if tables DEPT and EMP are being joined, then for each row of DEPT you must allocate a new rowset and add the EMP rows to it.

Parameters:
hstmt - Statement handle
Returns:
Handle to a new rowset. A NULL is returned if a rowset could not be allocated.

dam_createVal

public static int dam_createVal(int pMemTree,
                                int iXoType,
                                java.lang.Object pVal,
                                int iValLen)
This function is used to build the output value of a scalar function. Character data can be added by supplying the length or marking the data as null terminated. NULL data is added by specifying the XO_NULL_DATA value flag