Skip to Content
Feb 20, 2014 at 09:09 PM

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


I am in need of help here, if somebody wouldn't mind taking the time. If I have a Hana SQL Script procedure that inserts into a table variable, for example:

myTableVariable = select * from <dbTable>;

...Can I insert into :myTableVariable later on in the SQL Script? For example:

insert into :myTableVariable (<field_list>) select * from <dbTable2>;

The end result would be records from <dbTable2> appended to records from <dbTable> inside :myTableVariable.

I know I can create a temp table to achieve this, but if I want my Hana SQL Script to be "read-only", then I can't create temp tables (at least, as far as I know.)

Thanks for any help you can provide!