Subject | Re: how to retrieve Stat of a executed SQL ? |
---|---|
Author | nathanelrick |
Post date | 2012-02-21T09:11:11Z |
it's seam that i made a mistake in the way i want to retrieve the stat of the current Statement
I need to do
MON$STATEMENTS.MON$Statement_ID= ...
instead of
MON$STATEMENTS.MON$ATTACHMENT_ID=CURRENT_CONNECTION
the problem : how to retrieve the statement ID ?
i create the statement via the API :
* isc_dsql_allocate_statement
* isc_dsql_prepare
how to retrieve from the api the stmt_ID ?
I need to do
MON$STATEMENTS.MON$Statement_ID= ...
instead of
MON$STATEMENTS.MON$ATTACHMENT_ID=CURRENT_CONNECTION
the problem : how to retrieve the statement ID ?
i create the statement via the API :
* isc_dsql_allocate_statement
* isc_dsql_prepare
how to retrieve from the api the stmt_ID ?
--- In firebird-support@yahoogroups.com, "nathanelrick" <nathanelrick@...> wrote:
>
> Hello
>
> how to retrieve the stat of a just executed SQL ?
>
> i do like this but seam to not work :
>
> SELECT
> FIRST 1 SKIP 1 /* skip 1 because last statement is THIS statement */
> MON$RECORD_IDX_READS as IDX_READS,
> MON$RECORD_SEQ_READS as SEQ_READS
> FROM
> MON$RECORD_STATS
> JOIN
> MON$STATEMENTS ON MON$STATEMENTS.MON$STAT_ID=MON$RECORD_STATS.MON$STAT_ID
> WHERE
> MON$STATEMENTS.MON$ATTACHMENT_ID=CURRENT_CONNECTION
> ORDER BY
> MON$STATEMENTS.MON$TIMESTAMP DESC
>