Skip to Content.
Sympa Menu

freetds - Re: Using Placeholders with freeTDS/MSSQL 7.0

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Bob Kline <bkline AT rksystems.com>
  • To: TDS Development Group <freetds AT franklin.oit.unc.edu>
  • Subject: Re: Using Placeholders with freeTDS/MSSQL 7.0
  • Date: Sat, 17 Jun 2000 02:37:07 -0400 (EDT)


On Fri, 16 Jun 2000, sarva wrote:

> Has anybody used place holders with ver 4.2 of freeTDS on Solaris. I get
> the followng error,
>
> Panic: dynamic SQL (? placeholders) are not supported by the server you are
> connecting to at /usr/local/lib/perl5/site_perl/DBD/Sybase.pm line 95.
>
> I'm using 4.2 because from the documentation only 4.2 and 7.0 works with
> MSSQL. If I compile with 7.0, I get the error 'Unknown Marker 0'.
>
> Is there any solution for this.
>
> We are migrating our database from ORacle to SQL Server and would like to
> reuse our perl cgi scripts.

Some of the solutions are:

1. Use one of the commercial ODBC-for-Unix packages.
2. Port your scripts to use the freetds JDBC driver, which does support
positional parameters.
3. Rewrite your scripts to embed the parameters as part of the SQL
string.
4. Contribute code to the freetds project to help get dynamic SQL
implemented in the C libraries.
5. Get someone else to do option 4 for you.

All but number 4 have obvious drawbacks. The ODBC packages available
for Unix were not exactly hassle-free last time I looked (and of course,
they're not free). Solution 2 may not appeal to you if you lots and
lots of scripts or aren't comfortable with Java. Solution 3 won't
always work. And solution 5 leaves you at the mercy of someone else's
timetable.

Solution 4 isn't trivial, because the support needs to be implemented
both in the tds layer and in the ctlib layer (which is the API on which
the DBD-Sybase driver you're using is built). Or you could do what I
believe the dblib API does, which is along the lines of solution 3
above, as I recall (but you'd be doing it in the driver instead of your
own scripts).

Good luck! Hope this helps.

--
Bob Kline







Archive powered by MHonArc 2.6.24.

Top of Page