Change all table unload priority in hana

Change all table priority for unload in short time.

create procedure update_unload_priority() LANGUAGE SQLSCRIPT AS
CURSOR C_TABLE
FOR SELECT 'ALTER TABLE "' || TABLE_NAME || '" UNLOAD PRIORITY 9;' AS SQLTEXT
FROM SYS.TABLES
WHERE SCHEMA_NAME = 'MYSCHEMA' AND TABLE_TYPE = 'COLUMN' and temporary_table_type = 'NONE' AND unload_priority <> 9;
BEGIN
OPEN C_TABLE;
FOR cur_row AS C_TABLE DO
EXEC cur_row.SQLTEXT;
END FOR;
END;

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.