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

Re: In Hana SQL Script, can I insert records into an already existing table variable?

$
0
0

I was thinking a similar thing as Jody. If the general requirement is that you need to insert contents from two tables into one target table just for intermediate processing, then it can be assumed that you can make the sources identical to the target.

 

This sounds like a perfect use case for a union, since you really are just trying to combine these together, no real need to "insert" so to speak.

 

temp_table = SELECT <COLUMNS> FROM <TABLE1>

UNION

SELECT <COLUMNS> FROM <TABLE2>

 

Or this can likely be achieved in another way using multiple variables,

a  = SELECT <COLUMNS> FROM <TABLE1>;
b = SELECT <COLUMNS> FROM <TABLE2>;

c = SELECT * FROM :a UNION SELECT * from :b;

 

Have not tested the above syntax as I'm not in front of a system, but seems logical.

 

Regards,

Justin


Viewing all articles
Browse latest Browse all 8065

Trending Articles



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