在遊標FOR迴圈中使用查詢 在遊標FOR迴圈中可以定義查詢,由於沒有顯式聲明所以遊標沒有名字,記錄名通過遊標查詢來定義。 DECALRE v_tot_salary EMP.SALARY%TYPE; BEGIN FOR r_dept IN (SELECT deptno,dname FROM dept ORDER BY deptno) LOOP DBMS_OUTPUT.PUT_LINE('Department:'|| r_dept.deptno||'-'||r_dept.dname);
癥狀:安裝oracle 10g 的時候 網路檢測沒有通過,沒有處理就繼續安裝了,ip地址也沒有制定,後來給機器修改了IPoracleDBConsole就不能啟動了,系統開機記錄查看:Agent process exited abnormally during initialization。 無法啟動oracleDBConsole的解決方案之一 癥狀:原來正常,後來給機器加了DNS尾碼就不能啟動了,系統啟動時報錯:Agent process exited abnormally
需求,經過一個操作(審核操作),然後把合格表A中的兩個欄位批量插入到表B中。在插入這兩個欄位的同時,還需要通過一個函數自動產生一個id,還有一個固定值(“ABC”)。實現:--隨機產生10道判斷題插入資料庫insert into exam_topictemp(id,topicId,topictype,projectid)select * from (SELECT newbosid('12345678'),topic_id,topic_type,'projectId' FROM
初始化相關參數job_queue_processesalter system set job_queue_processes=39 scope=spfile;//最大值不能超過1000 ;job_queue_interval = 10 //調度作業重新整理頻率秒為單位job_queue_process 表示oracle能夠並發的job的數量,可以通過語句 show parameter
Specify scale for NUMBERsMany developers do not specify a precision for NUMBER columns. This may be in order to minimize the work that would be needed to increase that precision should the application's requirements change, but it is often just a
今天發現在oracle中的select語句可以用START WITH...CONNECT BY PRIOR子句實現遞迴查詢,connect by 是結構化查詢中用到的,其基本文法是: select ... from tablename start with cond1 connect by cond2 where cond3; 簡單說來是將一個樹狀結構儲存在一張表裡,比如一個表中存在兩個欄位: id,parentid那麼通過表示每一條記錄的parent是誰,就可以形成一個樹狀結構。
1. declarecursor t1 is select * from tablename;beginfor rec in t1 loopupdate tablename t set t.detail=rec.jieshao where t.objectid=rec.objid;end loop;end; 2.update student set (name,id )= (select name ,id from (select