Ryland
August 17th, 2009, 03:47 PM
I am working on a DB2 system and am trying to call LENGTH() using sqlbindparameter on the following SQL command.
"SELECT COUNT(*) FROM CLAIM_TICKET WHERE ( (LENGTH(BARCODE) = 26 OR LENGTH(BARCODE) = 28) AND LENGTH('?') = 14 ) AND PIN = ?")
but it always returns back 0 rows even when the string that I binding is 14 characters long. I have tried removing the single quotes but then I receive and error. The PIN parameter works fine (tested by hardcoding the string for Length. Should I be using a different function for passing hte string placed into LENGTH?
Thanks.
"SELECT COUNT(*) FROM CLAIM_TICKET WHERE ( (LENGTH(BARCODE) = 26 OR LENGTH(BARCODE) = 28) AND LENGTH('?') = 14 ) AND PIN = ?")
but it always returns back 0 rows even when the string that I binding is 14 characters long. I have tried removing the single quotes but then I receive and error. The PIN parameter works fine (tested by hardcoding the string for Length. Should I be using a different function for passing hte string placed into LENGTH?
Thanks.