| 订阅 | 在线投稿
分享
 
 
当前位置: 王朝网络 >> oracle >> quan mian jie xi Oracle developer de yi chang chu li ji zhi
 

quan mian jie xi Oracle developer de yi chang chu li ji zhi

2008-08-19 06:50:59 编辑來源:互联网 评论
 
本文为【全面解析Oracle developer的异常处理机制】的拼音翻译版
  Oracle developer yi qi kuai su de shu ju chu li kai fa er wen ming , qi yi chang chu li ji zhi ye shi bi jiao wan shan , bu ke xiao qu 。
  1、 yi chang de you dian
  ru guo mei you yi chang , zai cheng xu zhong , ying dang jian cha mei ge ming ling de cheng gong huan shi shi bai , ru
  BEGIN
  SELECT ...
  -- check for ’no data found’ error
  SELECT ...
  -- check for ’no data found’ error
  SELECT ...
  -- check for ’no data found’ error
  zhe zhong shi xian de fang fa que dian zai yu cuo wu chu li mei you yu zheng chang chu li fen kai , ke du xing cha , shi yong yi chang , ke yi fang bian chu li cuo wu , er qie yi chang chu li cheng xu yu zheng chang de shi wu luo ji fen kai , ti gao le ke du xing , ru
  BEGIN
  SELECT ...
  SELECT ...
  SELECT ...
  ...
  EXCEPTION
  WHEN NO_DATA_FOUND THEN -- catches all ’no data found’ errors
  2、 yi chang de fen lei
  you liang zhong lei xing de yi chang , yi zhong wei nei bu yi chang , yi zhong wei yong hu zi ding yi yi chang , nei bu yi chang shi zhi xing qi jian fan hui dao PL/SQL kuai de ORACLE cuo wu huo you PL/SQL dai ma de mou cao zuo yin qi de cuo wu , ru chu shu wei ling huo nei cun yi chu de qing kuang 。 yong hu zi ding yi yi chang you kai fa zhe xian shi ding yi , zai PL/SQL kuai zhong chuan di xin xi yi kong zhi dui yu ying yong de cuo wu chu li 。
  mei dang PL/SQL wei bei le ORACLE yuan ze huo chao yue le xi tong yi lai de yuan ze jiu hui yin shi de chan sheng nei bu yi chang 。 yin wei mei ge ORACLE cuo wu dou you yi ge hao ma bing qie zai PL/SQL zhong yi chang tong guo ming zi chu li ,ORACLE ti gong le yu ding yi de nei bu yi chang 。 ru SELECT INTO yu ju bu fan hui xing shi chan sheng de ORACLE yi chang NO_DATA_FOUND。 dui yu yu ding yi yi chang , xian jiang zui chang yong de yi chang lie ju ru xia :
  exception oracle error sqlcode value condition
  no_data_found ora-01403 +100 select into yu ju mei you fu he tiao jian de ji lu fan hui
  too_mang_rows ora-01422 -1422 select into yu ju fu he tiao jian de ji lu you duo tiao fan hui
  dup_val_on_index ora-00001 -1 dui yu shu ju ku biao zhong de mou yi lie , gai lie yi jing bei xian zhi wei wei yi suo yin , cheng xu shi tu cun chu liang ge chong fu de zhi
  value_error ora-06502 -6502 zai zhuan huan zi fu lei xing , jie qu huo chang du shou xian shi , hui fa sheng gai yi chang , ru yi ge zi fu fen pei gei yi ge bian liang , er gai bian liang sheng ming de chang du bi gai zi fu duan , jiu hui yin fa gai yi chang
  storage_error ora-06500 -6500 nei cun yi chu
  zero_divide ora-01476 -1476 chu shu wei ling
  case_not_found ora-06592 -6530 dui yu xuan ze case yu ju , mei you yu zhi xiang pi pei de tiao jian , tong shi , ye mei you else yu ju bu huo qi ta de tiao jian
  cursor_already_open ora-06511 -6511 cheng xu shi tu da kai yi ge yi jing da kai de you biao
  timeout_on_resource ora-00051 -51 xi tong zai deng dai mou yi zi yuan , shi jian chao shi
  ru guo yao chu li wei ming ming de nei bu yi chang , bi xu shi yong OTHERS yi chang chu li qi huo PRAGMA EXCEPTION_INIT 。PRAGMA you bian yi qi kong zhi , huo zhe shi dui yu bian yi qi de zhu shi 。PRAGMA zai bian yi shi chu li , er bu shi zai yun xing shi chu li 。EXCEPTION_INIT gao su bian yi qi jiang yi chang ming yu ORACLE cuo wu ma jie he qi lai , zhe yang ke yi tong guo ming zi yin yong ren yi de nei bu yi chang , bing qie ke yi tong guo ming zi wei yi chang bian xie yi shi dang de yi chang chu li qi 。
  zai zi cheng xu zhong shi yong EXCEPTION_INIT de yu fa ru xia :
  PRAGMA EXCEPTION_INIT(exception_name, -Oracle_error_number);
  zai gai yu fa zhong , yi chang ming shi sheng ming de yi chang , xia li shi qi yong fa :
  DECLARE
  deadlock_detected EXCEPTION;
  PRAGMA EXCEPTION_INIT(deadlock_detected, -60);
  BEGIN
  ... -- Some operation that causes an ORA-00060 error
  EXCEPTION
  WHEN deadlock_detected THEN
  -- handle the error
  END;
  dui yu yong hu zi ding yi yi chang , zhi neng zai PL/SQL kuai zhong de sheng ming bu fen sheng ming yi chang , yi chang de ming zi you EXCEPTION guan jian zi yin ru :
  reserved_loaned Exception
  chan sheng yi chang hou , kong zhi chuan gei le zi cheng xu de yi chang bu fen , jiang yi chang zhuan xiang ge zi yi chang kong zhi kuai , bi xu zai dai ma zhong shi yong ru xia de jie gou chu li cuo wu :
  Exception
  When exception1 then
  Sequence of statements;
  When exception2 then
  Sequence of statements;
  When others then
  3、 yi chang de pao chu
  you san zhong fang shi pao chu yi chang
  ◆1. tong guo PL/SQL yun xing shi yin qing
  ◆2. shi yong RAISE yu ju
  ◆3. tiao yong RAISE_APPLICATION_ERROR cun chu guo cheng
  dang shu ju ku huo PL/SQL zai yun xing shi fa sheng cuo wu shi , yi ge yi chang bei PL/SQL yun xing shi yin qing zi dong pao chu 。 yi chang ye ke yi tong guo RAISE yu ju pao chu
  RAISE exception_name;
  xian shi pao chu yi chang shi cheng xu yuan chu li sheng ming de yi chang de xi guan yong fa , dan RAISE bu xian yu sheng ming le de yi chang , ta ke yi pao chu ren he ren he yi chang 。 li ru , ni xi wang yong TIMEOUT_ON_RESOURCE cuo wu jian ce xin de yun xing shi yi chang chu li qi , ni zhi xu jian dan de zai cheng xu zhong shi yong xia mian de yu ju :
  RAISE TIMEOUT_ON_RESOUCE;
  bi ru xia mian yi ge ding dan shu ru de li zi , ruo dang ding dan xiao yu ku cun shu liang , ze pao chu yi chang , bing qie bu huo gai yi chang , chu li yi chang
  DECLARE
  inventory_too_low EXCEPTION;
  --- qi ta sheng ming yu ju
  BEGIN
  IF order_rec.qty>inventory_rec.qty THEN
  RAISE inventory_too_low;
  END IF
  EXCEPTION
  WHEN inventory_too_low THEN
  order_rec.staus:='backordered';
  END;
  RAISE_APPLICATION_ERROR nei jian han shu yong yu pao chu yi ge yi chang bing gei yi chang fu yu yi ge cuo wu hao yi ji cuo wu xin xi 。 zi ding yi yi chang de que sheng cuo wu hao shi +1, que sheng xin xi shi User_Defined_Exception。RAISE_APPLICATION_ERROR han shu neng gou zai pl/sql cheng xu kuai de zhi xing bu fen he yi chang bu fen tiao yong , xian shi pao chu dai te shu cuo wu hao de ming ming yi chang 。 Raise_application_error(error_number,message[,true,false]))
  cuo wu hao de fan wei shi -20,000 dao -20,999。 cuo wu xin xi shi wen ben zi fu chuan , zui duo wei 2048 zi jie 。TRUE he FALSE biao shi shi tian jia (TRUE) jin cuo wu dui (ERROR STACK) huan shi fu gai (overwrite) cuo wu dui (FALSE)。 que sheng qing kuang xia shi FALSE。
  ru xia dai ma suo shi :
  IF product_not_found THEN
  RAISE_APPLICATION_ERROR(-20123,'Invald product code' TRUE);
  END IF;
  4、 yi chang de chu li
  PL/SQL cheng xu kuai de yi chang bu fen bao han le cheng xu chu li cuo wu de dai ma , dang yi chang bei pao chu shi , yi ge yi chang xian jing jiu zi dong fa sheng , cheng xu kong zhi li kai zhi xing bu fen zhuan ru yi chang bu fen , yi dan cheng xu jin ru yi chang bu fen jiu bu neng zai hui dao tong yi kuai de zhi xing bu fen 。 xia mian shi yi chang bu fen de yi ban yu fa :
  EXCEPTION
  WHEN exception_name THEN
  Code for handing exception_name
  [WHEN another_exception THEN
  Code for handing another_exception]
  [WHEN others THEN
  code for handing any other exception.]
  yong hu bi xu zai du li de WHEN zi chuan zhong wei mei ge yi chang she ji yi chang chu li dai ma ,WHEN OTHERS zi chuan bi xu fang zhi zai zui hou mian zuo wei que sheng chu li qi chu li mei you xian shi chu li de yi chang 。 dang yi chang fa sheng shi , kong zhi zhuan dao yi chang bu fen ,ORACLE cha zhao dang qian yi chang xiang ying de WHEN..THEN yu ju , bu zhuo yi chang ,THEN zhi hou de dai ma bei zhi xing , ru guo cuo wu xian jing dai ma zhi shi tui chu xiang ying de qian tao kuai , na me cheng xu jiang ji xu zhi xing nei bu kuai END hou mian de yu ju 。 ru guo mei you zhao dao xiang ying de yi chang xian jing , na me jiang zhi xing WHEN OTHERS。 zai yi chang bu fen WHEN zi chuan mei you shu liang xian zhi 。
  EXCEPTION
  WHEN inventory_too_low THEN
  order_rec.staus:='backordered';
  replenish_inventory(inventory_nbr=>
  inventory_rec.sku,min_amount=>order_rec.qty-inventory_rec.qty);
  WHEN discontinued_item THEN
  --code for discontinued_item processing
  WHEN zero_divide THEN
  --code for zero_divide
  WHEN OTHERS THEN
  --code for any other exception
  END;
  dang yi chang pao chu hou , kong zhi wu tiao jian zhuan dao yi chang bu fen , zhe jiu yi wei zhe kong zhi bu neng hui dao yi chang fa sheng de wei zhi , dang yi chang bei chu li he jie jue hou , kong zhi fan hui dao shang yi ceng zhi xing bu fen de xia yi tiao yu ju 。
  BEGIN
  DECLARE
  bad_credit exception;
  BEGIN
  RAISE bad_credit;
  -- fa sheng yi chang , kong zhi zhuan xiang ;
  EXCEPTION
  WHEN bad_credit THEN
  dbms_output.put_line('bad_credit');
  END;
  --bad_credit yi chang chu li hou , kong zhi zhuan dao zhe li
  EXCEPTION
  WHEN OTHERS THEN
  -- kong zhi bu hui cong bad_credit yi chang zhuan dao zhe li
  -- yin wei bad_credit yi bei chu li
  END;
  dang yi chang fa sheng shi , zai kuai de nei bu mei you gai yi chang chu li qi shi , kong zhi jiang zhuan dao huo chuan bo dao shang yi ceng kuai de yi chang chu li bu fen 。
  BEGIN
  DECLARE --- nei bu kuai kai shi
  bad_credit exception;
  BEGIN
  RAISE bad_credit;
  -- fa sheng yi chang , kong zhi zhuan xiang ;
  EXCEPTION
  WHEN ZERO_DIVIDE THEN -- bu neng chu li bad_credite yi chang
  dbms_output.put_line('divide by zero error');
  END -- jie shu nei bu kuai
  -- kong zhi bu neng dao da zhe li , yin wei yi chang mei you jie jue ;
  -- yi chang bu fen
  EXCEPTION
  WHEN OTHERS THEN
  -- you yu bad_credit mei you jie jue , kong zhi jiang zhuan dao zhe li
  END;
  5、 yi chang de chuan bo
  mei you chu li de yi chang jiang yan jian ce yi chang tiao yong cheng xu chuan bo dao wai mian , dang yi chang bei chu li bing jie jue huo dao da cheng xu zui wai ceng chuan bo ting zhi 。 zai sheng ming bu fen pao chu de yi chang jiang kong zhi zhuan dao shang yi ceng de yi chang bu fen 。
  BEGIN
  executable statements
  BEGIN
  today DATE:='SYADATE'; --ERRROR
  BEGIN -- nei bu kuai kai shi
  dbms_output.put_line('this line will not execute');
  EXCEPTION
  WHEN OTHERS THEN
  -- yi chang bu hui zai zhe li chu li
  END;-- nei bu kuai jie shu
  EXCEPTION
  WHEN OTHERS THEN
  chu li yi chang
  END
  zhi xing bu fen pao chu de yi chang jiang shou xian chuan di dao tong yi kuai de yi chang bu fen , ru guo zai tong yi kuai de yi chang bu fen mei you chu li zhe ge yi chang de chu li qi , na me yi chang jiang hui chuan bo dao shang yi ceng de yi chang bu fen zhong , yi zhi dao zui wai ceng 。
  zai yi chang bu fen pao chu de yi chang jiang kong zhi zhuan dao shang yi ceng de yi chang bu fen 。
  ling wai cuo wu bao gao han shu SQLCODE he SQLERRM zai OTHERS chu li qi zhong te bie you yong , yin wei ta men fan hui ORACLE cuo wu dai ma he xiao xi 。 ru xia li suo shi :
  declare
  err_num NUMBER;
  err_msg VARCHAR2(100);
  BEGIN
  ...
  EXCEPTION
  WHEN OTHERS THEN
  err_num := SQLCODE;
  err_msg := SUBSTR(SQLERRM, 1, 100);
  INSERT INTO errors VALUES (err_num, err_msg);
  END;
  
  2007-5-7 19:09:02 cha kan ping yu »»»
  2007-5-7 19:09:43 oracle yi chang chu li
  ~~~~ you guan yu yi chang chu li de 3 ge zhi shi dian !
  1.EXCEPTION_INT bian yi zhi shi
  gong neng shi jiang mou ming ming yi chang tong mou te ding Oracle cuo wu guan lian qi lai .
  zhu yong yong lai bu zhuo mou te ding yi chang cuo wu , er bu shi tong guo OTHERS lai chu li .
  yu fa :PROGMA EXCEPTION_INIT(exception_name,oracle_error_number)
  SQL>
  SQL> DECLARE
  2 expa EXCEPTION;
  3 PRAGMA EXCEPTION_INIT(expa,-6502);
  4 vn NUMBER(1);
  5 BEGIN
  6 vn:=24;
  7 EXCEPTION
  8 WHEN expa THEN
  9 dbms_output.put_line(' shu zi huo zhi cuo wu : shu zhi jing du tai gao ');
  10 WHEN OTHERS THEN
  11 dbms_output.put_line(SQLCODE);
  12 dbms_output.put_line(substr(SQLERRM,1,100));
  13 END;
  14 /
  shu zi huo zhi cuo wu : shu zhi jing du tai gao
  PL/SQL procedure successfully completed
  SQL>
  2.RAISE_APPLICATION_ERROR
  gong neng yong lai zi ding yi cuo wu xiao xi
  yu fa : RAISE_APPLICATION_ERROR(error_number,error_message,[keep_errors])
  error_number:-20 000 dao -20 999 zhi jian de zhi
  error_message: bi xu shao yu 512 ge zi fu
  keep_errors: bu er zhi . wei zhen ze xin de cuo wu jiang bei jia dao yi cun zai de cuo wu qing dan zhong ( ru guo yi cun zai de hua ), wei jia ( mo ren zhi ) ze xin de cuo wu jiang dai ti dang qian de cuo wu qing dan .
  SQL> BEGIN
  2 UPDATE t SET a='TEST' WHERE a='12345';
  3 IF SQL%NOTFOUND THEN
  4 raise_application_error(-20001,' ni sha le ? zhi dao mei you zhe yang de shu ju huan qu geng xin !');
  5 END IF;
  6 EXCEPTION
  7 WHEN OTHERS THEN
  8 dbms_output.put_line(substr(SQLERRM,1,100));
  9 END;
  10 /
  ORA-20001: ni sha le ? zhi dao mei you zhe yang de shu ju huan qu geng xin !
  PL/SQL procedure successfully completed
  SQL>
  3. yi chang chuan bo
  A ke zhi xing bu fen fa sheng de yi chang
  1) ru guo dang qian yu ju kuai you gai yi chang de chu li cheng xu ze zhi xing zhi , kong zhi quan jiao you wai ceng yu ju kuai .
  dang qian yu ju kuai you gai yi chang de chu li cheng xu :
  SQL> DECLARE
  2 expa EXCEPTION;
  3 expb EXCEPTION;
  4 BEGIN
  5 BEGIN
  6 RAISE expa;
  7 EXCEPTION
  8 WHEN expa THEN
  9 dbms_output.put_line(' yi chang A chan sheng ');
  10 END;
  11 EXCEPTION
  12 WHEN expb THEN
  13 dbms_output.put_line(' yi chang B chan sheng ');
  14 END;
  15 /
  yi chang A chan sheng
  PL/SQL procedure successfully completed
  SQL>
  2) ru guo dang qian yu ju mei you gai yi chang de chu li cheng xu ze tong guo wai ceng yu ju kuai zhong chan sheng gai yi chang lai chuan bo gai yi chang , ran hou tong guo wai ceng yi chang chu li cheng xu an bu zhou 1 lai chu li . ruo wai ceng mei you gai yi chang de chu li cheng xu ze yi chang chuan bo dao tiao yong huan jing .
  dang qian yu ju kuai mei you gai yi chang de chu li cheng xu , wai ceng yu ju kuai zhong chan sheng gai yi chang bing chu li
  SQL> DECLARE
  2 expa EXCEPTION;
  3 expb EXCEPTION;
  4 BEGIN
  5 BEGIN
  6 RAISE expb;
  7 EXCEPTION
  8 WHEN expa THEN
  9 dbms_output.put_line(' yi chang A chan sheng ');
  10 END;
  11 EXCEPTION
  12 WHEN expb THEN
  13 dbms_output.put_line(' yi chang B chan sheng ');
  14 END;
  15 /
  yi chang B chan sheng
  PL/SQL procedure successfully completed
  SQL>
  dang qian yu ju kuai mei you gai yi chang de chu li cheng xu , wai ceng yu ju kuai zhong chan sheng gai yi chang qie mei you gai yi chang chu li cheng xu , yi chang chuan bo dao tiao yong huan jing
  SQL> DECLARE
  2 expa EXCEPTION;
  3 expb EXCEPTION;
  4 BEGIN
  5 BEGIN
  6 RAISE expb;
  7 EXCEPTION
  8 WHEN expa THEN
  9 dbms_output.put_line(' yi chang A chan sheng ');
  10 END;
  11 EXCEPTION
  12 WHEN expa THEN
  13 dbms_output.put_line(' yi chang A chan sheng ');
  14 END;
  15 /
  DECLARE
  expa EXCEPTION;
  expb EXCEPTION;
  BEGIN
  BEGIN
  RAISE expb;
  EXCEPTION
  WHEN expa THEN
  dbms_output.put_line(' yi chang A chan sheng ');
  END;
  EXCEPTION
  WHEN expa THEN
  dbms_output.put_line(' yi chang A chan sheng ');
  END;
  ORA-06510: PL/SQL: wu fa chu li de yong hu zi ding yi yi chang shi jian
  ORA-06512: zai line 6
  SQL>
  B sheng ming bu fen fa sheng de yi chang
  sheng ming bu fen mou fu zhi fa sheng yi chang , gai yi chang bei li ji chuan bo dao wai ceng yu ju kuai , zhi hou an "A ke zhi xing bu fen fa sheng de yi chang " gui ze lai chu li
  SQL> BEGIN
  2 DECLARE
  3 vn NUMBER(1):=25;
  4 BEGIN
  5 NULL;
  6 EXCEPTION
  7 WHEN OTHERS THEN
  8 dbms_output.put_line(' yi chang zai nei ceng bei chu li !');
  9 END;
  10 EXCEPTION
  11 WHEN OTHERS THEN
  12 dbms_output.put_line(' yi chang zai wai ceng bei chu li !');
  13 END;
  14 /
  yi chang zai wai ceng bei chu li !
  PL/SQL procedure successfully completed
  SQL>
  C yi chang bu fen fa sheng de yi chang
  yi chang chu li qi zhong ye hui chan sheng yi chang , ru RAISE huo yun xing cuo wu chan sheng , zhe li yi chang li ji bei chuan bo dao wai ceng tong "B sheng ming bu fen fa sheng de yi chang "
  li zi 1
  SQL>
  SQL> BEGIN
  2 DECLARE
  3 expa EXCEPTION;
  4 expb EXCEPTION;
  5 BEGIN
  6 RAISE expa;
  7 EXCEPTION
  8 WHEN expa THEN
  9 RAISE expb;
  10 WHEN expb THEN
  11 -- zhe li sui ran you expb yi chang chu li yu ju , dan shi gai yi chang hui li ji chuan bo dao wai ceng
  12 dbms_output.put_line(' nei ceng bu zhuo dao yi chang B');
  13 END;
  14 EXCEPTION
  15 WHEN OTHERS THEN
  16 dbms_output.put_line(' wai ceng bu zhuo dao yi chang B');
  17 END;
  18 /
  wai ceng bu zhuo dao yi chang B
  PL/SQL procedure successfully completed
  SQL>
  li zi 2
  SQL> desc t;
  Name Type
  ---- ---------
  ID NUMBER(1)
  SQL> BEGIN
  2 DECLARE
  3 expa EXCEPTION;
  4 BEGIN
  5 RAISE expa;
  6 EXCEPTION
  7 WHEN expa THEN
  8 INSERT INTO t VALUES(12);
  9 WHEN OTHERS THEN
  10 dbms_output.put_line(' nei ceng bu zhuo dao yi chang ');
  11 END;
  12 EXCEPTION
  13 WHEN OTHERS THEN
  14 dbms_output.put_line(' wai ceng bu zhuo dao yi chang ');
  15 END;
  16 /
  wai ceng bu zhuo dao yi chang
  PL/SQL procedure successfully completed
  SQL>
  2007-5-7 19:10:25 yi 、 zai plsql zhong ,oracle zi dai de Exceptions ru xia :
  Exception Oracle Error SQLCODE Value
  ACCESS_INTO_NULL ORA-06530 -6530
  CASE_NOT_FOUND ORA-06592 -6592
  COLLECTION_IS_NULL ORA-06531 -6531
  CURSOR_ALREADY_OPEN ORA-06511 -6511
  DUP_VAL_ON_INDEX ORA-00001 -1
  INVALID_CURSOR ORA-01001 -1001
  INVALID_NUMBER ORA-01722 -1722
  LOGIN_DENIED ORA-01017 -1017
  NO_DATA_FOUND ORA-01403 +100
  NOT_LOGGED_ON ORA-01012 -1012
  PROGRAM_ERROR ORA-06501 -6501
  ROWTYPE_MISMATCH ORA-06504 -6504
  SELF_IS_NULL ORA-30625 -30625
  STORAGE_ERROR ORA-06500 -6500
  SUBSCRIPT_BEYOND_COUNT ORA-06533 -6533
  SUBSCRIPT_OUTSIDE_LIMIT ORA-06532 -6532
  SYS_INVALID_ROWID ORA-01410 -1410
  TIMEOUT_ON_RESOURCE ORA-00051 -51
  TOO_MANY_ROWS ORA-01422 -1422
  VALUE_ERROR ORA-06502 -6502
  ZERO_DIVIDE ORA-01476 -1476
  2007-5-7 21:45:42 Oracle SQLCODE/SQLERRM
  Oracle nei zhi han shu SQLCODE he SQLERRM shi te bie yong zai OTHERS chu li qi zhong , fen bie yong lai fan hui Oracle de cuo wu dai ma he cuo wu xiao xi 。
  OTHERS chu li qi ying gai shi yi chang chu li kuai zhong de zui hou de yi chang chu li qi , yin wei ta shi yong lai bu huo chu le bie de yi chang chu li qi chu li yi wai de suo you de Oracle yi chang , suo yi zai cheng xu de zui wai ceng shi yong yi ge OTHERS chu li qi de hua , jiang ke yi que bao suo you de cuo wu dou hui bei jian ce dao 。
  zai yi ge nei zai de yi chang zhong ,SQLCODE fan hui Oracle cuo wu de xu hao , er SQLERRM fan hui de shi xiang ying de cuo wu xiao xi , cuo wu xiao xi shou xian xian shi de shi cuo wu dai ma 。SQLCODE fan hui de shi fu shu , chu fei Oracle de cuo wu wei “ORA-01403:NO DATA FOUND”( yi :ORA-01403: wei zhao dao shu ju ), dang Oracle cuo wu wei “ORA-01403:NO DATA FOUND” shi , qi dui ying de SQLCODE wei +100。 dui yu yong hu zi ding yi de yi chang ,SQLCODE fan hui de shi +1, er SQLERRM fan hui de shi User-Defined Exception。
  yi ge Oracle de cuo wu xiao xi zui duo zhi neng bao han 512 ge zi jie de cuo wu dai ma 。 ru guo mei you yi chang bei chu fa , ze SQLCODE fan hui 0,SQLERRM fan hui “ORA-0000:normal, successful completion”。【原文】【汉音对照
 
 
 
 
 
 
 
 
