Re: [Firebird-devel] Retrieving relation alias

2014-12-16 Thread Mark Rotteveel
On Tue, 16 Dec 2014 08:27:33 GMT, Rudolf Grauberger
rud...@grauberger.org wrote:
 I would like to read the table aliases, here I found out that I need to
 call the function isc_dsql_sql_info () with the parameter
 isc_info_sql_relation_alias.
 
 However, I have not figured out which parameters I need to call this
 function and how do I read the information.
 
 I already have at google, bing, etc. after the keywords
 isc_info_sql_relation_alias and isc_dsql_sql_info searched but no
 possible implementation/documentation found that I could take as a
 reference.
 
 I have looked into the source code of IBPP and the points at which the
 function isc_dsql_sql_info with isc_info_sql_get_plan,
 isc_info_sql_stmt_type or isc_info_sql_records called, the information
will
 always be read differently. It looks to me as though I need to know
exactly
 how I need to read the information to isc_info_sql_relation_alias.
 
 Is there somewhere a reference / example or documentation as the
 information read?

For an example of processing the info response look at the Jaybird
sources, org.firebirdsql.gds.ng.StatementInfoProcessor (at
http://sourceforge.net/p/firebird/code/HEAD/tree/client-java/trunk/src/main/org/firebirdsql/gds/ng/StatementInfoProcessor.java
)

If you need more information, let me know.

Mark

--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Retrieving relation alias

2014-12-16 Thread Vlad Khorsun
16.12.2014 11:13, Mark Rotteveel wrote:
 On Tue, 16 Dec 2014 11:03:39 +0200, Vlad Khorsun hv...@users.sf.net
 wrote:
 16.12.2014 10:27, Rudolf Grauberger wrote:
 I would like to read the table aliases,

 After call of isc_dsql_prepare() you'll have XSQLDA structure filled
 with all
 info, including known relation aliases. Read IB6 API Guide, chapter
 Working
 with Dynamic SQL. Guide is available here:

  http://www.firebirdsql.org/en/reference-manuals/

 The XSQLDA doesn't include the relation alias, only the relation name (and
 the column name and alias). So you need to to use sql_info to obtain the
 relation_alias; isc_info_sql_relation_alias was also only added in Firebird
 2.

   You right, i forget about it. Hope, your link helps Rudolf.

Regards,
Vlad



--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Retrieving relation alias

2012-04-09 Thread Dmitry Yemanov
09.04.2012 19:26, Mark Rotteveel wrote:

 I notice in /jrd/why.cpp (2.5 branch) that a similar named array does
 not have the isc_info_sql_relation_alias entry:

 static const SCHAR sql_prepare_info2[] =
 {
   isc_info_sql_stmt_type,

   // describe_select_info
   isc_info_sql_select,
   isc_info_sql_describe_vars,
   isc_info_sql_sqlda_seq,
   isc_info_sql_type,
   isc_info_sql_sub_type,
   isc_info_sql_scale,
   isc_info_sql_length,
   isc_info_sql_field,
   isc_info_sql_relation,
   isc_info_sql_owner,
   isc_info_sql_alias,
   isc_info_sql_describe_end,

   // describe_bind_info
 removed describe_bind_info part
 };

 Is this a bug or limitation in the implementation of the client, or do I
 need to do something extra in Jaybird to get the native library to
 retrieve the relational alias information as part of the prepare?

As far as I remember, the client retrieves only the minimal subset of 
items that can be represented inside XSQLVARs.

The relation alias is a Firebird extension not supported by XSQLDA, so 
you have to retrieve it manually via isc_dsql_sql_info().


Dmitry

--
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Retrieving relation alias

2012-04-09 Thread Dmitry Yemanov
09.04.2012 20:22, Dimitry Sibiryakov wrote:

 Isn't aliasname field of XSQLVAR for the relation alias name?..

It's the field alias, IIRC.


Dmitry

--
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel