看我的SPOOL,也可以哦. create table TEST ( Account VARCHAR2(20) not null,-- 帐号 BillingDate DATE not null,-- 结算日期 PIN CHAR(32), -- 个人身份识别码 Amount NUMBER(10), -- 发生金额 Balance NUMBER(10), -- 余额 constraint TEST_PK primary key (Account, BillingDate) ) / 你也试试 spool dataTest.txt set heading off set linesize 90 set pagesize 0 set feedback off select Account||','||fts(BillingDate)||','||PIN||','||Amount||','||Balance from test ; spool off exit; ------------其中fts为--------- --fts format timestamp 统计用 CREATE OR REPLACE FUNCTION fts(v_date date) return CHAR IS begin return to_char(v_date,'yyyy-mm-dd hh24:mi:ss'); end fts; /
图形化选表界面,直接导成excel,方便。用TOAD也不错,不要说没用过,用用就
知道了。下一个回去试试吧。
create table TEST (
Account VARCHAR2(20) not null,-- 帐号
BillingDate DATE not null,-- 结算日期
PIN CHAR(32), -- 个人身份识别码
Amount NUMBER(10), -- 发生金额
Balance NUMBER(10), -- 余额
constraint TEST_PK primary key (Account, BillingDate)
)
/
你也试试
spool dataTest.txt
set heading off
set linesize 90
set pagesize 0
set feedback off
select Account||','||fts(BillingDate)||','||PIN||','||Amount||','||Balance
from test ;
spool off
exit;
------------其中fts为---------
--fts format timestamp 统计用
CREATE OR REPLACE FUNCTION fts(v_date date)
return CHAR IS
begin
return to_char(v_date,'yyyy-mm-dd hh24:mi:ss');
end fts;
/