Re: DBI->quote with DBD::Sysbase

From: Chris Faust (cfaust_at_doyougot.com)
Date: 04/10/04


To: "Tim Bunce" <Tim.Bunce@pobox.com>
Date: Sat, 10 Apr 2004 06:24:35 -0400


> Do double quotes really need to be doubled when embedded within a
> single quoted string? In other words, isn't 'foo"bar' correct for Sybase?
>
> Are you quoting literal strings or schema identifiers?
>
> Tim.

Thanks for the reply Tim,

I'm quoting literal strings and I'm afraid in this case it does no good to
have any double quotes within a single quoted string.

For an example:

$var = "I'm really wishing that I used "MySQL" as then I can use
placeholders".
$var = $dbh->quote($var);
$var now equals:
'I''m really wishing that I used "MySQL" because I could use placeholders.'

If I try to save this to the DB, all that gets saved is everything up until
the first double quote, in this case I end up with

I'm really wishing that I used

If I quote manually so I end up with:
'I''m really wishing that I used ""MySQL"" because I could use
placeholders.'

Everything goes fine.

Any suggestions?

Thanks
-Chris

Complete Thread>

> On Fri, Apr 09, 2004 at 01:12:14PM -0400, Chris Faust wrote:
> > Hello,
> >
> > I'm using the combination of DBI, DBD::Sysbase and FreeTDS to connect to
an MS-SQL server.
> > Due to the issues with placeholders and sp's (specifically not being
able to use them), I'm forced to properly deal with any single and double
quotes.
> >
> > It seems like DBI->quote does almost everything correctly with the
exception of leaving double quotes unchanged.
> >
> > Is there some way to get the quoting method to continue to work as it
does now but to also change
> >
> > "
> > to
> >
> > ""
>
> Do double quotes really need to be doubled when embedded within a
> single quoted string? In other words, isn't 'foo"bar' correct for Sybase?
>
> Are you quoting literal strings or schema identifiers?
>
> Tim.
>
> > Thanks!
> > -Chris
> >
> > DBI 1.38
> > DBD::Sybase 1.47
>



Relevant Pages

  • Re: DBI->quote with DBD::Sysbase
    ... > Due to the issues with placeholders and sp's, I'm forced to properly deal with any single and double quotes. ... Are you quoting literal strings or schema identifiers? ...
    (perl.dbi.users)
  • Re: enviroment variable with quotes and spaces treated as one argument
    ... > I want to pass in a single quoted string ... as the quotes are stripped during ... perform word splitting on it. ... Shell Scripting Recipes: ...
    (comp.unix.shell)
  • Re: inserting double quotes into sybase database
    ... > Executing a stored proc on a sybase database via perl that contains double ... > quotes in one or two of the parameters. ... contain the special MS quotes that are known to the default charset used ... Sybase DBA/Developer ...
    (comp.databases.sybase)
  • Re: DBI->quote with DBD::Sysbase
    ... > Thanks for the reply Tim, ... > I'm quoting literal strings and I'm afraid in this case it does no good to ... > have any double quotes within a single quoted string. ... > placeholders". ...
    (perl.dbi.users)
  • Re: DBI->quote with DBD::Sysbase
    ... >> Are you quoting literal strings or schema identifiers? ... > Thanks for the reply Tim, ... > I'm quoting literal strings and I'm afraid in this case it does no good to ... > have any double quotes within a single quoted string. ...
    (perl.dbi.users)