• Just wonderful ! Thanks a lot !

    Oh, just one suggestion: if, let's say, column not found, then cursor is not deallocated and script fails next time you try to run it. I would probably take "DEALLOCATE cur_constraints" out of IF/ELSE block.