Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DECLARE v_column_exists NUMBER := 0;
- BEGIN
- SELECT COUNT(*) INTO v_column_exists FROM all_tab_cols WHERE column_name = 'columnName' AND TABLE_NAME = 'PGBORDEREAU';
- IF (v_column_exists = 0) THEN EXECUTE IMMEDIATE 'your sql to add a column';
- END IF;
- END;
- /
- e.g.
- DECLARE v_column_exists NUMBER := 0;
- BEGIN
- SELECT COUNT(*) INTO v_column_exists FROM all_tab_cols WHERE column_name = 'EMPCODE ' AND TABLE_NAME = 'EMPLOYEE ';
- IF (v_column_exists = 0) THEN EXECUTE IMMEDIATE 'ALTER TABLE EMPLOYEE ADD EMPCODE NUMBER(5) DEFAULT 0';
- END IF;
- END;
- /
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement