I'd recommend you read the SQLScript guide found at help.sap.com/hana_appliance
There you'll find details on usage of table variables, temporary tables, cursors, etc. Keep in mind that set-based processing is significantly faster than cursors, which should be avoided.