Dear Informixers,
in ESQL/C, I'm having problems using a host variable as a constant in a
SELECT clause.
A statement like the following produces a -201 (syntax error) error:
SELECT :my_var1, col1, 'N', col2
FROM mytable
WHERE col3 = :my_var2
What am I doing wrong here?
I need to use the results of this select statement as values for an
input statement, like INSERT INTO mytable1 SELECT ...
Regards, Richard
↪ replying to Richard Spitz
That's always been a problem. Either prepare the statement from a string
or use CREATE TEMP TABLE and INSERT the constant, adding this table name
to the FROM clause.
--
Regards,
Doug Lawry
www.douglawry.webhop.org
"Richard Spitz" <Richard.Spitz@med.uni-muenchen.de> wrote in message
news:pr57q21nromvdh7ir42acsa3jfo2i252n6@4ax.com...
> Dear Informixers,
>
> in ESQL/C, I'm having problems using a host variable as a constant in a
> SELECT clause.>
> A statement like the following produces a -201 (syntax error) error:
>
> SELECT :my_var1, col1, 'N', col2
> FROM mytable
> WHERE col3 = :my_var2
>
> What am I doing wrong here?
>
> I need to use the results of this select statement as values for an
> input statement, like INSERT INTO mytable1 SELECT ...
>
> Regards, Richard