Skip to Content
avatar image
Former Member

Variable decl. within a stored procedure that refers to a column using %TYPE

What is HANA equivalent for a variable declaration within a stored procedure that refers to a column within a table for its data type?

 

  v_variable TEST_TABLE.COLUMN1%type;

Thanks,

np

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Sep 17, 2013 at 04:06 PM

    Hi np,

    I don't think that you can define it like a column%type as such. You can have the scalar variables with data types explicitly defined or Table variable (can be based on single column table type) with table type declaration.

    Regards,

    Ravi

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 17, 2013 at 03:55 PM

    Use the below syntax: I am assuming that you are writing a stored procedure  or a script based calculation view. Lookup the data type of the source table since to the best of my knowledge you can not do type casting in HANA.

    DECLARE PARAMV NVARCHAR(20) := null;


    Hope this helps.

    Rama

    Add comment
    10|10000 characters needed characters exceeded