Okay, here's the deal. I've got a stored procedure on UDB DB2 and I'm passing in a parm that is integer that needs to be compared with a field on a table that was defined as character, but is really numeric.
In the stored procedure, I'm building a dynamic SQL statement and I need to put single quote marks around the passed-in parm so it can be compared to the table.
For example:
Quote:
WHEN 'SubClass' THEN
IF in_sub > 0 AND in_class > 0 THEN
SET WHERESTMT = WHERESTMT || 'AND A.lot = ' || in_class ;
END IF;
|
In the above, in_class needs to have single quotes around it. I've tried using double quotes, triple-single quotes, double-single quotes (like in ASP), double quotes around single quotes and escape characters (\'), but no luck. It simply doesn't want to do it.
Any ideas how I can do it?