zoukankan      html  css  js  c++  java
  • 使用批处理文件访问ORACLE数据库

    新建txt文件编写代码:

    sqlplus c##scott/tiger @runsql.sql

    用户名c##scott

    密码tiger

    将文件后缀改为.bat

    新建txt文件编写,文件名为runsql

    编写代码

    1 conn c##scott/tiger
    2 --写你的sql语句
    3 select * from (select * from dept order by rownum) where rownum<2;
    4 commit;
    5 pause;
    6 exit;

    将文件名改为runsql.sql

    执行.bat文件即可

    如果需要将结果输出到文本文件的话,利用spool缓冲池

    1 conn c##scott/tiger
    2 spool d:output.txt
    3 select * from (select * from dept order by rownum) where rownum<2;
    4 commit;
    5 spool off;
    6 pause;
    7 exit;

     spool d:output.txt 指定输出的路径和文件

    最后输入缓冲结果命令

    spool off; 

  • 相关阅读:
    JS 按钮下一步(onclick点击事件)
    socketserver模块
    进程
    僵尸进程和孤儿进程
    守护进程
    互斥锁
    进程间通信=>IPC机制
    生产者消费者模型
    线程
    守护线程
  • 原文地址:https://www.cnblogs.com/winterbear/p/10148726.html
Copyright © 2011-2022 走看看