cancel
Showing results for 
Search instead for 
Did you mean: 

Table variable in select query ?

pavneet_rana
Active Participant
0 Kudos

Hi,

I am new to HANA, and trying to learn on table variable.

What i know table variable is table type, used in procedure and select statement.

So i create a table type for table variable ( VIEW_OUTPUT ) and Calculation view (CALV_2).

and in SQL script editor i written a code to populate VIEW_OUTPUT.

VIEW_OUTPUT = SELECT * FROM "_SYS_BIC". "Calculation_Views/CALV_2" ;

But i gives error.

Could not execute VIEW_OUTPUT = SELECT * FROM "_SYS_BIC". "Calculation_Views/CALV_2"' in 234 ms 95 µs .

SAP DBTech JDBC: [257]: sql syntax error: incorrect syntax near "VIEW_OUTPUT": line 1 col 1 (at pos 1) .



please correct me if, I have understood the table variable and does, I am using it in correct way.

or this can be used only in procedure only.

Regards

Pavneet Rana

Accepted Solutions (1)

Accepted Solutions (1)

lbreddemann
Active Contributor
0 Kudos

The problem here is that the SQL editor is not a SQLScript execution console.

It's not possible to execute  single SQLScript blocks in the console.

You always have to call the procedure the block is embedded in.

- Lars

Answers (0)