用脚本调用Oracle存储过程
先准备好一个sql脚本demo.sql set serveroutput ondeclarev_name dept.dname%type;beginselect dname into v_name from dept whe
先准备好一个sql脚本demo.sql
set serveroutput on
declare
v_name dept.dname%type;
begin
select dname into v_name from dept where deptno=&1;
dbms_output.put_line('department name is: '||v_name);
end;
/
exit;
然后在终端下执行:
sqlplus "scott/tiger@orcl" @demo.sql 20
返回:
SQL*Plus: Release 9.2.0.4.0 - Production on Thu Oct 17 21:37:28 2013
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production
old 4: select dname into v_name from dept where deptno=&1;
new 4: select dname into v_name from dept where deptno=20;
department name is: RESEARCH
PL/SQL procedure successfully completed.
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production
注意:我们可以给脚本传参数,,在脚本中用&1,&2这样的参数
本文永久更新链接地址:

熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

AI Hentai Generator
免費產生 AI 無盡。

熱門文章

熱工具

記事本++7.3.1
好用且免費的程式碼編輯器

SublimeText3漢化版
中文版,非常好用

禪工作室 13.0.1
強大的PHP整合開發環境

Dreamweaver CS6
視覺化網頁開發工具

SublimeText3 Mac版
神級程式碼編輯軟體(SublimeText3)