Skip to Content.
Sympa Menu

freetds - Re: transaction in stored procedure fails

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Michael Peppler <mpeppler AT peppler.org>
  • To: "TDS Development Group" <freetds AT franklin.oit.unc.edu>
  • Subject: Re: transaction in stored procedure fails
  • Date: Thu, 10 Jan 2002 14:29:49 -0800


kaspro AT web.de writes:
> I'm using freetds for accessing an MSSQL 2000 Server from linux with php.
> All the normal statements are functioning perfect, but not an transaction
> in a stored procedure. If I execute this via ODBC, it works...
> The procedure-call looks like this:
> {call dbo.Transact_Projects(5,'abc',NULL,'test2','def',2)}
> ...and the output from php/freetds like this:
> Changed database context to 'Projects'.
> In the logs i find this:
> Received packet @ 2002-01-08 23:11:01
> 0000 aa 62 00 aa 00 00 00 01 0f 22 00 4c 00 69 00 6e |.b.......".L.i.n|
> 0010 00 65 00 20 00 31 00 3a 00 20 00 49 00 6e 00 63 |.e. .1.:. .I.n.c|
> 0020 00 6f 00 72 00 72 00 65 00 63 00 74 00 20 00 73 |.o.r.r.e.c.t. .s|
> 0030 00 79 00 6e 00 74 00 61 00 78 00 20 00 6e 00 65 |.y.n.t.a.x. .n.e|
> 0040 00 61 00 72 00 20 00 27 00 7b 00 27 00 2e 00 09 |.a.r. .'.{.'....|

You need to use this instead:

exec dbo.Transact_Projects 4, 'abc', NULL, 'test2', 'def', 2

The {call ...} is an ODBC thing - not part of the normal T-SQL syntax.

Michael
--
Michael Peppler - Data Migrations Inc. - http://www.mbay.net/~mpeppler
mpeppler AT peppler.org - mpeppler AT mbay.net
International Sybase User Group - http://www.isug.com




Archive powered by MHonArc 2.6.24.

Top of Page