On 06/13/2005 06:28 AM, Avis, Ed said:
Michael A Chase wrote:
>> Ed said:
I'd like to find out whether Oracle is expecting a given bind
variable to be a datetime, an integer or whatever.
The original example may have been wrong, but the advice still
stands. You can control the type of each placeholder.
No; because I don't know in advance what the query will be. The user
is entering the SQL to use, with bind variables, and I would like to
prepare the statement handle and find out from the database what the
expected type of each bind variable will be.
That's showing an awful lot of trust in the users' good intentions and
skill.
All placeholders are VARCHAR unless the type is explicitly given in the
bind_param*() call. If any values provided by the user have to be
treated differently, they'll have to tell you by some method unless you
parse the SQL to figure it out. I think SQL::Statement might be able to
help, but it is likely to take a lot of work to get right since many
cases are likely to be ambiguous.
--
Mac :})
** I usually forward private questions to the appropriate mail list. **
Ask Smarter: http://www.catb.org/~esr/faqs/smart-questions.html
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.