Subject Re: [ib-support] isc_dsql_sql_info
Author Claudio Valderrama C.
"Uwe Sander" <usander@...> wrote in message
news:E16PNWM-0005us-00@......
>
> Yes, it is the same. That is the explanation of how to identify the type
of
> an unknown statement. So far, so good. But what about the other constants
> listet in ibase.h? I see the following (taken from FB RC2, only my printed
> docs are older)
>
> /*************************/
> /* SQL information items */
> /*************************/
>
> #define isc_info_sql_select 4
> #define isc_info_sql_bind 5
> #define isc_info_sql_num_variables 6
> #define isc_info_sql_describe_vars 7
> #define isc_info_sql_describe_end 8
> #define isc_info_sql_sqlda_seq 9
> #define isc_info_sql_message_seq 10
> #define isc_info_sql_type 11
> #define isc_info_sql_sub_type 12
> #define isc_info_sql_scale 13
> #define isc_info_sql_length 14
> #define isc_info_sql_null_ind 15
> #define isc_info_sql_field 16
> #define isc_info_sql_relation 17
> #define isc_info_sql_owner 18
> #define isc_info_sql_alias 19
> #define isc_info_sql_sqlda_start 20

Api Guide says:

«Note All information about a statement except its type can be more easily
determined by calling functions other than isc_dsql_sql_info(). For example,
to determine the information to fill in an input XSQLDA, call
isc_dsql_describe_bind(). To fill in an output XSQLDA, call
isc_dsql_prepare() or isc_dsql_describe().»

This comment applies to the prior items. Better handled through the XSQLDA.

> #define isc_info_sql_stmt_type 21

This is the documented item. Api Guide says, too:

«Note Additional information item macros for requested items can be found in
ibase.h under the comment, “SQL information items.”»

> #define isc_info_sql_get_plan 22
> #define isc_info_sql_records 23

Optimizer's plan in user readable format and count of affected records have
been used by command-line isql and IBO for years. In API Guide, API Function
Reference says:

«isc_dsql_sql_info()
[...]
Requested information can include the:
[...]
- The query plan prepared by the optimizer»

There are equivalent record counts through isc_database_info, but returned
for a list of tables and for all the duration of the attachment (Database
operation counts near page 55).

> #define isc_info_sql_batch_fetch 24

This is a boolean value, indicating if the statement is executed with
buffering or not. That's a rather internal information.

C.
--
Claudio Valderrama C. - http://www.cvalde.com - http://www.firebirdSql.org
Independent developer
Owner of the Interbase® WebRing