從在Linux上安裝Oracle到投入使用才幾天,碰到的問題就成百上千的。在使用用戶端串連遠程Oracle資料庫伺服器時,出現了listener refused the connection with the following error ora-12519 Listener refused the connection with the following error:ORA-12519, TNS:no appropriate service handler foundThe
表資料;MENU_IDIS_TREE0001100021010120102 0103 0201502026 --------------使用decode函數select b.menu_id,decode(b.is_tree,'1','1vv','2','2vv',null,'isnullvalue','defaultvaluehehe') tree from menutree b--------------使用case when then else達到相同效果select
自訂此函數是由於“wmsys.wm_concat”在10G中不穩定。現已寫成自己定義的函數,功能與用法和“wmsys.wm_concat”函數一樣。趕緊貼出了給大夥看看。備忘: 這是從開源網轉載而來的源碼,經過本人的多次驗證和實際運用此函數可行。 create or replace TYPE zh_concat_im AUTHID CURRENT_USER AS OBJECT( CURR_STR VARCHAR2(32767), STATIC FUNCTION
在初始化資料庫資料時,遇到了插入特殊字元‘&’的問題,例如有一菜單表:id,name,url。插入資料:insert into MENU values('1','產品類型','/productType.do?method=list&type=01');由於有特殊字元&,故toad報錯:提示請輸入TYPEPCODE原因是:沒關掉逸出字元開關,預設是開啟set define off ;然後插入:insert into MENU
6.CURSOR 申明 無參數申明:CURSOR CUR_NAME IS SELECT COL1,COL2,... FROM ... WHERE ...; 帶參數申明:CURSOR CUR_NAME(PARAM1 DATA_TYPE,PARAM2 DATA_TYPE,...) IS SELECT COL1,COL2,... FROM ... WHERE ...;7.用FOR IN使用CURSOR FOR CUR_RS IN CUR_NAME LOOP BEGIN
drop table test;select count(*) from test;--建立測試表create table test(id number(9),nick varchar2(30));--插入測試資料begin for i in 1..100000 loop insert into test(id) values(i); end loop; commit;end;select * from test;--更新nick欄位,使資料發生嚴重傾斜update