protected boolean writeWhere(Writer writer, SQLCall selectCall, SQLCall call) throws IOException { String selectStr = selectCallForExist.getSQLString(); int index = selectStr.toUpperCase().indexOf(" WHERE "); if(index < 0) { // no where clause - nothing to do return false; } // print the where clause String str = selectStr.substring(index); writer.write(str); // add parameters call.getParameters().addAll(selectCall.getParameters()); call.getParameterTypes().addAll(selectCall.getParameterTypes()); return true; } }
protected boolean writeWhere(Writer writer, SQLCall selectCall, SQLCall call) throws IOException { String selectStr = selectCallForExist.getSQLString(); int index = selectStr.toUpperCase().indexOf(" WHERE "); if(index < 0) { // no where clause - nothing to do return false; } // print the where clause String str = selectStr.substring(index); writer.write(str); // add parameters call.getParameters().addAll(selectCall.getParameters()); call.getParameterTypes().addAll(selectCall.getParameterTypes()); return true; } }
/** * PUBLIC: * This method should only be used with custom SQL: * it sets a type to IN, OUT or INOUT parameter (prefixed with #, ### or #### in custom SQL string). */ public void setCustomSQLArgumentType(String customParameterName, Class type) { DatabaseField field = new DatabaseField(customParameterName); field.setType(type); getParameters().add(field); getParameterTypes().add(null); }
/** * PUBLIC: * This method should only be used with custom SQL: * it sets a type to IN, OUT or INOUT parameter (prefixed with #, ### or #### in custom SQL string). */ public void setCustomSQLArgumentType(String customParameterName, Class type) { DatabaseField field = new DatabaseField(customParameterName); field.setType(type); getParameters().add(field); getParameterTypes().add(null); }
/** * INTERNAL: * All values are printed as ? to allow for parameter binding or translation during the execute of the call. */ public void appendTranslationParameter(Writer writer, ParameterExpression expression, DatabasePlatform platform, AbstractRecord record) throws IOException { try { platform.writeParameterMarker(writer, expression, record, this); } catch (IOException exception) { throw ValidationException.fileError(exception); } getParameters().add(expression); getParameterTypes().add(TRANSLATION); }
/** * PUBLIC: * This method should only be used with custom SQL: * it sets a type to IN, OUT or INOUT parameter (prefixed with #, ### or #### in custom SQL string). */ public void setCustomSQLArgumentType(String customParameterName, Class type) { DatabaseField field = new DatabaseField(customParameterName); field.setType(type); getParameters().add(field); getParameterTypes().add(null); }
/** * PUBLIC: * This method should only be used with custom SQL: * it sets a type to IN, OUT or INOUT parameter (prefixed with #, ### or #### in custom SQL string). * The argumentFieldName is the field or argument name used in the SQL. * The type is the JDBC type code for the parameter. */ public void setCustomSQLArgumentType(String argumentFieldName, int type) { DatabaseField field = new DatabaseField(argumentFieldName); field.setSqlType(type); getParameters().add(field); getParameterTypes().add(null); }
/** * INTERNAL: * All values are printed as ? to allow for parameter binding or translation during the execute of the call. */ public void appendTranslationParameter(Writer writer, ParameterExpression expression, DatabasePlatform platform, AbstractRecord record) throws IOException { try { platform.writeParameterMarker(writer, expression, record, this); } catch (IOException exception) { throw ValidationException.fileError(exception); } getParameters().add(expression); getParameterTypes().add(TRANSLATION); }
/** * INTERNAL: * All values are printed as ? to allow for parameter binding or translation during the execute of the call. */ public void appendTranslationParameter(Writer writer, ParameterExpression expression, DatabasePlatform platform, AbstractRecord record) throws IOException { try { platform.writeParameterMarker(writer, expression, record, this); } catch (IOException exception) { throw ValidationException.fileError(exception); } getParameters().add(expression); getParameterTypes().add(TRANSLATION); }
/** * PUBLIC: * This method should only be used with custom SQL: * Used for Oracle result sets through procedures. * It defines OUT parameter (prefixed with ### in custom SQL string) * as a cursor output. */ public void useCustomSQLCursorOutputAsResultSet(String customParameterName) { DatabaseField field = new DatabaseField(customParameterName); getParameters().add(field); getParameterTypes().add(OUT_CURSOR); setIsCursorOutputProcedure(true); } }
/** * PUBLIC: * This method should only be used with custom SQL: * it sets a type to IN, OUT or INOUT parameter (prefixed with #, ### or #### in custom SQL string). * The argumentFieldName is the field or argument name used in the SQL. * The type is the JDBC type code for the parameter. */ public void setCustomSQLArgumentType(String argumentFieldName, int type) { DatabaseField field = new DatabaseField(argumentFieldName); field.setSqlType(type); getParameters().add(field); getParameterTypes().add(null); }
/** * PUBLIC: * This method should only be used with custom SQL: * it sets a type to IN, OUT or INOUT parameter (prefixed with #, ### or #### in custom SQL string). * The argumentFieldName is the field or argument name used in the SQL. * The type is the JDBC type code for the parameter. */ public void setCustomSQLArgumentType(String argumentFieldName, int type) { DatabaseField field = new DatabaseField(argumentFieldName); field.setSqlType(type); getParameters().add(field); getParameterTypes().add(null); }
/** * PUBLIC: * This method should only be used with custom SQL: * Used for Oracle result sets through procedures. * It defines OUT parameter (prefixed with ### in custom SQL string) * as a cursor output. */ public void useCustomSQLCursorOutputAsResultSet(String customParameterName) { DatabaseField field = new DatabaseField(customParameterName); getParameters().add(field); getParameterTypes().add(OUT_CURSOR); setIsCursorOutputProcedure(true); } }
/** * PUBLIC: * This method should only be used with custom SQL: * Used for Oracle result sets through procedures. * It defines OUT parameter (prefixed with ### in custom SQL string) * as a cursor output. */ public void useCustomSQLCursorOutputAsResultSet(String customParameterName) { DatabaseField field = new DatabaseField(customParameterName); getParameters().add(field); getParameterTypes().add(OUT_CURSOR); setIsCursorOutputProcedure(true); } }
/** * PUBLIC: * This method should only be used with custom SQL: * it sets a type to IN, OUT or INOUT parameter (prefixed with #, ### or #### in custom SQL string). * The argumentFieldName is the field or argument name used in the SQL. * The type is the JDBC type code for the parameter. * The typeName is the JDBC type name, this may be required for ARRAY or STRUCT types. */ public void setCustomSQLArgumentType(String argumentFieldName, int type, String typeName) { ObjectRelationalDatabaseField field = new ObjectRelationalDatabaseField(argumentFieldName); field.setSqlType(type); field.setSqlTypeName(typeName); getParameters().add(field); getParameterTypes().add(null); }
/** * PUBLIC: * This method should only be used with custom SQL: * it sets a type to IN, OUT or INOUT parameter (prefixed with #, ### or #### in custom SQL string). * The argumentFieldName is the field or argument name used in the SQL. * The type is the JDBC type code for the parameter. * The typeName is the JDBC type name, this may be required for ARRAY or STRUCT types. */ public void setCustomSQLArgumentType(String argumentFieldName, int type, String typeName) { ObjectRelationalDatabaseField field = new ObjectRelationalDatabaseField(argumentFieldName); field.setSqlType(type); field.setSqlTypeName(typeName); getParameters().add(field); getParameterTypes().add(null); }
/** * PUBLIC: * This method should only be used with custom SQL: * it sets a type to IN, OUT or INOUT parameter (prefixed with #, ### or #### in custom SQL string). * TThe argumentFieldName is the field or argument name used in the SQL. * The type is the JDBC type code for the parameter. * The typeName is the JDBC type name, this may be required for ARRAY or STRUCT types. */ public void setCustomSQLArgumentType(String argumentFieldName, int type, String typeName) { ObjectRelationalDatabaseField field = new ObjectRelationalDatabaseField(argumentFieldName); field.setSqlType(type); field.setSqlTypeName(typeName); getParameters().add(field); getParameterTypes().add(null); }
/** * Print the sub query to the printer. */ protected void printCustomSQL(ExpressionSQLPrinter printer) { /* * modified for bug#2658466. This fix ensures that Custom SQL sub-queries are translated * and have variables substituted with values correctly. */ SQLCall call = (SQLCall)getSubQuery().getCall(); call.translateCustomQuery(); printer.getCall().getParameters().addAll(call.getParameters()); printer.getCall().getParameterTypes().addAll(call.getParameterTypes()); printer.printString(call.getCallString()); }
/** * Print the sub query to the printer. */ protected void printCustomSQL(ExpressionSQLPrinter printer) { /* * modified for bug#2658466. This fix ensures that Custom SQL sub-queries are translated * and have variables substituted with values correctly. */ SQLCall call = (SQLCall)getSubQuery().getCall(); call.translateCustomQuery(); printer.getCall().getParameters().addAll(call.getParameters()); printer.getCall().getParameterTypes().addAll(call.getParameterTypes()); printer.printString(call.getCallString()); }
/** * Print the sub query to the printer. */ protected void printCustomSQL(ExpressionSQLPrinter printer) { /* * modified for bug#2658466. This fix ensures that Custom SQL sub-queries are translated * and have variables substituted with values correctly. */ SQLCall call = (SQLCall)getSubQuery().getCall(); call.translateCustomQuery(); printer.getCall().getParameters().addAll(call.getParameters()); printer.getCall().getParameterTypes().addAll(call.getParameterTypes()); printer.printString(call.getCallString()); }