Skip to Content

Table variable in select query ?


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.


Pavneet Rana

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Sep 24, 2014 at 08:14 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.