Subject Re: [ib-support] isc_dsql_sql_info
Author Helen Borrie
At 11:54 AM 12-01-02 +0100, you wrote:
>Hi again,
>
>> It's documented in the APIGuide, Chapter 6, Working with Dynamic SQL, see
>> the topic titled "Determining an unknown statement type at run-time".
>
>sorry, but this does not answer my question. I have looked into my printed
>manual (IB 4) and into the downloadable PDFs, but both just explain how to
>use the constant isc_info_sql_stmt_type, not a single word about the other
>constants. Or is there an updated version of the docs?

Uwe:

Several! but whether the IB 5.1, 5.5 or IB 6 API could be applied to IB 4 is another thing.

What did you discover on page 113 of the API Guide? Anything similar to this?

A
request to identify a statement type returns the following information in the result buffer:
1. One byte containing isc_info_sql_stmt_type.
2. Two bytes containing a number, n, telling how many bytes compose the
subsequent value.
3. One or two bytes specifying the statement type. The following table lists the
statement types that can be returned:

TABLE 6.6 Statement types
isc_info_sql_stmt_select 1
isc_info_sql_stmt_insert 2
isc_info_sql_stmt_update 3
isc_info_sql_stmt_delete 4
isc_info_sql_stmt_ddl 5
isc_info_sql_stmt_get_segment 6
isc_info_sql_stmt_put_segment 7
isc_info_sql_stmt_exec_procedure 8
isc_info_sql_stmt_start_trans 9
isc_info_sql_stmt_commit 10
isc_info_sql_stmt_rollback 11
isc_info_sql_stmt_select_for_upd 12

4. A final byte containing the value isc_info_end (0).

The values placed in the result buffer are not aligned. Type Numeric value...etc. etc. more about how to interpret and handle the result buffer...

Also look in ibase.h (in the .\include directory of your IB root) for something similar to "SQL Information Items".

By the way, it's recommended that you mention which database and version you are using when you first raise a support question...

regards,
Helen

All for Open and Open for All
Firebird Open SQL Database ยท http://firebirdsql.org
_______________________________________________________