【发布时间】:2013-12-30 04:53:14
【问题描述】:
我正在使用脚本在 sqlplus 中进行查询,但是当我尝试导出到文件时遇到问题 我的 sqlplus 中有这个:
spool hits.csv
SET NEWPAGE NONE
SET PAGESIZE 0
SET SPACE 0
SET LINESIZE 100
SET ECHO OFF
SET FEEDBACK OFF
SET VERIFY OFF
SET HEADING OFF
SET MARKUP HTML OFF SPOOL OFF
SET TERMOUT OFF
SET TRIMOUT ON
SET TRIMSPOOL ON
SET COLSEP |
arraysize 15
set wrap off
select camp1, camp2, camp3, camp4 from table
spool off
但是当我读取文件时,类似于(截断我的查询的两列):
rows will be truncated
rows will be truncated
20131209|name12
20131209|name12
20131209|name12
20131209|name12
20131209|name12
20131209|name12
然后我增加线条大小,但如果我增加线条大小,请显示如下内容:
20131209|name12
|1
| 86
20131209|name12
|5
| 1
20131209|name12
|2
| 9
20131209|name12
|3
| 5
20131209|name12
|6
| 1
我需要类似的东西:
20131209|name12|1|86
20131209|name12|5|1
20131209|name12|2|9
20131209|name12|3|5
20131209|name12|6|1
我阅读了但在所有页面中都使用相同的标题,并且我的文件有很多行,我只需要我的文件的一行中的查询行。
当我说全部展示给我看时:
arraysize 150
autocommit OFF
autoprint OFF
autorecovery OFF
autotrace OFF
blockterminator "." (hex 2e)
btitle OFF and is the first few characters of the next SELECT statement
cmdsep OFF
colsep "|"
compatibility version NATIVE
concat "." (hex 2e)
copycommit 0
COPYTYPECHECK is ON
define "&" (hex 26)
describe DEPTH 1 LINENUM OFF INDENT ON
echo OFF
editfile "afiedt.buf"
embedded OFF
escape OFF
escchar OFF
feedback OFF
flagger OFF
flush ON
heading OFF
headsep "|" (hex 7c)
instance "local"
linesize 1500
lno 0
loboffset 1
logsource ""
long 80
longchunksize 80
markup HTML OFF HEAD "<style type='text/css'> body {font:10pt Arial,Helvetica,sans-serif; color:black; background:White;} p {font:10pt Arial,Helvetica,sans-serif; color:black; background:White;} table,tr,td {font:10pt Arial,Helvetica,sans-serif; color:Black; background:#f7f7e7; padding:0px 0px 0px 0px; margin:0px 0px 0px 0px;} th {font:bold 10pt Arial,Helvetica,sans-serif; color:#336699; background:#cccc99; padding:0px 0px 0px 0px;} h1 {font:16pt Arial,Helvetica,Geneva,sans-serif; color:#336699; background-color:White; border-bottom:1px solid #cccc99; margin-top:0pt; margin-bottom:0pt; padding:0px 0px 0px 0px;-
} h2 {font:bold 10pt Arial,Helvetica,Geneva,sans-serif; color:#336699; background- color:White; margin-top:4pt; margin-bottom:0pt;} a {font:9pt Arial,Helvetica,sans-serif; color:#663300; background:#ffffff; margin-top:0pt; margin-bottom:0pt; vertical-align:top;} </style><title>SQL*Plus Report</title>" BODY "" TABLE "border='1' width='90%' align='center' summary='Script output'" SPOOL OFF ENTMAP ON PREFORMAT OFF
newpage NONE
null ""
numformat ""
numwidth 10
pagesize 0
PAUSE is OFF
pno 0
recsep WRAP
recsepchar " " (hex 20)
release 1002000500
repfooter OFF and is NULL
repheader OFF and is NULL
serveroutput OFF
shiftinout INVISIBLE
showmode OFF
spool ON
sqlblanklines OFF
sqlcase MIXED
sqlcode 0
sqlcontinue "> "
sqlnumber ON
sqlpluscompatibility 10.2.0
sqlprefix "#" (hex 23)
sqlprompt "SQL> "
sqlterminator ";" (hex 3b)
suffix "sql"
tab ON
termout OFF
timing OFF
trimout ON
trimspool ON
ttitle OFF and is the first few characters of the next SELECT statement
underline "-" (hex 2d)
USER is "DMSADMIN"
verify OFF
wrap : lines will be truncated
【问题讨论】:
标签: sql database oracle sqlplus