PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Michael Peppler <mpeppler at peppler dot org>
Subject: Re: Every Statement is a prepared stored proc?
Date: Oct 9 2008 5:25AM

On Oct 8, 2008, at 11:52 PM, CSane@EvergreenInvestments.com wrote:

>
> How do we avoid this problem?
> Would using DBI{finish} cause this?
>
>
> create proc DBD17 as SELECT mycolumn AS mycolumn FROM my2ndtable  
> WHERE id = ?
> create proc DBD18 as UPDATE my2ndtable SET mycolumn = ? WHERE id = ?
> create proc DBD19 as SELECT mycolumn AS mycolumn FROM my2ndtable  
> WHERE id = ?
> create proc DBD20 as UPDATE my2ndtable SET mycolumn = ? WHERE id = ?
> create proc DBD21 as SELECT mycolumn AS mycolumn FROM my2ndtable  
> WHERE id = ?
> create proc DBD22 as UPDATE my2ndtable SET mycolumn = ? WHERE id = ?

The script is calling prepare() for the same statement multiple times.  
You could try using prepare_cached(), or modify your script to call  
the prepare() twice (once for each of the two statements), and then  
use the two statement handles to execute the calls.

Michael
--
Michael Peppler              -                    Peppler Consulting  
SaRL
mpeppler@peppler.org         -                     http://www.peppler.org
Sybase DBA/Developer         -      TeamSybase: http://www.teamsybase.com
Sybase on Linux FAQ          -      http://www.peppler.org/FAQ/linux.html