Subject udf dll
Author Robert Tulloch
Hi

  My udf is not working. Very strange error message. Exciting challenges



I execute any old SQL statement and Ok.

Run this and not ok.

SELECT cast (RDB$RELATION_NAME as varchar(32)) AS TABLE_NAME, cast
(RDB$INDEX_NAME as varchar(32)) AS INDEX_NAME, RDB$STATISTICS from
rdb$indices WHERE sNullIf( cast( rdb$system_flag as VARCHAR(32) ), 
cast( 0 as VARCHAR(32) ) ) = 0 order by RDB$STATISTICS

This sNullIf( cast( rdb$system_flag as VARCHAR(32) ),  cast( 0 as
VARCHAR(32) ) ) = 0  is calling my udf dll

code:
    setStatisticsStatement := 'SELECT cast (RDB$RELATION_NAME as
varchar(32)) AS TABLE_NAME, ' +
       'cast (RDB$INDEX_NAME as varchar(32)) AS INDEX_NAME, ' +
       'RDB$STATISTICS from rdb$indices ' +
       'WHERE sNullIf( cast( rdb$system_flag as VARCHAR(32) ),  cast( 0
as VARCHAR(32) ) ) = 0 order by RDB$STATISTICS';

    dmQuery.sqlSetStatistics.SQL.Text := setStatisticsStatement;
    dmQuery.sqlSetStatistics.ExecQuery;
*dmQuery.trxIndices.Commit;
<*************************************************
    dmQuery.trxIndices.Active := false;

When I click prepare in SQL, no errors.

No result in SQL from execute.


2 error messages from execute after prepare Ok. Had to shut down with
task manager. Transaction active. I issue commit and it won't shut the
process down.





Interesting last message. Perhaps commit while long process executing?

Stepping through code now. A long process.

Any insight based on error messages appreciated.

Robert




[Non-text portions of this message have been removed]