Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

È«Ãæ½âÎöOracle developerµÄÒì³£´¦Àí»úÖÆ

Oracle developerÒÔÆä¿ìËÙµÄÊý¾Ý´¦Àí¿ª·¢¶øÎÅÃû£¬ÆäÒì³£´¦Àí»úÖÆÒ²ÊDZȽÏÍêÉÆ£¬²»¿ÉСêï¡£
1¡¢ Òì³£µÄÓŵã
Èç¹ûûÓÐÒì³££¬ÔÚ³ÌÐòÖУ¬Ó¦µ±¼ì²éÿ¸öÃüÁîµÄ³É¹¦»¹ÊÇʧ°Ü£¬Èç
BEGIN
SELECT ...
-- check for ’no data found’ error
SELECT ...
-- check for ’no data found’ error
SELECT ...
-- check for ’no data found’ error
ÕâÖÖʵÏֵķ½·¨È±µãÔÚÓÚ´íÎó´¦ÀíûÓÐÓëÕý³£´¦Àí·Ö¿ª£¬¿É¶ÁÐԲʹÓÃÒì³££¬¿ÉÒÔ·½±ã´¦Àí´íÎ󣬶øÇÒÒì³£´¦Àí³ÌÐòÓëÕý³£µÄÊÂÎñÂß¼­·Ö¿ª£¬Ìá¸ßÁ˿ɶÁÐÔ£¬Èç
BEGIN
SELECT ...
SELECT ...
SELECT ...
...
EXCEPTION
WHEN NO_DATA_FOUND THEN -- catches all ’no data found’ errors
2¡¢ Òì³£µÄ·ÖÀà
ÓÐÁ½ÖÖÀàÐ͵ÄÒì³££¬Ò»ÖÖΪÄÚ²¿Òì³££¬Ò»ÖÖΪÓû§×Ô¶¨ÒåÒì³££¬ÄÚ²¿Òì³£ÊÇÖ´ÐÐÆڼ䷵»Øµ½PL/SQL¿éµÄORACLE´íÎó»òÓÉPL/SQL´úÂëµÄij²Ù×÷ÒýÆðµÄ´íÎó£¬Èç³ýÊýΪÁã»òÄÚ´æÒç³öµÄÇé¿ö¡£Óû§×Ô¶¨ÒåÒì³£ÓÉ¿ª·¢ÕßÏÔʾ¶¨Ò壬ÔÚPL/SQL¿éÖд«µÝÐÅÏ¢ÒÔ¿ØÖƶÔÓÚÓ¦ÓõĴíÎó´¦Àí¡£
ÿµ±PL/SQLÎ¥±³ÁËORACLEÔ­Ôò»ò³¬Ô½ÁËϵͳÒÀÀµµÄÔ­Ôò¾Í»áÒþʽµÄ²úÉúÄÚ²¿Òì³£¡£ÒòΪÿ¸öORACLE´íÎó¶¼ÓÐÒ»¸öºÅÂë²¢ÇÒÔÚPL/SQLÖÐÒ쳣ͨ¹ýÃû×Ö´¦Àí£¬ORACLEÌṩÁËÔ¤¶¨ÒåµÄÄÚ²¿Òì³£¡£ÈçSELECT INTO Óï¾ä²»·µ»ØÐÐʱ²úÉúµÄORACLEÒì³£NO_DATA_FOUND¡£¶ÔÓÚÔ¤¶¨ÒåÒì³££¬ÏÖ½«×î³£ÓõÄÒì³£ÁоÙÈçÏ£º
exception oracle error sqlcode value condition
no_data_found ora-01403 +100 select into Óï¾äûÓзûºÏÌõ¼þµÄ¼Ç¼·µ»Ø
too_mang_rows ora-01422 -1422 select into Óï¾ä·ûºÏÌõ¼þµÄ¼Ç¼ÓжàÌõ·µ»Ø
dup_val_on_index ora-00001 -1 ¶ÔÓÚÊý¾Ý¿â±íÖеÄijһÁУ¬¸ÃÁÐÒѾ­±»ÏÞÖÆΪΨһË÷Òý£¬³ÌÐòÊÔͼ´æ´¢Á½¸öÖظ´µÄÖµ
value_error ora-06502 -6502 ÔÚת»»×Ö·ûÀàÐÍ£¬½ØÈ¡»ò³¤¶ÈÊÜÏÞʱ£¬»á·¢Éú¸ÃÒì³££¬ÈçÒ»¸ö×Ö·û·ÖÅä¸øÒ»¸ö±äÁ¿£¬¶ø¸Ã±äÁ¿ÉùÃ÷µÄ³¤¶È±È¸Ã×Ö·û¶Ì£¬¾Í»áÒý·¢¸ÃÒì³£
storage_error ora-06500 -6500 ÄÚ´æÒç³ö
zero_divide ora-01476 -1476 ³ýÊýΪÁã
case_not_found ora-06592 -6530 ¶ÔÓÚÑ¡ÔñcaseÓï¾ä£¬Ã»ÓÐÓëÖ®ÏàÆ¥ÅäµÄÌõ¼þ£¬Í¬Ê±£¬Ò²Ã»ÓÐelseÓï¾ä²¶»ñÆäËûµÄÌõ¼þ
cursor_already_open ora-06511 -6511 ³ÌÐòÊÔͼ´ò¿ªÒ»¸öÒѾ­´ò¿ªµÄÓαê
timeout_on_resource ora-00051 -51 ϵͳÔڵȴýijһ×ÊÔ´£¬Ê±¼ä³¬Ê±
Èç¹ûÒª´¦ÀíδÃüÃûµÄÄÚ²¿Òì³££¬±ØÐëʹÓÃOTHERSÒì³£´¦ÀíÆ÷»òPRA


