HFChristie
Programmer
I've got a question about using a variable to contain a segment of an SQL statment, and then using it in an Informix Procedure.
For instance;
DEFINE col_values char(255);
LET col_values = "'ABC', 'DEF', '123'"
SELECT MAX(col_a)
FROM table_a
WHERE col_b IN (col_values)
What I'm trying to do is have the SQL statement above evaluated as;
SELECT MAX(col_a)
FROM table_a
WHERE col_b IN ('ABC', 'DEF', '123')
My actual procedure is building the content of col_values, not using a literal.
Does anyone know if there is there a way to do this?
For instance;
DEFINE col_values char(255);
LET col_values = "'ABC', 'DEF', '123'"
SELECT MAX(col_a)
FROM table_a
WHERE col_b IN (col_values)
What I'm trying to do is have the SQL statement above evaluated as;
SELECT MAX(col_a)
FROM table_a
WHERE col_b IN ('ABC', 'DEF', '123')
My actual procedure is building the content of col_values, not using a literal.
Does anyone know if there is there a way to do this?