Description
In SQL Navigator, there is no option to generate insert statements with an option to exclude "NULL" columns.
Eg: A Table scenario
Empno Ename SAL Comm
101 Andrew 2000
102 Bruce 2001 10
103 David 2002
104 Keith 2003 20
In Toad go to Schema Browser, Select A Table and on RHS Data Tab right-click and choose Create Insert for all rows, then check exclude Null Columns.
The output of insert statements is as follows:
INSERT INTO E1 ( EMPNO, ENAME, SAL ) VALUES ( 1, 'Andrew', 2000);
INSERT INTO E1 ( EMPNO, ENAME, SAL, COMM ) VALUES ( 2, 'Bruce', 2001, 10);
INSERT INTO E1 ( EMPNO, ENAME, SAL ) VALUES ( 3, 'David', 2002);
INSERT INTO E1 ( EMPNO, ENAME, SAL, COMM ) VALUES ( 4, 'Keith', 2003, 20);
COMMIT;
In SQL Navigator | Insert statments can be generated using the export option but how can we exclude null columns.
INSERT INTO &&table_name (EMPNO,ENAME,SAL,COMM)VALUES (1,'Andrew',2000,NULL)
INSERT INTO &&table_name (EMPNO,ENAME,SAL,COMM) VALUES (2,'Bruce',2001,10)
INSERT INTO &&table_name (EMPNO,ENAME,SAL,COMM) VALUES (3,'David',2002,NULL)
INSERT INTO &&table_name (EMPNO,ENAME,SAL,COMM) VALUES (4,'Keith',2003,20)