Error when using bind variables.

orapal

Member
Hello,

(Delphi2006, Oracle9i)

consider the folowing SQL:

SELECT *
FROM V$SQL_PLAN B
WHERE B.ADDRESS=HEXTORAW(:addr)
AND B.HASH_VALUE=TO_NUMBER(:hashv)

DeclareAndSet('addr', otString, sqladdr ); // works ok
DeclareAndSet('hashv', otString, hashval ); // causing problems

//sqladdr = string contains HEX string
//hashval = string, contains actual HASH_VALUE(on oracle type=NUMBER)

When executed the following error is returned:
ORA-01460 unimplemented or unreasonable conversion requested

I have to pass HASH_VALUE as string because of overflow conversion problems as this value can be quite large number.

Any hints?

Thank you for your time.

Dan.
 
Perhaps you are using a multi-byte character set database and have set TOracleSession.BytesPerCharacter to bc1Byte? If so, set it to bcAutoDetect.
 
Back
Top