On Fri, 3 Jan 2003 11:03:59 +0000, Tim Bunce wrote:
Hi Tim
>On Fri, Jan 03, 2003 at 07:08:25PM +1100, Ron Savage wrote:
>>On Thu, 2 Jan 2003 23:17:10 -0800 (PST), Michael A Chase wrote:
>>>Comments interspersed.
>>
>>>Fortunately it is part of the trace() output.
>>
>>Nevertheless, this is still a bug in DBI/Other. It's probably
>>related
>>to the fact that with HandleError => sub ... DBI often outputs the
>>_previous_ SQL when an error occurs. But forget that until I
>>generate
>>such an error and report it.
>
>I'd appreciate details. I'm aware of at least one theoretical cause
>for this but no one has reported an actual case to me yet.
It happens often enough. It's always been a coding fault on my part
which has triggered the error. I assure you I will report it when
another sample is at hand.
>>>I haven't seen backticks used as identifier quotes before.
>>>They may be confusing either ODBC or Access.
>>
>>No, they're what is reported by $dbh -> tables();
>
>Odd. I know MySQL uses backticks as identifier quotes but I'm not
>familar with Access.
See below.
>>>>my($error) = shift -> text();
>>>
>>>The parenthesis are not required by my. They provide a list
>>>context which may result in a different result from some
>>>subroutines than what you expect.
>>
>>They're required by my personal convention.
>>I'll try my(@error) later.
>
>I think he meant try: my $error = shift->text();
Tried that, and about 4 variations. See other posts.
>>>Try quoting the table name with brackets ([]) or normal
>>>quotes (") and see if that avoids this error.
>>>
>>>Something like this (untested) should do it for you:
>>>
>>>my $quoted_table = $dbh -> quote_identifier( "Nathan Bailey" );
>>>my $sql = 'select dpt_cde, cmt from $quoted_table';
>>
>>I could not get any form of [] to work.
>>
>>If you print the output of $dbh -> quote_identifier('X Y') you'll
>>see
>>DBI has added backticks.
>
>If the DBI added backticks it's because the driver told it to via:
>
> $dbh->get_info(29) # SQL_IDENTIFIER_QUOTE_CHAR
my($quote) = $dbh -> get_info(29);
print "<$quote> = ", ord($quote), ". \n";
reports:
<`> = 96.
--
Cheers
Ron Savage, [EMAIL PROTECTED] on 04/01/2003
http://savage.net.au/index.html