Subject | Re: [ib-support] can isc_dsql_describe_bind(...) be used to retrieve field name(s)? |
---|---|
Author | Jason Wharton |
Post date | 2001-03-22T17:42:55Z |
When IB parses the statement at prepare time you are only able to pass it a
'?' indicator for a parameter. There is no name associated with the
parameter indicator. Also, it isn't always possible to directly consider a
parameter associated to a particular column. InterBase just treats them as a
nameless item. This is why the API call you are using doesn't give any
indication of a column name.
In short, it is up to you to parse the SQL statement and actually plug in
the names of the parameters.
Also beware, IB will play tricks on which parameter goes to which XSQLVAR
when you start doing in-line (sub) selects with parameters.
HTH,
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com
'?' indicator for a parameter. There is no name associated with the
parameter indicator. Also, it isn't always possible to directly consider a
parameter associated to a particular column. InterBase just treats them as a
nameless item. This is why the API call you are using doesn't give any
indication of a column name.
In short, it is up to you to parse the SQL statement and actually plug in
the names of the parameters.
Also beware, IB will play tricks on which parameter goes to which XSQLVAR
when you start doing in-line (sub) selects with parameters.
HTH,
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com
----- Original Message -----
From: <georg_ritter@...>
To: <ib-support@yahoogroups.com>
Sent: Thursday, March 22, 2001 1:16 AM
Subject: [ib-support] can isc_dsql_describe_bind(...) be used to retrieve
field name(s)?
> Hi,
>
> I am using the Interbase API to run an Insert statement, exactly as
> desribed in the API Guide, Chapter 6, "Method2:Non-query statements
> with parameters" (p98 ff)
>
> Calling isc_dsql_describe_bind(...) with a supplied input descriptor
> XSQLDA (in_sqlda), I would like to retrieve not only the SQL type and
> length, but also the name (sqlname in the XSQLVAR structure).
>
> Is isc_dsql_describe_bind(...) supposed to fill that information in
> the in the input XSQLDA ?
> The functions only fills in sqltype and sqllen in my test program, and
> I am not sure if it should provide the sqlname as well.
>
> Thanks,
> Georg Ritter