// Check for proper element name and datatype definition in the
// dynamic SQL
// If the projected symbol list equal to 1, we won't bother checking
// the name.
while (dynamicIter.hasNext()) {
SingleElementSymbol dynamicSymbol = (SingleElementSymbol) dynamicIter.next();
Class<?> sourceSymbolDatatype = sourceIter.next().getType();
// Check if the the dynamic sql element types are equal or
// implicitly convertible to the source types
Class<?> dynamicType = dynamicSymbol.getType();
String dynamicTypeName = DataTypeManager
.getDataTypeName(dynamicType);
String sourceTypeName = DataTypeManager
.getDataTypeName(sourceSymbolDatatype);
if (!dynamicTypeName.equals(sourceTypeName)
&& // If the types aren't the same, and...
!DataTypeManager.isImplicitConversion(sourceTypeName,
dynamicTypeName)) { // if there's no implicit
// conversion between the
// two
Object[] params = new Object[] { sourceTypeName,
dynamicSymbol.getShortName(),
dynamicTypeName };
throw new QueryProcessingException(QueryPlugin.Util
.getString("ExecDynamicSqlInstruction.6", params)); //$NON-NLS-1$
}
}