Skip to Content.
Sympa Menu

freetds - Re: Protocol confusion for stored procedure invocation [was: JDBC driver error]

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Spectron Caribe, Inc." <spectron AT caribe.net>
  • To: "TDS Development Group" <freetds AT franklin.oit.unc.edu>
  • Subject: Re: Protocol confusion for stored procedure invocation [was: JDBC driver error]
  • Date: Mon, 30 Apr 2001 14:27:07 -0400


Well I haven't solved the problem, I was just telling you what I saw causes
the problem. The thing is that I need the exec() in my stored procedure. The
real procedure I have looks like this:

CREATE PROCEDURE msim_testProcedure(@clientList text) AS
begin
/* create temporary table */
create table #orders (clientId,orderNo number smallint)
/* fill temporary table*/
exec('insert into #orders select clientId,orderNo from RealOrders where
clientId in ('+@clientList+')')
/* check some things in the temp table */
select clientId,orderNo from #orders
/* remove table */
drop table #orders
end

The parameter @clientList is a constraint for a real table. If I want to
check clients 1-5 in the procedure I would call:

exec msim_testProcedure '1,2,3,4,5'

It will change the query in the exec to ''insert into #orders select
clientId from RealOrders where clientId in ('1,2,3,4,5)" and then I would
only work with those numbers. Of course if someone has a better idea of how
to do this without an exec please tell me.

Faw

----- Original Message -----
From: "Bob Kline" <bkline AT rksystems.com>
To: "TDS Development Group" <freetds AT franklin.oit.unc.edu>
Sent: Monday, April 30, 2001 12:33 PM
Subject: [freetds] Re: Protocol confusion for stored procedure invocation
[was: JDBC driver error]


> On Mon, 30 Apr 2001, Spectron Caribe, Inc. wrote:
>
> > I think I found out what causes the error. It seems that if I add an
> > exec() command to the stored procedure it doesnt work.
> >
> > This procedure will work:
> > ....
>
> Glad you were able to find a version that works.
>
> --
> Bob Kline
> mailto:bkline AT rksystems.com
> http://www.rksystems.com
>
>
> ---
> You are currently subscribed to freetds as: [spectron AT caribe.net]
> To unsubscribe, forward this message to
$subst('Email.Unsub')
>





Archive powered by MHonArc 2.6.24.

Top of Page