Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

How to use a variable as a select for Columns

$
0
0

Hi,

we are students and currently trying to execute a procedure which involves using a variable to select a specific column out of a given table. We use the variable "table_name" to store the String value for the column that we need to select. The code is as following:

 

CREATEPROCEDURE "MY_DIRECTORY"."test_procedure" (IN table_name NVARCHAR(30))

LANGUAGE SQLSCRIPT AS

BEGIN

     DECLARE temp DOUBLE := 0;

.......

  

        SELECT :table_name INTO temp FROM "MY_DIRECTORY"."test" WHERE"DATUM" = '2015-03-02 00:31:00';

  

.......

 

END;


call"MY_DIRECTORY"."test_procedure" ('VSA191_D1_T1_ZAEHL');



Is there any chance that this code is executable by useing a workaround? We would be very glad for your support.


Kai



Viewing all articles
Browse latest Browse all 6412

Trending Articles



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