在使用sqlplus导出csv文件时,如果标题行中存在空格,可以使用以下方法解决:
SELECT column_name AS "First Name", other_column AS "Last Name"
FROM table_name;
SET COLSEP ','
SET HEADING ON
SET FEEDBACK OFF
SET PAGESIZE 0
SET LINESIZE 1000
SPOOL file_path.csv
SELECT column_name AS "First Name", other_column AS "Last Name"
FROM table_name;
SPOOL OFF
这样就可以确保标题行中的空格会被正确导出到csv文件中。