Ïà¹ØÎĵµ£º

oracle ´æ´¢¹ý³Ì

 select myFunc(²ÎÊý1,²ÎÊý2..) to dual; --¿ÉÒÔÖ´ÐÐһЩҵÎñÂß¼­
Ò»:OracleÖеĺ¯ÊýÓë´æ´¢¹ý³ÌµÄÇø±ð:
A:º¯Êý±ØÐëÓзµ»ØÖµ,¶ø¹ý³ÌûÓÐ.
B:º¯Êý¿ÉÒÔµ¥¶ÀÖ´ÐÐ.¶ø¹ý³Ì±ØÐëͨ¹ýexecuteÖ´ÐÐ.
C:º¯Êý¿ÉÒÔǶÈëµ½SQLÓï¾äÖÐÖ´ÐÐ.¶ø¹ý³Ì²»ÐÐ.
ÆäʵÎÒÃÇ¿ÉÒÔ½«±È½Ï¸´ÔӵIJéѯд³Éº¯Êý.È»ºóµ½´æ´¢¹ý³ÌÖÐÈ¥µ÷ÓÃÕâЩº¯Êý.
¶þ:È ......

Oracle OCI programming and Borland C++ Builder

As you may know, Oracle dropped support for Borland Compilers in OCI
some time back. Well, it isn't all that hard to set up again.
I'm running 9i Release 2 Enterprise Edition on this PC at work and I am
using Borland C++ Builder 6 to 'play' with OCI programming - I intend to
build a set of compo ......

OracleÊý¾Ý¿âÖеÄ''ÓëNULLµÄ¹Øϵ

ÔÚOracleÊý¾Ý¿âÖÐ''ÓëNULLÊǵȼ۵ġ£¾ù±íʾ¿ÕÖµ£¬¶ø²»ÊÇÀàËÆÆäËûÊý¾Ý¿âÉÏ''±íʾ¿Õ´®£¬NULL±íʾ¿ÕÖµ¡£
 
ORACLEÔÊÐíÈκÎÒ»ÖÖÊý¾ÝÀàÐ͵Ä×Ö¶ÎΪ¿Õ£¬³ýÁËÒÔÏÂÁ½ÖÖÇé¿ö£º
1¡¢Ö÷¼ü×ֶΣ¨primary key£©£¬
2¡¢¶¨ÒåʱÒѾ­¼ÓÁËNOT NULLÏÞÖÆÌõ¼þµÄ×Ö¶Î
 
˵Ã÷£º
1¡¢NULLµÈ¼ÛÓÚûÓÐÈκÎÖµ¡¢ÊÇδ֪Êý¡£
2¡¢NULLÓë ......

OracleÊý¾Ý¿â×Ô¶¨ÒåÒì³£µÄʹÓ÷½·¨

 À´Ô´£º²»Ïê  ×÷ÕߣºØýÃû  Ê±¼ä£º2009-9-6 17:14:04 Tags£º Orac ʹÓ÷½·¨
ÐèÇó£ºÒµÎñÂß¼­ÔÚ´¦ÀíÊý¾Ýʱ£¬ÐèÒª·µ»ØMessage²¢×èÖ¹³ÌÐòµÄ¼ÌÐøÔËÐС£µ«ÊÇ£¬ÔÚ´æ´¢¹ý³ÌʹÓÃOracleÊý¾Ý¿âµÄRaise¸ù±¾ÎÞ·¨Âú×ãÏÖÔÚµÄÒªÇó¡£
½â¾ö·½·¨£º
ʹÓÃRAISE_APPLICATION_ERROR
RAISE_APPLICATION_ERROR ( erro ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