Yes, that is the issue.

I was hoping you could share the actual code
with us.  But no problem.  Sounds like you have
some good clues.

Using Oracle 8 client and ancient DBI libraries
probably isn't helping, but also seems unlikely to hurt.

I'm leaning toward the opinion of an invisible special character
of some sort embedded in your query string.
But I could be all wet.

Does it exhibit the same failure if you swap the selects
around the 'UNION' ?




-----Original Message-----
From: William Bulley [mailto:w...@umich.edu] 
Sent: Wednesday, June 03, 2015 10:44 AM
To: Howard, Chris
Cc: Martin J. Evans; dbi-users@perl.org
Subject: Re: help with odd DBI perpare/execute errors

According to "Howard, Chris" <howa...@prpa.org> on Wed, 06/03/15 at 12:30:
> 
> Thanks!
> And what does $query contain?

That is the issue!  Martin has worked with me off-line and clearly
the query contained some quote characters.  I've attempted to either
remove those or quote them the DBI quote() way, but since some of
my columns have VARCHAR2 types, I must issue this sort of syntax in
my WHERE clause:

    column LIKE 'something'

It can't be avoided.  And since the basic structure of the "query"
is like this:

    select distinct
       column,
       column,
       column
    from table, table, table
    where column = ?
       column = column,
       column = column,
       column LIKE 'something'
    union
    select distinct
       column,
       column,
       column
    from table, table, table
    where column = ?
       column = column,
       column = column,
       column LIKE 'something'

Note the two question marks.  The first one passes muster, but the
second one is flagged as an error (invalid character):

   DBD::Oracle::db prepare failed: ORA-00911: invalid character
   (DBD ERROR: error possibly near <*> indicator at char 788 in'
   << snipped query here>>' at script.pl line xxx

Martin thinks the parsing in the dbd_preparse() function within the
dbdimp.c file (part of DBD::Oracle) has issues so that it cannot deal
with the second question mark given the preceding single quote(s).

It seems plausible, yet odd, to me, but it isn't my module.  Perhaps
I have an older version?  I dunno...   :-(

Regards,

web...

-- 

 /"\   ASCII RIBBON          / William Bulley
 \ /   CAMPAIGN AGAINST     / 
  X    HTML E-MAIL AND     / E-MAIL: w...@umich.edu
 / \   LISTSERV POSTINGS  /

72 characters width template ----------------------------------------->|

Reply via email to