views:

293

answers:

1

I am trying to call a query from Delphi 6 with bind variables, using the DOA component set's TOracleQuery object. I have 6 variable, 1 of which is a string (VarChar2 in Oracle lingo). I have tried calling query.DeclareVariable with the otVarchar2 enumeration, which intuitively makes sense, the otString enumeration (as the documentation recommends), and the otVarchar enumeration (on the off-chance it would work), all of which result in an exception at runtime: "Unsupported variable type".

Any idea what would be wrong? I would think creating a string-type bind variable would be a fairly common occurrence.

UPDATE: It was the otNumber that was causing the exception. It was just breaking on the otString line.

A: 

According to the documentation, I should have been using otInteger, not otNumber (using the Delphi terminology, rather than the Oracle terminology). So, the problem wasn't with the strings (after I changed it to otString), but Delphi was breaking on the line after the one that caused the exception (I'm used to VC# breaking on the line that triggered the exception). That fixed it.

Dov