In Oracle, value and date are reserved words. Name might be too.
<snip>
The main issue is being able to walk the bind param. list
and check if the columns are numeric (naked copy of $a + 0
inserted) or not (quoted copy of $a).

The alternative is having to sprintf every query I use
for each combination of values and $dbh->do() them for
large datasets in case any one of them fails (ugh!).

If you don't know what the data types you are comparing to are, you have bigger problems than the query format.

Actually, one if the nice thigns about bind parameters is that I don't have to know much about the underlying database fields. If "500" is use stringily in one place and numerically in another perl just Does The Right Thing and I don't really care about it.

However, this has nothing at all to do with running
the queries.

I can already run the querys perfectly with placeholders.
The placeholders are a pain for admin's, however, since
they can not simply paste the queries into the database
client shell for later testing if I report errors.

It is about reporting a cut+paste-able error string
that the admin's can use to test why the query failed.
Having to hand-edit out the '?' and then properly
quote them by hand is rather error prone.

What I need is something that will replace the original
input string '?' characters with properly [un-]quoted
values from the bind paramter list so that queries which
begin life as:

select * from foo where field = ?

get turned into

select * from foo where field = '500'

(if 500 is being used for a stringy comparision in the SQL
based on the underlying field types). The problem is that
admin's who are trying to deal with a problem at 3am are in
no mood to stumble around finding field types so that they
can put quotes around things when they cut+paste my bind
values to generate a valid query string that they can use
in the client shell to test why the database spat out a
particular error.

--
Steven Lembark                               2930 W. Palmer
Workhorse Computing                       Chicago, IL 60647
                                           +1 888 359 3508

Reply via email to