Skip to Content.
Sympa Menu

freetds - Re: Need help with stored procedures and Sybase

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Michael Toth <mike AT spiralcraft.com>
  • To: "TDS Development Group" <freetds AT franklin.oit.unc.edu>
  • Subject: Re: Need help with stored procedures and Sybase
  • Date: Mon, 08 Feb 1999 08:42:05 +0000


You can try permanent stored procedures. Keep one table per db with that
stores the statement text, a generated procedure name and the last access
date. The first time the driver is used on a db, it should create the
table. When a prepared statement is created, the table is queried for
matching statement text and the procedure name is returned or a new one is
created.

Every once in a while the tracking table can be purged.

This option should be off by default. A driver property can turn it on if
the performance is worth giving the driver access to install and update the
tracking table.

This is probably a hack, because it requires some admin work, but you'll
save the performance.

BTW, nice work on the JDBC driver. This is a pretty key part of the GNU
multiuser application framework we're building.

Mike

P.S. I did some work to automatically send Strings > 255 chars as Text. I
also 'implemented' some unimplemented setXXX() types by converting them to
implented ones. Do you want this code? Or did you already implement this?

At 11:39 PM 2/7/99 -0800, you wrote:
>
>
>I implemented PreparedStatements in FreeTDS JDBC driver with temporary
>stored procedures for SQLServer. A temporary stored procedure is
>created when the PreparedStatement is executed the first time and is
>automatically cleaned up by SQLServer when the session is
>disconnected.
>
>Sybase does not allow temporary stored procedures. Are there any
>Sybase experts out there that know of someway I can get the server to
>automatically clean up (delete) a stored procedure when the session
>that created it closes?
>
>I had hoped to place a trigger on the master.dbo.sysprocesses table to
>delete the stored procedures when the session was terminated, but
>Sybase doesn't allow triggers to be placed on stored procedures.
>
>I'm nearly at my wits end trying to find a good way to implement
>PreparedStatements for Sybase. If anyone out there has any good
>ideas, please let me know.
>
>I don't want to just take the parameters and build an ad-hoc SQL
>statement each time the statement is executed, but if I don't find a a
>different way then I'll have to implement that. It would make the
>driver slower when taking to Sybase than SQLServer and I hope to avoid
>that.
>
>--
>=======================================================================
> Life is short. | Craig Spannring
> Ski hard, Bike fast. | cts AT internetcds.com
> --------------------------------+------------------------------------
> Any sufficiently perverted technology is indistinguishable from Perl.
>=======================================================================
>
>---
>You are currently subscribed to freetds as: mike AT spiralcraft.com
>To unsubscribe, forward this message to
$subst('Email.Unsub')
>




Archive powered by MHonArc 2.6.24.

Top of Page