How to use variables in sap hana?
Variables are containers which are mainly used in programming structure elements such functions, procedure and anonymous blocks. There is a good list of different variable types you can choose from: Character String, Numeric, Date Time, Large Objects. There is also a specific variable: The user session Variable. All variables are declared explicitly either with the command SET or DECLARE. The best practice would be to create all variables at the beginning of a procedure.
There is one variable container exception which is not declared at all but which is defined directly with a complete query description assigned to it. It is a particular variable which is not a string variable and cannot be used as such. However, it is used as if it was a type of database view. In other word it is used for sql queries.
More about : Variable used as a database View
All about sap hana variables