Currently, I am indexing column by column with the following code snippet:
DECLARE
already_exists EXCEPTION;
columns_indexed EXCEPTION;
PRAGMA EXCEPTION_INIT ( already_exists, -955 );
PRAGMA EXCEPTION_INIT (columns_indexed, -1408);
BEGIN
EXECUTE IMMEDIATE 'Create Index TABLE_A_COLUMN_A on TABLE_A(COLUMN_A)';
EXCEPTION
WHEN already_exists or columns_indexed
THEN
NULL;
END;
Is it possible to replace COLUMN_A in this code
a) with a list reference and iterate through it dynamically?
declare @myList varchar(100)
set @myList = 'COLUMN_A,COLUMN_B,COLUMN_C'
b) and make sure the loop keeps looping even when it encounters an issue with one column? In other words, not the whole loop should fail if there is an issue with one of the columns