1
FOR k in c2 LOOP
         l_sql := 'ALTER TABLE :TABLE_NAME DISABLE CONSTRAINT 
                  :CONSTRAINT_NAME CASCADE';
         l_sql :='INSERT INTO TMP_CONSTRAINT (TABLE_NAME,CONSTRAINT_NAME) 
                  VALUES ('':TABLE_NAME'', '':CONSTRAINT_NAME'')';
         EXECUTE IMMEDIATE l_sql USING k.TABLE_NAME, k.CONSTRAINT_NAME;
END LOOP;

Above dynamic SQL to take the variable from a cursor and disable constraint accordingly and insert record to a temp table. I am getting error "bind variable does not exist" in the update statement.

user2102665
  • 429
  • 2
  • 11
  • 26

1 Answers1

0

It is actually caused by the single code in INSERT

Corrected as per following:

l_sql :='INSERT INTO TMP_ENABLED_CONSTRAINT (TABLE_NAME,CONSTRAINT_NAME) VALUES (:TABLE_NAME ,:CONSTRAINT_NAME)';

user2102665
  • 429
  • 2
  • 11
  • 26