一,Plsql 調試預存程序:1、在oracle的 配置和移植工具 àNET MANAGER中配置串連2、在plsql中建立SQL視窗,編寫預存程序3、在plsql中建立測試視窗,在beginend之間調用執行個體:-- Created on 2012-4-28 by ADMINISTRATOR declare -- Local variables here v varchar2(123); va varchar2(234);begin -- Test statements here
1)檢查oracle系統暫存資料表空間大小:select sum(bytes)/1024/1024 "temp size(M)" from dba_temp_files where tablespace_name='TEMP'; 2)查詢undo資料表空間大小select sum(bytes)/1024/1024 "current undo size(M)" from dba_data_files where
以下為9i中實現的過程declare type t_rn is table of tmp.rn%type index by binary_integer; type t_ran is table of tmp.num%type index by binary_integer; rn t_rn; ran t_ran; cursor cur_num is select rownum, trunc(dbms_random.value,2) * 100 from dual
dual是一個虛擬表,用來構成select的文法規則,oracle保證dual裡面永遠只有一條記錄。我們可以用它來做很多事情,如下:1、查看目前使用者,可以在 SQL Plus中執行下面語句select user from dual;2、用來調用系統函數select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') from dual;--獲得當前系統時間select SYS_CONTEXT('USERENV','TERMINAL') from
在PL/SQL TEST視窗-- Created on 2005-7-3 by TANGTIAN declare -- Local variables here i integer;leftpad varchar(11);rightpad varchar(14);begin -- Test statements hereSELECT LPAD('Hello!',8,'tangtian '),RPAD('Hello!',8,'tang ')into leftpad,rightpad
1.分組求最 select xx.qssj from(select cm.persionid,cm.qssj,row_number() over(partition by cm.persionid order by cm.scrq desc) as rn from RS_RSK_CONTRACT_MANAGE cm where cm.bak_flag is null) xx where xx.persionid=a.id and xx.rn=1
Oracle提供了一個很有用的子句CHECK,它可以實現對資料的自動檢查。它的用法是在建立表結構時使用。如: Create table worker ( empno number(4) primary key, name varchar2(10), age number(2) CHECK(age between 18 and 65 ),