Skip to Content.
Sympa Menu

freetds - Re: [freetds] call a stored procedure and tds_submit_query

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Fabrizio Taretto <fabrizio.taretto AT sinedita.it>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] call a stored procedure and tds_submit_query
  • Date: Fri, 23 Jul 2004 16:15:03 +0200

...thanks a lot,

but I can't manage to use my stored procedure.

My stored procedure's definition is:
create procedure GetDraw(
@tes int,
@ted int,
@tfp varchar(20)
@ded varchar(10)
}
....

In my C source code I call:

tds_submit_query(gSocket, "exec GetDraw @tes=100, @ted=100, @tfp='01010101', @ded='2004-03-03'");

...

tds_process_result_tokens(gSocket, &resulttype, &doneFlags)

...but the result type is Always TDS_DONE_RESULT.

Where is my mistake?

Regards
Fabrizio


Hi Fabrizio,

Yes you can do this - you would just construct a statement "exec sp_myproc
@parameter = 'value'" and submit it as you would a "select * from mytable"
or "update mytable set column = 'value'" statement.
If the stored procedure returns a result set, then it can be processed just
as if it were the result set from a "select * from mytable" statement.

The only proviso is with stored procedure OUTPUT parameters.
If you are talking to sql server 2000 sp3, then these will not be returned
to the client.

HTH,

Bill

-----Original Message-----
From: Fabrizio Taretto [mailto:fabrizio.taretto AT sinedita.it]
Sent: 23 July 2004 10:58
To: freetds AT lists.ibiblio.org
Subject: [freetds] call a stored procedure and tds_submit_query


Hi All,

someone can tell me if it's possible call a stored procedure with
tds_submit_query and process result with tds_process_result_tokens.
These functions are perfect for SELECT and UPDATE but what can I use
for a stored procedure?
Can anybody help me?

I'm work on MacOS X 10.3.4.

Regards
Fabrizio
_______________________________________________
FreeTDS mailing list
FreeTDS AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds

======================================================================= =======

If you are not an intended recipient of this e-mail, please notify
the sender, delete it and do not read, act upon, print, disclose,
copy, retain or redistribute it.

Click here for important additional terms relating to this e-mail.
<http://www.ml.com/email_terms/>

======================================================================= =======

_______________________________________________
FreeTDS mailing list
FreeTDS AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds




Archive powered by MHonArc 2.6.24.

Top of Page