Zabach, Elke wrote:
Ah, I see. The values I tried wasn't actually that random. They weren't the same that was used in the original query but they were close enough.Elias Martenson wrote:Does anyone have any ideas on where to start digging? I tried the same query, with some random values filled in in place of the question marks and I can't reproduce the problem.
It is really impossible to reproduce an error concerning parameter-usage
if one fills in some random values instead of the parameters. Therefore
I am not astonished about the last sentence.
Your problem are the '? is null' used in the query. SAP DB's kernel
need to describe which kind of parameter (an integer, a char (12) or varchar (47) or whatever else) will be expected as value of the parameter.
With <column> = ? it can be assumed that the parameter will have same
datatype and length as the column has, with ? = true it should be a boolean
value, but what about ? is null. It could be any datatype. And then SAP DB says ' oops, I do not know, please dear customer do not use a
parameter there'.
Sometimes it helps to say some_function (?) where some_function gives
the kernel an idea of the datatype, for example ABS (?) --> some number;
UPPER (?) --> some char, and so on.
I believe I understand what's going on. Could you please confirm wether I have understood this correctly? Here's my impression:
It seems as though I cannot reproduce the message when using manual SQL, since the query would be:
where ("foo" is null)
which works. It's only when using PreparedStatement that the system cannot deduce the type, because the actual argument hasn't been supplied yet. My personal guess is that the Postgres JDBC driver does not send the PrepearedStatement to the server until all the values has been filled in (which in turn hints that the performance of PreparedStatement in Postgres is actually slowed than using a normal statement) and that is the reason it works there.
I can't reqrite the query very easily since it's generated from EJB-QL, and I'd rather not mess around with the deployment descriptor so I'm in for a bit of rewrite.
Thank you again for your assistance. I'm getting better support here than with any other database. A big thank you to the SapDB team!
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general
