Subject | Re: [firebird-support] Re: Unexpected "a string constant is delimited by double quotes" exception |
---|---|
Author | Helen Borrie |
Post date | 2010-10-05T19:05:37Z |
At 02:51 AM 6/10/2010, fernnaj wrote:
Note that a clause like this is not valid in raw SQL:
WHERE
(PMH.PMH_E=@string0
AND
(PMH.PMH_C=@guid0 OR PMH.PMH_C IS NULL))
At the API level, there are no named parameters. The provider should be resolving your "variables" to an ordered structure (similar to an array) that is passed across the API in company with this:
WHERE
(PMH.PMH_E= ?
AND
(PMH.PMH_C= ? OR PMH.PMH_C IS NULL))
The Firebird API never swaps wrongly-applied quotes for the correct ones: all it can do is detect the error (if it can) and report it. So, as Ismael suggested, if wrongly applied double quotes are being passed across the API, it is being caused by either your program code or a bug in the provider.
It is worth noting that parameters are not variables. Since host programs usually accept host variables to be "slotted into" the prepared parameter structure, it appears your code (or perhaps a buggable condition in the provider code) handles these double-quoted host strings. In the case you offer, my first suspect would be the manner in which null strings are handled. I would look for conditions in your program code where the SQL "IS NULL" predicate is (wrongly) being passed to the API as an empty C-style string, viz.
WHERE
(PMH.PMH_E= ?
AND
(PMH.PMH_C= ? OR PMH.PMH_C = ""))
or where a null is being passed in as an empty C-style string, causing the error during substitution:
WHERE
(PMH.PMH_E= ""
AND
(PMH.PMH_C= ? OR PMH.PMH_C IS NULL))
Please take this problem to the appropriate list. That is where the resident experts could help you to root this one out. You can find instructions for subscribing to the firebird-net-provider list by visiting http://firebirdsql.org/index.php?op=lists
^ heLen ^
>Hello,The message "a string constant is delimited by double quotes" means your program passed an SQL request containing a string constant delimited by double quotes. String constants must be delimited by single quotes.
>
>As Ricardo suggests, I thought that the problem could be the provider, but I brought it to this list just to know what the message is supposed to mean.
>I have updated our provider to 2.5.2. As we cannot replicate the problem at will, we can just hope that it will prevent the problem (whatever it may be) to happen again.This is not the dotNet provider list. If you suspect the provider is causing this then please ask on that list.
Note that a clause like this is not valid in raw SQL:
WHERE
(PMH.PMH_E=@string0
AND
(PMH.PMH_C=@guid0 OR PMH.PMH_C IS NULL))
At the API level, there are no named parameters. The provider should be resolving your "variables" to an ordered structure (similar to an array) that is passed across the API in company with this:
WHERE
(PMH.PMH_E= ?
AND
(PMH.PMH_C= ? OR PMH.PMH_C IS NULL))
The Firebird API never swaps wrongly-applied quotes for the correct ones: all it can do is detect the error (if it can) and report it. So, as Ismael suggested, if wrongly applied double quotes are being passed across the API, it is being caused by either your program code or a bug in the provider.
It is worth noting that parameters are not variables. Since host programs usually accept host variables to be "slotted into" the prepared parameter structure, it appears your code (or perhaps a buggable condition in the provider code) handles these double-quoted host strings. In the case you offer, my first suspect would be the manner in which null strings are handled. I would look for conditions in your program code where the SQL "IS NULL" predicate is (wrongly) being passed to the API as an empty C-style string, viz.
WHERE
(PMH.PMH_E= ?
AND
(PMH.PMH_C= ? OR PMH.PMH_C = ""))
or where a null is being passed in as an empty C-style string, causing the error during substitution:
WHERE
(PMH.PMH_E= ""
AND
(PMH.PMH_C= ? OR PMH.PMH_C IS NULL))
Please take this problem to the appropriate list. That is where the resident experts could help you to root this one out. You can find instructions for subscribing to the firebird-net-provider list by visiting http://firebirdsql.org/index.php?op=lists
^ heLen ^