freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
Re: [freetds] Still can't process stored procedure results.
- From: Frediano Ziglio <freddyz77 AT tin.it>
- To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
- Subject: Re: [freetds] Still can't process stored procedure results.
- Date: Mon, 18 Aug 2003 18:26:31 -0000
Il lun, 2003-08-18 alle 15:12, James Vanns ha scritto:
> OK, I understand that M$ SQL Server (2000) outputs the results of stored
> procedures in two different ways depending on how the sproc is written.
> It can return a result set or print out the fields directly (to stdout
> if you like!).
>
> I can retrieve (using the TDS library) the results of a sproc if it is a
> result-set. However I cannot if it is printed to the 'screen'. I am
> switching on the directives below:
>
> <snip>
> results = socket->res_info;
>
> if (results)
> switch (result_type) {
> case TDS_ROWFMT_RESULT:
> case TDS_COMPUTEFMT_RESULT:
> for (int i = 0 ; i < results->num_cols ; i++)
> headers.push_back (results->columns[i]->column_name);
>
> break;
> case TDS_ROW_RESULT:
> case TDS_COMPUTE_RESULT:
> while (tds_process_row_tokens (socket, &row_type, &id) ==
> TDS_SUCCEED) {
> vector<string> row;
> for (int i = 0 ; i < results->num_cols ; i++)
> row.push_back (field_as_string (i));
>
> result_set.push_back (row);
> }
> break;
> }
>
> </snip>
>
> I am using the latest FreeTDS source and protocol version 8. Any ideas
> on how I can see the results of a sproc that simply prints its output?
>
> Many thanks.
>
> James Vanns
prints its output ??
If you mean "print" statement register a message handler an print
message (see tsql.c for an example). However I don't recommend you to
use libTDS directly. Is subject to change without notice cause its use
is mainly be the core of other libraries (ctlib, dblib and odbc)
freddy77
-
[freetds] Still can't process stored procedure results.,
James Vanns, 08/18/2003
-
Re: [freetds] Still can't process stored procedure results.,
Frediano Ziglio, 08/18/2003
- Re: [freetds] Still can't process stored procedure results., James Vanns, 08/19/2003
- <Possible follow-up(s)>
- RE: [freetds] Still can't process stored procedure results., Rogers, Tom, 08/18/2003
-
Re: [freetds] Still can't process stored procedure results.,
Frediano Ziglio, 08/18/2003
Archive powered by MHonArc 2.6.24.