游標的使用之一 儲存當前的結果集

2021-05-23 16:44:09 字數 635 閱讀 5991

這裡的游標用於儲存結果集

,以備後用

declare

pi constant

number(9

,7):=

3.1415927;

area

number(14

,2);

cursor

rad_cursor is

select

* from

whms_type

wt wherewt.

whms_type_id=8

; rad_val rad_cursor%

rowtype;

begin

open

rad_cursor;

fetch

rad_cursor

into

rad_val;

area

:=pi*

power(

rad_val

.whms_type_name,2

); insert

into

youjian

values(1,

area);

close

rad_cursor;

end; /

乙個儲存過程 游標迴圈結果集

在查詢表名使用變數時只能使用concat 拼接 哭哭哭。drop procedure ifexists proc tmp create procedure proc tmp begin declare done intdefault 0 declare tablename varchar 255 d...

SQL Plus的簡單使用之一

oracle在oracle 8.0.5之前都是使用字元介面來進行資料庫的操作與管理的。而那時候其他最重要的工具就是sql plus,它既可以編輯sql語句,也可以編輯和除錯pl sql的程式。下面我一步一步的來學習sql plus的基本使用 一 啟動sql plus 在unix linux系統下首先...

SQL Plus的簡單使用之一

oracle在oracle 8.0.5之前都是使用字元介面來進行資料庫的操作與管理的。而那時候其他最重要的工具就是sql plus,它既可以編輯sql語句,也可以編輯和除錯pl sql的程式。下面我一步一步的來學習sql plus的基本使用 一 啟動sql plus 在unix linux系統下首先...