I create the same SQL script, which must count number of records in my table. I'm using dynamic sql. For example:
... declare @myTableName string; declare @query sqtring; @myTableName = 'table_1'; @query = 'select count(*) from ' + @myTableName; executive immediate(@query); ...
This query running good, but I don't know how can I get result from:
executive immediate(@query);
I tried to find answer on the Internet, but I does not find answer.
May be anybody know answer on my question?
Thank.
Using a temporary table, this can be done like this: