Skip to Content.
Sympa Menu

freetds - RE: [freetds] Problem with CS_PARAM_RESULT (c API) and MSSQL2k

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "ZIGLIO, Frediano, VF-IT" <Frediano.Ziglio AT vodafone.com>
  • To: <wolkow AT rosnet.net>, "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Cc:
  • Subject: RE: [freetds] Problem with CS_PARAM_RESULT (c API) and MSSQL2k
  • Date: Fri, 3 Jun 2005 16:58:27 +0200

>
> Hello, I am new in this list.
>
> I have problem with returning CS_PARAM_RESULT
> from exec stored procedure for MSSQL2k (in MSSQL7.0 no problem):
>
> "declare @REASON integer exec BUGPROC @REASON out"
>
> CREATE procedure BUGPROC
> @REASON int output
> as
> set nocount on
> set @reason = 99
> return 1
> GO
>
> I have FreeTDS version 0.63
>
> $ rpm -qa|fgrep freetds
> freetds-0.63-1
> freetds-devel-0.63-1
>
> client OS and hardware architecture:
> 2.6.11-1.27_FC3smp #1 SMP Tue May 17 20:38:05 EDT 2005
> x86_64 GNU/Linux
> FedoraCore 3
> or
> 2.4.18-18.7.xsmp #1 SMP Wed Nov 13 19:01:42 EST 2002 i686
> Redhat 7.3
>
> build:
> test.c - see in attach
> $ gcc -c test.c
> $ gcc test.o -lct -ltds -lsybdb -ldl -ltdssrv -o test
>
>
> connect to MSSQL 2000
>
> $ ./test mssql2000
> Connect to mssql2000 succeed.
> declare @REASON integer exec BUGPROC @REASON out
> CS_STATUS_RESULT
> Fetch done successfully.
> CS_CMD_SUCCEED
> ct_result returned CS_CMD_DONE.
> switch (ret) = CS_END_RESULTS.
> result=1
>
> connect to MSSQL 7.0
>
> $ ./test mssql7
> Connect to mssql7 succeed.
> declare @REASON integer exec BUGPROC @REASON out
> CS_STATUS_RESULT
> Fetch done successfully.
> CS_PARAM_RESULT !!!!!
> reason=99 !!!!!
> All done processing rows.
> CS_CMD_SUCCEED
> ct_result returned CS_CMD_DONE.
> switch (ret) = CS_END_RESULTS.
> result=1
>
>
> By means of what can I get CS_PARAM_RESULT by using MSSQL2k ?
>

This is NOT correct. You can get param result using mssql7 but not
mssql2k. I'll add that you are using an old mssql7, if you use a recent
service pack you can't get param result with mssql7. Simply Microsoft
change protocol along the way. To get results from store procedure use
store procedure calls.

freddy77




Archive powered by MHonArc 2.6.24.

Top of Page