Quantcast
Channel: SCN : Discussion List - SAP HANA and In-Memory Computing
Viewing all articles
Browse latest Browse all 5653

Getting variable back in SQL script when reading from table

$
0
0

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

 

 

 

 


Viewing all articles
Browse latest Browse all 5653

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>