oracle在能不能在sql plus之类的地方导出数据?我需要到处到一个文件中,以csv的形式。类似于export to C:\1.csv select * from table_A
有没有呢?
有没有呢?
解决方案 »
- 初学着,请指教!!!
- delphi向oracle里导数据提示ORA-01401:inserted value too large for columm
- oracle备份问题
- ODBC连接ORACLE出错
- 全文检索的问题,急!!!!!
- 数据库的问题
- 请教各位大侠,在程序中联接 oralce 数据库执行一些SQL语句,程序无返回值,一直在执行?
- 紧急提问:我的小型机死机了,怎么样关闭安全的关闭数据库,在重新启动小型机?在线...
- 我执行一个存储过程,提示:ORA-01006: 赋值变量不存在.详细在内,请指教,谢谢!
- 求助一个多列转一列多行的问题!
- create directory 后,如何删除是DELETE directory吗?
- mysql数据库迁移到oracle数据时,表名及字段修改
set heading off
set termout off
set feedback off
set pagesize 0
set trimsout on
set trimspool on
spool sr.csv
select t.srtypeid||','||to_char(t.accepttime,'yyyy-mm-dd hh24:mi:ss')||','||t.subsnumber||','||t.calledno from t_sr_servicerequest t where t.serviceid between '080225' and '080301';
spool off
set heading off
set termout off
set feedback off
set pagesize 0
set trimsout on
set trimspool on
spool test.csv
select col_a||','||to_char(t.mydate,'yyyy-mm-dd hh24:mi:ss')||','||t.col_b from t_sr_servicerequest t where t.mydate between '080225' and '080301';
spool off
--这个脚本就行了(你也可以保存为一个c:\test.sql,然后在sqlplus下:@c:\test.sql)
spool off
set heading off
set termout off
set feedback off
set pagesize 0
set trimsout on
set trimspool on
spool test.csv
select col_a||','||to_char(t.mydate,'yyyy-mm-dd hh24:mi:ss')||','||t.col_b
from your_table t where t.mydate between '080225' and '080301';
spool off
spool C:\1.csvselect * from table_Aspool off
if mycursor%found then outyanzheng:=1;
mycursor%found=true 这样都可以SQL> ed
已写入 file afiedt.buf 1 declare
2 v_COL1 number;
3 cursor c1 is select COL1 from test1;
4 num number:=0;
5 begin
6 open c1;
7 fetch c1 into v_COL1;
8 if c1%found=true then
9 num:=1;
10 end if;
11 dbms_output.put_line(num);
12* end;
SQL> /
1PL/SQL 过程已成功完成。
SQL> ed
已写入 file afiedt.buf 1 declare
2 v_COL1 number;
3 cursor c1 is select COL1 from test1;
4 num number:=0;
5 begin
6 open c1;
7 fetch c1 into v_COL1;
8 if c1%found then
9 num:=1;
10 end if;
11 dbms_output.put_line(num);
12* end;
SQL> /
1PL/SQL 过程已成功完成。
他返回不是 true or false两个值