http://qs321.pair.com?node_id=168095


in reply to Re: Calling SQL with embedded quotes
in thread Calling SQL with embedded quotes

I have to second use DBI instead. Also, you should get in the habit of using placeholders and binding, as they can make a huge difference on performance.

Where I'm working now, most of our old code didn't use placeholders and binding. Now that we are literally doing 1000X more transactions then when the program was written, we are feeling the pain. We've gone back and started to change all of our old code, and it has made a huge difference. Not only are we able to keep up now, but the program now responds noticeably faster then it did before. I see using placeholders and binding like using strict and warnings, you may not think you need to use them, but if you don't use them, it will come back to haunt you.

PS We use an Oracle database.

PPS We are doing this to both our perl and java code, and both languages are benifiting from using placeholders.

  • Comment on Re: Re: Calling SQL with embedded quotes

Replies are listed 'Best First'.
Re: Re: Re: Calling SQL with embedded quotes
by IlyaM (Parson) on May 21, 2002 at 14:51 UTC
    Note that while usually usage of placeholders is standart way to deal with such problems and it is highly recomended with most databases in case of Sybase implementation of placeholders have a number of different problems. It is covered in POD documentation for DBD::Sybase in chapter 'Using ? Placeholders & bind parameters to $sth->execute'.

    --
    Ilya Martynov (http://martynov.org/)

Re: Re: Re: Calling SQL with embedded quotes
by mpeppler (Vicar) on May 21, 2002 at 16:11 UTC