日版宠物情人插曲《Winding Road》歌词

日版宠物情人2017的插曲,很带节奏感,日语的,女生唱的。 最后听见是在第8集的时候女主手割伤了,然后男主用嘴帮她吸了一下,插曲就出来了。 歌手:Def...

兄弟共妻,我成了他们夜里的美食

老钟家的两个儿子很特别,就是跟其他的人不太一样,魔一般的执着。兄弟俩都到了要结婚的年龄了,不管自家老爹怎么磨破嘴皮子,兄弟俩说不娶就不娶,老父母为兄弟两操碎了心...

如何磨出破洞牛仔裤?牛仔裤怎么剪破洞?

把牛仔裤磨出有线的破洞 1、具体工具就是磨脚石,下面垫一个硬物,然后用磨脚石一直磨一直磨,到把那块磨薄了,用手撕开就好了。出来的洞啊很自然的。需要猫须的话调几...

我就是扫描下图得到了敬业福和爱国福

先来看下敬业福和爱国福 今年春节,支付宝再次推出了“五福红包”活动,表示要“把欠大家的敬业福都还给大家”。 今天该活动正式启动,和去年一样,需要收集“五福”...

冰箱异味产生的原因和臭味去除的方法

有时候我们打开冰箱就会闻到一股异味,冰箱里的这种异味是因为一些物质发出的气味的混合体,闻起来让人恶心。 产生这些异味的主要原因有以下几点。 1、很多人有这种习...

 
 
