Subject | Select with constant value |
---|---|
Author | Juan Pedro López Sáez |
Post date | 2005-03-01T19:20:56Z |
Hello all.
In Firebird it's possible a SELECT statement like this:
SELECT TABLE1.FIELD1, TABLE1.FIELD2, K AS CONST
FROM TABLE1
WHERE ...
The interesting point in this query is the constant value that will
appear in the resulting output set.
I've tested this kind of query against my database from isql, the
command line tool, providing an integer as the constant value.
Everything works perfectly.
Now I want to use it from jaybird, by means of a prepared statement,
because the constant value will change in every new query.
I tested it just replacing the constant value with the usual ? character
without success. It seem this parameter is not considered when preparing
the query so it fails because of some type mismatch in the subsequent
parameters.
Isn't this kind of parametrized query currently supported?
Thank you very much.
Juan Pedro Lopez
In Firebird it's possible a SELECT statement like this:
SELECT TABLE1.FIELD1, TABLE1.FIELD2, K AS CONST
FROM TABLE1
WHERE ...
The interesting point in this query is the constant value that will
appear in the resulting output set.
I've tested this kind of query against my database from isql, the
command line tool, providing an integer as the constant value.
Everything works perfectly.
Now I want to use it from jaybird, by means of a prepared statement,
because the constant value will change in every new query.
I tested it just replacing the constant value with the usual ? character
without success. It seem this parameter is not considered when preparing
the query so it fails because of some type mismatch in the subsequent
parameters.
Isn't this kind of parametrized query currently supported?
Thank you very much.
Juan Pedro Lopez