Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9024

Re: dynamic sql for select statement in procedure

$
0
0

Hi Mike,

 

As Adira mentions we need to use "EXEC" to execute the "SELECT" statement formed dynamically.

But my points here,

 

1) You may not want to insert ( operation takes some time) into "Temporary" table and then get the results.

2) Also it occupies more space (more memory consumed)

3) Possibility of locking when multiple users try to call this procedure ( this point is my view as per experience on other databases would love to have SCN experts here to comment on the point if they see this)

 

Hence based on logic ( like the way you are filtering , joining and aggregation takes place) i would rather suggest you to use EXEC IMMEDIATE approach ( which also gives flexibility to get dynamic output) as mentioned in one of the blogs i have written below:

 

SAP HANA: Handling Dynamic Select Column List and Multiple values in input parameter

 

Do check and let me know.

 

Regards,

Krishna Tangudu


Viewing all articles
Browse latest Browse all 9024

Trending Articles



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