You can perform the following manipulations when modifying a query.
Adding or deleting a table
set(String dataSourceName, String qryName, String tablename, String columnname, boolean isFormula)
Adds a new table to a query and returns a Boolean value: true if successful, otherwise false.
deleteQueryTable(String dataSourceName, String qryName, String tablename)
Deletes the selected table in a query and returns a Boolean value: true if successful, otherwise false.
Note: The tables that are to be added should exist in the specified catalog.
Parameters
qryName - The query name.
tablename - The name of the table that is to be inserted or deleted.
selectAllFields - Specifies whether or not to insert a table with all its fields.
Adding or deleting a field
set(String dataSourceName, String qryName, String tablename, String columnname, boolean isFormula)
Adds a new field to a query and returns a Boolean value: true if successful, otherwise false.
deleteQueryField(String dataSourceName, String qryName, String tablename, String columnname)
Deletes the selected fields in a query and returns a Boolean value: true if successful, otherwise false.
Parameters
qryName - The query name.
tablename - The table name of the inserted or deleted field.
isFormula - Indicates whether the inserted field is a formula.
columnname - The column name of the deleted field.
Adding or deleting a join
set(String dataSourceName, String qryName, String tableFrom, String columnFrom, String operator, String tableTo, String columnTo, boolean isSQL92, int outerJoin)
Adds a new join to a query and returns a Boolean value: true if successful, otherwise false.
deleteQueryJoin(String dataSourceName, String qryName, String tableFrom, String columnFrom, String operator, String tableTo, String columnTo)
Deletes joins in a query and returns a Boolean value: true if successful, otherwise false.
Parameters
qryName - The query name.
tableFrom - The name of the table from which the join links.
columFrom - The name of the column from which the join links.
tableTo - The name of the table to which the join links.
columnTo - The name of the column to which the join links.
operator - Operator of the join to be inserted or deleted.
Adding or deleting a QBE condition
setQBE(String dataSourceName, String qryName, String tablename, String columnname, String expression)
Adds a new QBE condition to a query and returns a Boolean value: true if successful, otherwise false.
deleteQBE(String dataSourceName, String qryName, String tablename, String columnname, String expression)
Deletes the QBE condition in a query and returns a Boolean value: true if successful, otherwise false.
Parameters
qryName - The query name.
tablename - The name of the table where the QBE condition will be added or deleted.
columnname - The name of the column where the QBE condition will be added or deleted.
expression - The expression of the QBE condition.
Adding or Deleting a where condition
setCondition(String dataSourceName, String qryName, String sExpression1, String sOperator, String sExpression2, String sLogic)
Adds a new where condition to a query and returns a Boolean value: true if successful, otherwise false.
deleteCondition(String dataSourceName, String qryName, String sExpression1, String sOperator, String sExpression2, String sLogic)
Deletes the where conditions in a query and returns a Boolean value: true if successful, otherwise false.
Parameters
qryName - The query handle.
sLogic - The logic string of the where condition that is to be inserted or deleted.
sExpression1 - The first expression of the where condition that is to be inserted or deleted.
sOperator - The operator of the where condition that is to be inserted or deleted.
sExpression2 - The second expression of the where condition that is to be inserted or deleted.