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

Work with a table in different schema depending on the user group

$
0
0

I have 2 groups of users user_group1, user_group2 and also two different schemas schema_group1,schema_group2 containing the same table names with a different content.

 

Now, i have to write a stored procedure which takes user name as input and depending on which group the user belongs to, i want to work with table in that user_group schema.  i.e.(if user_group1 then "schema_group1"."table". if user_group2 then "schema_group2"."table" )

 

i tried to set schema using dynamic sql but it seems that the schema is changing only after the end of the stored procedure.


Viewing all articles
Browse latest Browse all 6412

Trending Articles



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