Hello,
in an SQL script procedure I want to do a select count(*) to get the number of table records.
The table name (with schema name) shall be a variable.
I tried to options, both failed:
Option 1: Within SQL script:
select count(*) into lv_number from table_name.
Here the problem is the table name. The system responds with "scalar types not allowed":
Option 2: Embedded SQL:
exec 'select count(*) as :lv_number" from " '|| :cachetable_name || ' "' ;
Here the problem is that the SQL-Script variable lv_number' is not filled from the embedded SQL.
Any ideas?
Thanks in advance, Christoph