I am inside a SQLScript procedure and would like to return the last SQL Statement from this procedure, like the last rowcount
:
/********* Begin Procedure Script ************/
BEGIN
select 1 as "my_data" from dummy;
select '::last_SQL' as "last executed sql" from dummy;
select ::ROWCOUNT as "rowcount" from dummy;
END;
/********* End Procedure Script ************/
The column "last executed SQL" should be populated with select 1 as "my_data" from dummy
in this case. Is there any variable holding the last statement (or any easy way to retrieve the query plan)?