How to avoid special characters in column names?
September 21st, 2006 By madan30
I am taking input from some CSV file to create a table and its data. The column names are also created from the CSV file. However, The column names have some characters like %,-,$,() etc … resulting in an error during table creation.
How can I filter out these special characters from the column names?

September 21st, 2006 at 2:57 pm
You do not need to filter out special characters as long as you wrap your column names with qutation marks:
SQL> CREATE TABLE t 2 ("this%is,so-,cool$,man()" VARCHAR2(10), 3 "This@#is^~even+&cooler" NUMBER) 4 / Table created. SQL> INSERT INTO t VALUES ('A', 1) 2 / 1 row created. SQL> INSERT INTO t VALUES ('B', 2) 2 / 1 row created. SQL> SELECT * FROM t 2 / this%is,so This@#is^~even+&cooler ---------- ---------------------- A 1 B 2If you still want to remove these special characters, two SQL functions may come in handy: TRANSLATE and REPLACE.