Skip to Content.
Sympa Menu

freetds - RE: [freetds] rpc better: now only broken

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Frediano Ziglio <freddyz77 AT tin.it>
  • To: FreeTDS <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] rpc better: now only broken
  • Date: 27 Nov 2002 08:17:52 +0100

Il mar, 2002-11-26 alle 23:16, Lowden, James K ha scritto:
> > From: ZIGLIO Frediano [mailto:Frediano.Ziglio AT vodafoneomnitel.it]
> > Sent: November 26, 2002 11:36 AM
> >
> > This patch solve RPC problem but open other possible problems...
> > - dynamic do not want column names on data
>
> Do you mean:
>
> 1. dynamic SQL doesn't require named parmeters
> or
> 2. TDS 7.0 can't pass named parameters?
>

Dynamic query on TDS5 (using TDS5_DYN_TOKEN) do not want named
parameters. Simply add a flags parameters to
tds_put_data_info/tds_put_data_info_length to disable parameters name
(or reset name in tds_submit_execute ??)

>
> > - we do not use column_namelen (is this correct?)
>
> I don't think any of us knows yet if it's correct or not. :(
>

In TDSCOLINFO we have column_name and column_namelen... If column_name
is NUL terminated column_namelen is just a duplicate information that
can be out of sync...

> > - correct to use column_flags?
>
> Depends on the protocol; we'll have to experiment. Certainly,
>
> +++
>
> I've attached a note about SQLBindParameter from MSDN (ODBC Implementation
> Details), in case you haven't seen it. It supports output parameters.
>

I know, I know. Is our libtds that do not full support output
parameters. The patch I send fix the problem but my question still
remain. When we read flags from db we split it on bit (like
column_writable, column_nullable, etc). There are no flag for "this is
an output parameters"... The patch store this information on
column_flags... Another variable that duplicate informations and can
became out of sync...

> In db-lib, named parameter support in the protocol is required. The app
> calls dbrpcparam once for each parameter, but not in any particular order.
> TDS 5.0 passes them by name; the server returns them by name. Names are
> not required (they can be passed positionally), but db-lib does not have
> enough information to map names to positions.
>

Yes and not, named parameters do not require a position. If you want to
use position just pass unnamed parameters in a given order. Also what's
the meaning of mixing named and unnamed?
exec sp_test 1, @test = 'a', 2
2 is the second or third parameter ??

> This fast and loose name-and-numbers philosophy mirrors T-SQL as in:
>
> sp_adduser 'Figaro', 'Hero', 'Opera'
>
> could also be
>
> sp_adduser 'Figaro', @grpname = 'Opera', @name_in_db = 'Hero'
>
> Don't know if we're on the same page yet. HTH.
>
I think so :)

freddy77






Archive powered by MHonArc 2.6.24.

Top of Page