05-03-10, 07:58 #1Registered User
- Join Date
- May 2010
Unanswered: DB2 doesnt accept question mark(?)
I got a error SQLSTATE 01517 saying that the DB2 could not convert the character in the required encoding.
I suspected that it is something to do with the characters that I have entered in one of the text areas that I had in the application.
By doing some deletion and modification of some special characters, I learnt that
the DB2 does not consider question mark(?) as a valid character. When I removed it, the app worked without any error.
I need some more insight on this - why doesn't DB2 take (?). This is very commonly used character and DB2 should be supporting this. I feel that there is something wrong in the DB2 setup. Can someone please help?
Is there a workaround for this?
05-03-10, 08:23 #2Registered User
- Join Date
- Jan 2007
- Jena, Germany
DB2 has no restriction on using question marks in strings.
The question is what your code is trying to do with the strings you are entering. If you don't do proper escaping for strings, you may have a simple SQL injection problem, which turns out to be a syntax error. A question mark that is not inside a string will be interpreted as parameter marker.Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development