Oracle developer yi qi kuai su de shu ju chu li kai fa er wen ming , qi yi chang chu li ji zhi ye shi bi jiao wan shan , bu ke xiao qu 。 1、 yi chang de you dian ru guo mei you yi chang , zai cheng xu zhong , ying dang jian cha mei ge ming ling de cheng gong huan shi shi bai , ru BEGIN SELECT ... -- check for ’no data found’ error SELECT ... -- check for ’no data found’ error SELECT ... -- check for ’no data found’ error zhe zhong shi xian de fang fa que dian zai yu cuo wu chu li mei you yu zheng chang chu li fen kai , ke du xing cha , shi yong yi chang , ke yi fang bian chu li cuo wu , er qie yi chang chu li cheng xu yu zheng chang de shi wu luo ji fen kai , ti gao le ke du xing , ru BEGIN SELECT ... SELECT ... SELECT ... ... EXCEPTION WHEN NO_DATA_FOUND THEN -- catches all ’no data found’ errors 2、 yi chang de fen lei you liang zhong lei xing de yi chang , yi zhong wei nei bu yi chang , yi zhong wei yong hu zi ding yi yi chang , nei bu yi chang shi zhi xing qi jian fan hui dao PL/SQL kuai de ORACLE cuo wu huo you PL/SQL dai ma de mou cao zuo yin qi de cuo wu , ru chu shu wei ling huo nei cun yi chu de qing kuang 。 yong hu zi ding yi yi chang you kai fa zhe xian shi ding yi , zai PL/SQL kuai zhong chuan di xin xi yi kong zhi dui yu ying yong de cuo wu chu li 。 mei dang PL/SQL wei bei le ORACLE yuan ze huo chao yue le xi tong yi lai de yuan ze jiu hui yin shi de chan sheng nei bu yi chang 。 yin wei mei ge ORACLE cuo wu dou you yi ge hao ma bing qie zai PL/SQL zhong yi chang tong guo ming zi chu li ,ORACLE ti gong le yu ding yi de nei bu yi chang 。 ru SELECT INTO yu ju bu fan hui xing shi chan sheng de ORACLE yi chang NO_DATA_FOUND。 dui yu yu ding yi yi chang , xian jiang zui chang yong de yi chang lie ju ru xia : exception oracle error sqlcode value condition no_data_found ora-01403 +100 select into yu ju mei you fu he tiao jian de ji lu fan hui too_mang_rows ora-01422 -1422 select into yu ju fu he tiao jian de ji lu you duo tiao fan hui dup_val_on_index ora-00001 -1 dui yu shu ju ku biao zhong de mou yi lie , gai lie yi jing bei xian zhi wei wei yi suo yin , cheng xu shi tu cun chu liang ge chong fu de zhi value_error ora-06502 -6502 zai zhuan huan zi fu lei xing , jie qu huo chang du shou xian shi , hui fa sheng gai yi chang , ru yi ge zi fu fen pei gei yi ge bian liang , er gai bian liang sheng ming de chang du bi gai zi fu duan , jiu hui yin fa gai yi chang storage_error ora-06500 -6500 nei cun yi chu zero_divide ora-01476 -1476 chu shu wei ling case_not_found ora-06592 -6530 dui yu xuan ze case yu ju , mei you yu zhi xiang pi pei de tiao jian , tong shi , ye mei you else yu ju bu huo qi ta de tiao jian cursor_already_open ora-06511 -6511 cheng xu shi tu da kai yi ge yi jing da kai de you biao timeout_on_resource ora-00051 -51 xi tong zai deng dai mou yi zi yuan , shi jian chao shi ru guo yao chu li wei ming ming de nei bu yi chang , bi xu shi yong OTHERS yi chang chu li qi huo PRAGMA EXCEPTION_INIT 。PRAGMA you bian yi qi kong zhi , huo zhe shi dui yu bian yi qi de zhu shi 。PRAGMA zai bian yi shi chu li , er bu shi zai yun xing shi chu li 。EXCEPTION_INIT gao su bian yi qi jiang yi chang ming yu ORACLE cuo wu ma jie he qi lai , zhe yang ke yi tong guo ming zi yin yong ren yi de nei bu yi chang , bing qie ke yi tong guo ming zi wei yi chang bian xie yi shi dang de yi chang chu li qi 。 zai zi cheng xu zhong shi yong EXCEPTION_INIT de yu fa ru xia : PRAGMA EXCEPTION_INIT(exception_name, -Oracle_error_number); zai gai yu fa zhong , yi chang ming shi sheng ming de yi chang , xia li shi qi yong fa : DECLARE deadlock_detected EXCEPTION; PRAGMA EXCEPTION_INIT(deadlock_detected, -60); BEGIN ... -- Some operation that causes an ORA-00060 error EXCEPTION WHEN deadlock_detected THEN -- handle the error END; dui yu yong hu zi ding yi yi chang , zhi neng zai PL/SQL kuai zhong de sheng ming bu fen sheng ming yi chang , yi chang de ming zi you EXCEPTION guan jian zi yin ru : reserved_loaned Exception chan sheng yi chang hou , kong zhi chuan gei le zi cheng xu de yi chang bu fen , jiang yi chang zhuan xiang ge zi yi chang kong zhi kuai , bi xu zai dai ma zhong shi yong ru xia de jie gou chu li cuo wu : Exception When exception1 then Sequence of statements; When exception2 then Sequence of statements; When others then 3、 yi chang de pao chu you san zhong fang shi pao chu yi chang ◆1. tong guo PL/SQL yun xing shi yin qing ◆2. shi yong RAISE yu ju ◆3. tiao yong RAISE_APPLICATION_ERROR cun chu guo cheng dang shu ju ku huo PL/SQL zai yun xing shi fa sheng cuo wu shi , yi ge yi chang bei PL/SQL yun xing shi yin qing zi dong pao chu 。 yi chang ye ke yi tong guo RAISE yu ju pao chu RAISE exception_name; xian shi pao chu yi chang shi cheng xu yuan chu li sheng ming de yi chang de xi guan yong fa , dan RAISE bu xian yu sheng ming le de yi chang , ta ke yi pao chu ren he ren he yi chang 。 li ru , ni xi wang yong TIMEOUT_ON_RESOURCE cuo wu jian ce xin de yun xing shi yi chang chu li qi , ni zhi xu jian dan de zai cheng xu zhong shi yong xia mian de yu ju : RAISE TIMEOUT_ON_RESOUCE; bi ru xia mian yi ge ding dan shu ru de li zi , ruo dang ding dan xiao yu ku cun shu liang , ze pao chu yi chang , bing qie bu huo gai yi chang , chu li yi chang DECLARE inventory_too_low EXCEPTION; --- qi ta sheng ming yu ju BEGIN IF order_rec.qty>inventory_rec.qty THEN RAISE inventory_too_low; END IF EXCEPTION WHEN inventory_too_low THEN order_rec.staus:='backordered'; END; RAISE_APPLICATION_ERROR nei jian han shu yong yu pao chu yi ge yi chang bing gei yi chang fu yu yi ge cuo wu hao yi ji cuo wu xin xi 。 zi ding yi yi chang de que sheng cuo wu hao shi +1, que sheng xin xi shi User_Defined_Exception。RAISE_APPLICATION_ERROR han shu neng gou zai pl/sql cheng xu kuai de zhi xing bu fen he yi chang bu fen tiao yong , xian shi pao chu dai te shu cuo wu hao de ming ming yi chang 。 Raise_application_error(error_number,message[,true,false])) cuo wu hao de fan wei shi -20,000 dao -20,999。 cuo wu xin xi shi wen ben zi fu chuan , zui duo wei 2048 zi jie 。TRUE he FALSE biao shi shi tian jia (TRUE) jin cuo wu dui (ERROR STACK) huan shi fu gai (overwrite) cuo wu dui (FALSE)。 que sheng qing kuang xia shi FALSE。 ru xia dai ma suo shi : IF product_not_found THEN RAISE_APPLICATION_ERROR(-20123,'Invald product code' TRUE); END IF; 4、 yi chang de chu li PL/SQL cheng xu kuai de yi chang bu fen bao han le cheng xu chu li cuo wu de dai ma , dang yi chang bei pao chu shi , yi ge yi chang xian jing jiu zi dong fa sheng , cheng xu kong zhi li kai zhi xing bu fen zhuan ru yi chang bu fen , yi dan cheng xu jin ru yi chang bu fen jiu bu neng zai hui dao tong yi kuai de zhi xing bu fen 。 xia mian shi yi chang bu fen de yi ban yu fa : EXCEPTION WHEN exception_name THEN Code for handing exception_name [WHEN another_exception THEN Code for handing another_exception] [WHEN others THEN   code for handing any other exception.] yong hu bi xu zai du li de WHEN zi chuan zhong wei mei ge yi chang she ji yi chang chu li dai ma ,WHEN OTHERS zi chuan bi xu fang zhi zai zui hou mian zuo wei que sheng chu li qi chu li mei you xian shi chu li de yi chang 。 dang yi chang fa sheng shi , kong zhi zhuan dao yi chang bu fen ,ORACLE cha zhao dang qian yi chang xiang ying de WHEN..THEN yu ju , bu zhuo yi chang ,THEN zhi hou de dai ma bei zhi xing , ru guo cuo wu xian jing dai ma zhi shi tui chu xiang ying de qian tao kuai , na me cheng xu jiang ji xu zhi xing nei bu kuai END hou mian de yu ju 。 ru guo mei you zhao dao xiang ying de yi chang xian jing , na me jiang zhi xing WHEN OTHERS。 zai yi chang bu fen WHEN zi chuan mei you shu liang xian zhi 。 EXCEPTION WHEN inventory_too_low THEN order_rec.staus:='backordered'; replenish_inventory(inventory_nbr=> inventory_rec.sku,min_amount=>order_rec.qty-inventory_rec.qty); WHEN discontinued_item THEN --code for discontinued_item processing WHEN zero_divide THEN --code for zero_divide WHEN OTHERS THEN --code for any other exception END; dang yi chang pao chu hou , kong zhi wu tiao jian zhuan dao yi chang bu fen , zhe jiu yi wei zhe kong zhi bu neng hui dao yi chang fa sheng de wei zhi , dang yi chang bei chu li he jie jue hou , kong zhi fan hui dao shang yi ceng zhi xing bu fen de xia yi tiao yu ju 。 BEGIN DECLARE bad_credit exception; BEGIN RAISE bad_credit; -- fa sheng yi chang , kong zhi zhuan xiang ; EXCEPTION WHEN bad_credit THEN dbms_output.put_line('bad_credit'); END; --bad_credit yi chang chu li hou , kong zhi zhuan dao zhe li EXCEPTION WHEN OTHERS THEN -- kong zhi bu hui cong bad_credit yi chang zhuan dao zhe li -- yin wei bad_credit yi bei chu li END; dang yi chang fa sheng shi , zai kuai de nei bu mei you gai yi chang chu li qi shi , kong zhi jiang zhuan dao huo chuan bo dao shang yi ceng kuai de yi chang chu li bu fen 。 BEGIN DECLARE --- nei bu kuai kai shi bad_credit exception; BEGIN RAISE bad_credit; -- fa sheng yi chang , kong zhi zhuan xiang ; EXCEPTION WHEN ZERO_DIVIDE THEN -- bu neng chu li bad_credite yi chang dbms_output.put_line('divide by zero error'); END -- jie shu nei bu kuai -- kong zhi bu neng dao da zhe li , yin wei yi chang mei you jie jue ; -- yi chang bu fen EXCEPTION WHEN OTHERS THEN -- you yu bad_credit mei you jie jue , kong zhi jiang zhuan dao zhe li END; 5、 yi chang de chuan bo mei you chu li de yi chang jiang yan jian ce yi chang tiao yong cheng xu chuan bo dao wai mian , dang yi chang bei chu li bing jie jue huo dao da cheng xu zui wai ceng chuan bo ting zhi 。 zai sheng ming bu fen pao chu de yi chang jiang kong zhi zhuan dao shang yi ceng de yi chang bu fen 。 BEGIN executable statements BEGIN today DATE:='SYADATE'; --ERRROR BEGIN -- nei bu kuai kai shi dbms_output.put_line('this line will not execute'); EXCEPTION WHEN OTHERS THEN -- yi chang bu hui zai zhe li chu li END;-- nei bu kuai jie shu EXCEPTION WHEN OTHERS THEN chu li yi chang END zhi xing bu fen pao chu de yi chang jiang shou xian chuan di dao tong yi kuai de yi chang bu fen , ru guo zai tong yi kuai de yi chang bu fen mei you chu li zhe ge yi chang de chu li qi , na me yi chang jiang hui chuan bo dao shang yi ceng de yi chang bu fen zhong , yi zhi dao zui wai ceng 。 zai yi chang bu fen pao chu de yi chang jiang kong zhi zhuan dao shang yi ceng de yi chang bu fen 。 ling wai cuo wu bao gao han shu SQLCODE he SQLERRM zai OTHERS chu li qi zhong te bie you yong , yin wei ta men fan hui ORACLE cuo wu dai ma he xiao xi 。 ru xia li suo shi : declare err_num NUMBER; err_msg VARCHAR2(100); BEGIN ... EXCEPTION WHEN OTHERS THEN err_num := SQLCODE; err_msg := SUBSTR(SQLERRM, 1, 100); INSERT INTO errors VALUES (err_num, err_msg); END; 2007-5-7 19:09:02 cha kan ping yu »»» 2007-5-7 19:09:43 oracle yi chang chu li ~~~~ you guan yu yi chang chu li de 3 ge zhi shi dian ! 1.EXCEPTION_INT bian yi zhi shi gong neng shi jiang mou ming ming yi chang tong mou te ding Oracle cuo wu guan lian qi lai . zhu yong yong lai bu zhuo mou te ding yi chang cuo wu , er bu shi tong guo OTHERS lai chu li . yu fa :PROGMA EXCEPTION_INIT(exception_name,oracle_error_number) SQL> SQL> DECLARE 2 expa EXCEPTION; 3 PRAGMA EXCEPTION_INIT(expa,-6502); 4 vn NUMBER(1); 5 BEGIN 6 vn:=24; 7 EXCEPTION 8 WHEN expa THEN 9 dbms_output.put_line(' shu zi huo zhi cuo wu : shu zhi jing du tai gao '); 10 WHEN OTHERS THEN 11 dbms_output.put_line(SQLCODE); 12 dbms_output.put_line(substr(SQLERRM,1,100)); 13 END; 14 / shu zi huo zhi cuo wu : shu zhi jing du tai gao PL/SQL procedure successfully completed SQL> 2.RAISE_APPLICATION_ERROR gong neng yong lai zi ding yi cuo wu xiao xi yu fa : RAISE_APPLICATION_ERROR(error_number,error_message,[keep_errors]) error_number:-20 000 dao -20 999 zhi jian de zhi error_message: bi xu shao yu 512 ge zi fu keep_errors: bu er zhi . wei zhen ze xin de cuo wu jiang bei jia dao yi cun zai de cuo wu qing dan zhong ( ru guo yi cun zai de hua ), wei jia ( mo ren zhi ) ze xin de cuo wu jiang dai ti dang qian de cuo wu qing dan . SQL> BEGIN 2 UPDATE t SET a='TEST' WHERE a='12345'; 3 IF SQL%NOTFOUND THEN 4 raise_application_error(-20001,' ni sha le ? zhi dao mei you zhe yang de shu ju huan qu geng xin !'); 5 END IF; 6 EXCEPTION 7 WHEN OTHERS THEN 8 dbms_output.put_line(substr(SQLERRM,1,100)); 9 END; 10 / ORA-20001: ni sha le ? zhi dao mei you zhe yang de shu ju huan qu geng xin ! PL/SQL procedure successfully completed SQL> 3. yi chang chuan bo A ke zhi xing bu fen fa sheng de yi chang 1) ru guo dang qian yu ju kuai you gai yi chang de chu li cheng xu ze zhi xing zhi , kong zhi quan jiao you wai ceng yu ju kuai . dang qian yu ju kuai you gai yi chang de chu li cheng xu : SQL> DECLARE 2 expa EXCEPTION; 3 expb EXCEPTION; 4 BEGIN 5 BEGIN 6 RAISE expa; 7 EXCEPTION 8 WHEN expa THEN 9 dbms_output.put_line(' yi chang A chan sheng '); 10 END; 11 EXCEPTION 12 WHEN expb THEN 13 dbms_output.put_line(' yi chang B chan sheng '); 14 END; 15 / yi chang A chan sheng PL/SQL procedure successfully completed SQL> 2) ru guo dang qian yu ju mei you gai yi chang de chu li cheng xu ze tong guo wai ceng yu ju kuai zhong chan sheng gai yi chang lai chuan bo gai yi chang , ran hou tong guo wai ceng yi chang chu li cheng xu an bu zhou 1 lai chu li . ruo wai ceng mei you gai yi chang de chu li cheng xu ze yi chang chuan bo dao tiao yong huan jing . dang qian yu ju kuai mei you gai yi chang de chu li cheng xu , wai ceng yu ju kuai zhong chan sheng gai yi chang bing chu li SQL> DECLARE 2 expa EXCEPTION; 3 expb EXCEPTION; 4 BEGIN 5 BEGIN 6 RAISE expb; 7 EXCEPTION 8 WHEN expa THEN 9 dbms_output.put_line(' yi chang A chan sheng '); 10 END; 11 EXCEPTION 12 WHEN expb THEN 13 dbms_output.put_line(' yi chang B chan sheng '); 14 END; 15 / yi chang B chan sheng PL/SQL procedure successfully completed SQL> dang qian yu ju kuai mei you gai yi chang de chu li cheng xu , wai ceng yu ju kuai zhong chan sheng gai yi chang qie mei you gai yi chang chu li cheng xu , yi chang chuan bo dao tiao yong huan jing SQL> DECLARE 2 expa EXCEPTION; 3 expb EXCEPTION; 4 BEGIN 5 BEGIN 6 RAISE expb; 7 EXCEPTION 8 WHEN expa THEN 9 dbms_output.put_line(' yi chang A chan sheng '); 10 END; 11 EXCEPTION 12 WHEN expa THEN 13 dbms_output.put_line(' yi chang A chan sheng '); 14 END; 15 / DECLARE expa EXCEPTION; expb EXCEPTION; BEGIN BEGIN RAISE expb; EXCEPTION WHEN expa THEN dbms_output.put_line(' yi chang A chan sheng '); END; EXCEPTION WHEN expa THEN dbms_output.put_line(' yi chang A chan sheng '); END; ORA-06510: PL/SQL: wu fa chu li de yong hu zi ding yi yi chang shi jian ORA-06512: zai line 6 SQL> B sheng ming bu fen fa sheng de yi chang sheng ming bu fen mou fu zhi fa sheng yi chang , gai yi chang bei li ji chuan bo dao wai ceng yu ju kuai , zhi hou an "A ke zhi xing bu fen fa sheng de yi chang " gui ze lai chu li SQL> BEGIN 2 DECLARE 3 vn NUMBER(1):=25; 4 BEGIN 5 NULL; 6 EXCEPTION 7 WHEN OTHERS THEN 8 dbms_output.put_line(' yi chang zai nei ceng bei chu li !'); 9 END; 10 EXCEPTION 11 WHEN OTHERS THEN 12 dbms_output.put_line(' yi chang zai wai ceng bei chu li !'); 13 END; 14 / yi chang zai wai ceng bei chu li ! PL/SQL procedure successfully completed SQL> C yi chang bu fen fa sheng de yi chang yi chang chu li qi zhong ye hui chan sheng yi chang , ru RAISE huo yun xing cuo wu chan sheng , zhe li yi chang li ji bei chuan bo dao wai ceng tong "B sheng ming bu fen fa sheng de yi chang " li zi 1 SQL> SQL> BEGIN 2 DECLARE 3 expa EXCEPTION; 4 expb EXCEPTION; 5 BEGIN 6 RAISE expa; 7 EXCEPTION 8 WHEN expa THEN 9 RAISE expb; 10 WHEN expb THEN 11 -- zhe li sui ran you expb yi chang chu li yu ju , dan shi gai yi chang hui li ji chuan bo dao wai ceng 12 dbms_output.put_line(' nei ceng bu zhuo dao yi chang B'); 13 END; 14 EXCEPTION 15 WHEN OTHERS THEN 16 dbms_output.put_line(' wai ceng bu zhuo dao yi chang B'); 17 END; 18 / wai ceng bu zhuo dao yi chang B PL/SQL procedure successfully completed SQL> li zi 2 SQL> desc t; Name Type ---- --------- ID NUMBER(1) SQL> BEGIN 2 DECLARE 3 expa EXCEPTION; 4 BEGIN 5 RAISE expa; 6 EXCEPTION 7 WHEN expa THEN 8 INSERT INTO t VALUES(12); 9 WHEN OTHERS THEN 10 dbms_output.put_line(' nei ceng bu zhuo dao yi chang '); 11 END; 12 EXCEPTION 13 WHEN OTHERS THEN 14 dbms_output.put_line(' wai ceng bu zhuo dao yi chang '); 15 END; 16 / wai ceng bu zhuo dao yi chang PL/SQL procedure successfully completed SQL> 2007-5-7 19:10:25 yi 、 zai plsql zhong ,oracle zi dai de Exceptions ru xia : Exception Oracle Error SQLCODE Value ACCESS_INTO_NULL ORA-06530 -6530 CASE_NOT_FOUND ORA-06592 -6592 COLLECTION_IS_NULL ORA-06531 -6531 CURSOR_ALREADY_OPEN ORA-06511 -6511 DUP_VAL_ON_INDEX ORA-00001 -1 INVALID_CURSOR ORA-01001 -1001 INVALID_NUMBER ORA-01722 -1722 LOGIN_DENIED ORA-01017 -1017 NO_DATA_FOUND ORA-01403 +100 NOT_LOGGED_ON ORA-01012 -1012 PROGRAM_ERROR ORA-06501 -6501 ROWTYPE_MISMATCH ORA-06504 -6504 SELF_IS_NULL ORA-30625 -30625 STORAGE_ERROR ORA-06500 -6500 SUBSCRIPT_BEYOND_COUNT ORA-06533 -6533 SUBSCRIPT_OUTSIDE_LIMIT ORA-06532 -6532 SYS_INVALID_ROWID ORA-01410 -1410 TIMEOUT_ON_RESOURCE ORA-00051 -51 TOO_MANY_ROWS ORA-01422 -1422 VALUE_ERROR ORA-06502 -6502 ZERO_DIVIDE ORA-01476 -1476 2007-5-7 21:45:42 Oracle SQLCODE/SQLERRM Oracle nei zhi han shu SQLCODE he SQLERRM shi te bie yong zai OTHERS chu li qi zhong , fen bie yong lai fan hui Oracle de cuo wu dai ma he cuo wu xiao xi 。 OTHERS chu li qi ying gai shi yi chang chu li kuai zhong de zui hou de yi chang chu li qi , yin wei ta shi yong lai bu huo chu le bie de yi chang chu li qi chu li yi wai de suo you de Oracle yi chang , suo yi zai cheng xu de zui wai ceng shi yong yi ge OTHERS chu li qi de hua , jiang ke yi que bao suo you de cuo wu dou hui bei jian ce dao 。 zai yi ge nei zai de yi chang zhong ,SQLCODE fan hui Oracle cuo wu de xu hao , er SQLERRM fan hui de shi xiang ying de cuo wu xiao xi , cuo wu xiao xi shou xian xian shi de shi cuo wu dai ma 。SQLCODE fan hui de shi fu shu , chu fei Oracle de cuo wu wei “ORA-01403:NO DATA FOUND”( yi :ORA-01403: wei zhao dao shu ju ), dang Oracle cuo wu wei “ORA-01403:NO DATA FOUND” shi , qi dui ying de SQLCODE wei +100。 dui yu yong hu zi ding yi de yi chang ,SQLCODE fan hui de shi +1, er SQLERRM fan hui de shi User-Defined Exception。 yi ge Oracle de cuo wu xiao xi zui duo zhi neng bao han 512 ge zi jie de cuo wu dai ma 。 ru guo mei you yi chang bei chu fa , ze SQLCODE fan hui 0,SQLERRM fan hui “ORA-0000:normal, successful completion”。
󰈣󰈤
  免责声明:本文仅代表作者个人观点,与王朝网络无关。王朝网络登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述,其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
温柔美女韩雪写真
杨幂全新写真
网易红人PLMM草梅队长
河智苑Compagna09春装
看 这就是我的学校
惠山古迹区
雪后看花仙
元宵烟火
 
>>返回首页<<
 为你推荐
 
 
 转载本文
 UBB代码 HTML代码
复制到剪贴板...
 
 热帖排行
 
 
 
 
©2005- 王朝网络 版权所有