Skip to Content.
Sympa Menu

freetds - RE: [freetds] Inserting data with stored procedure problem

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "ZIGLIO, Frediano, VF-IT" <Frediano.Ziglio AT vodafone.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] Inserting data with stored procedure problem
  • Date: Fri, 15 Oct 2004 11:56:10 +0200


>
> Hello,
> I have a problem with the following case:
> I have MS SQL Server and two clients: Windows (MS ODBC
> Driver) and Linux
> (FreeTDS).
> The following procedure inserts data into a TLSP table (@ObjectId,
> @ObjectTypeRef and @ConfigurationId are the foreign keys):
> create procedure dbo.insertTLSP
> @ObjectId int, @ObjectTypeRef int, @ConfigurationId int,
> @Name varchar(255),
> @Type int, @CreationDate DateTime, @LoadDate DateTime, @Data
> image, @id int
> output as
> set nocount on
> if @ObjectTypeRef is null
> begin
> select @ObjectTypeRef = Type from TObject where
> ObjectId = @ObjectId
> end
> insert TLSP (ObjectId, ObjectTypeRef, ConfigurationId, Name, Type,
> CreationDate, LoadDate, Data)
> values(@ObjectId, @ObjectTypeRef, @ConfigurationId, @Name, @Type,
> @CreationDate, @LoadDate, @Data)
> select @id = SCOPE_IDENTITY()
> go
>
> I call the SP above the following way:
> "{? = call insertTLSP(3, null, 1, 'test name', 1, {ts '2004-10-13
> 10:12:03'}, null, ?, ?)}"
>

Although seems similar wire it's very different. Calling store procedure
with fixed parameters it's still not supported. For this reason FreeTDS
try to prepare statement using normal prepare (instead of using store
procedure calls). However (even from ODBC specifications) output
parameters are supported only for store procedure calls.
However the log show me that when FreeTDS call prepared statement
(SQLExecute) it use output parameters. It seems also that mssql don't
claim about the call but about the declarations... Perhaps it's possible
to use prepare and output parameters in msql ?? It this it's true it
should be possible to fix your problem without implementing constant
store procedure parameters (that is fixing the problem quickly). If this
it's not true you'll have to wait more...

I'll write a test...

freddy77




Archive powered by MHonArc 2.6.24.

Top of Page