Re: SQL Flooding Shared Memory

From: Mladen Gogala <>
Date: Thu, 1 Jan 2009 12:49:35 +0000 (UTC)
Message-ID: <gjie4v$fh2$>

On Tue, 30 Dec 2008 05:02:18 -0800, shweta.kaparwan wrote:

> I mean no bind variable
> is used and therefore every time the SQL is executed.. a new copy of the
> SQL is loaded and executed.
> How we can get rid of above problem.

By recoding the app to use bind variables. Not using bind variables is especially popular with the applications written in scripting languages like Perl or PHP. I've come across the following snippet many times:

my $SEL="select * from table where column=$value";

I always flag that as a coding error. The proper way to code that would be the following:

my $SEL="select * from table where column=:VALUE"; my $sel=$dbh->prepare($SEL);

If the statement in $SEL has to be re-executed with a new value, all that needs to be done is to bind new value to the :VALUE placeholder. No parsing will be done, no new SQL will be stored.

Received on Thu Jan 01 2009 - 06:49:35 CST

Original text of this message