簡介:
- PL/SQL是Oracle下的腳本開發語言,是爲了解決數據進行復雜處理而設計的。
- 在SQL語言的基礎之上添加了第三代語言的循環、分支等結構
- 使用PL/SQL可以帶來一定的好處,即效率的提高——–
pl/sql所含內容簡圖
pl/sql的內容簡圖:
一、塊
- 匿名塊
PL/SQL的匿名塊由四個部分組成
declare –可選 聲明各種變量或遊標的地方。
begin 必要 開始執行語句。
exception**可選** 出錯後的處理。
end; – 必要(請注意end後面的分號)
2、輸出helloworld
dbms_output.put_line(‘helloworld’);
dbms_output.put(‘helloworld’);
dbms_output.new_line();
3、打開輸出端 –>僅針對 當前窗口有效
set serveroutput on;
set serveroutput off;
4、6、清屏 clear screen
cl cle
5、註釋
–單行註釋語句用兩個連在一起的‘-’表示。
/*多行註釋語句,
可以換行*/
實例小demo
begin
dbms_output.put_line('helloworld');
end;
輸出結果:helloworld