/* 預存程序 參數類型: in 表示入參 out 表示出參 in out 表示既是入參又是出參 預設情況下是入參 注意: 預存程序的參數資料類型不需要指定精度 */ create or replace procedure pro_myjob(title in varchar2) is var_mytitle jobs.job_title%type; begin select j.job_title into var_mytitle from jobs j where
Oracle的分頁查詢語句基本上可以按照本文給出的格式來進行套用。 分頁語句: SELECT * FROM ( SELECT A.*, ROWNUM RN FROM (SELECT * FROM TABLE_NAME) A WHERE ROWNUM <= 40 ) WHERE RN >= 21[/color]其中最內層的查詢SELECT * FROM TABLE_NAME表示不進行翻頁的原始查詢語句。ROWNUM <= 40和RN >= 21控制分頁查詢的每頁的範圍。
select * from employees emp where emp.salary = 3000 if語句 begin if (10>50) then dbms_output.put_line('da yu'); else dbms_output.put_line('bu da yu'); end if; end; select * from employees emp where emp.employee_id=119 where
在以前的一篇文章中,介紹過額外的關聯對SQL的影響是很大的,所以在sql審核的工作中,對於表關聯的關注是相當多的,如果冗餘能夠最佳化掉表關聯,偶都盡量在表設計上做些冗餘處理;在10gR2中,發現最佳化器可以最佳化掉一些不必要的關聯…… 9206: SQL> set autot on SQL> select count(*) 2 from dept d, emp e 3 where d.deptno = e.deptno; COUNT(*) ---------- 1
好長時間沒怎麼看 Oracle 技術文檔了,今天閱讀了一篇 Oracle Response Time Optimization with Method R. 這是 Optimizing Oracle Performance 經典圖書這本經典圖書的主旨方法。R 代表回應時間(response time).具體的定義如下: 1. Target the tasks that are critical to the business. 2. Collect properly
資料區塊 In an Oracle database, the block is the smallest unit of data file I/O and the smallest unit of space that can be allocated. An Oracle block consists of one or morecontiguous operating system blocks.標準塊大小在建立資料庫時使用DB_BLOCK_SIZE參數設定;除非重新建立該資料庫,
SELECT * FROM session_privs這個在sqlplus裡可以查看目前使用者所有許可權,查看是否是dbaselect userenv('isdba') from dual;查看當前schema和user:select sys_context('userenv','current_user') as current_userfrom dual;select sys_context('userenv','current_schema') as