ORACLE PL/SQL ¼¯ºÏAPI ×ܽá
ORACLE 10GµÄ¼¯ºÏAPI
¼¯ºÏAPI·½·¨×îÔçÊÇÔÚORACLE 8IÖÐÒýÈëµÄ¡£¼¯ºÏAPIÌṩÁ˼ò»¯·ÃÎʼ¯ºÏµÄ·½·¨¡£ÔÚORACLE 10GÒÔÇ°£¬ÕâЩ·½·¨È·Êµ¼ò»¯Á˶Լ¯ºÏµÄ·ÃÎÊ¡£µ«ÊÇ£¬²¢²»ÊÇ·ÇÒªÇóÕÆÎÕÕâЩ·½·¨²»¿É¡£´ÓORACLE 9IµÄINDEX-BY±íµ½ORACLE 10GµÄÁªºÏÊý×éµÄת»»£¬Ê¹ËüÃdzÉΪ±ØÐëÕÆÎյķ½·¨¡£
ÏÂÃæÊÇÎÒ´ÓÊéÉÏժ¼ÏµÄһЩ¼¯ºÏAPI£¬ÀÛËÀÎÒÁË……ÏëÉÏÍøÕÒ¸öͼ»¹Ã»ÓС£
·½·¨Ãû³Æ
˵Ã÷
·µ»ØÖµµÄÀàÐÍ
ËùÖ§³Ö¼¯ºÏµÄÀàÐÍ
COUNT
COUNT·½·¨·µ»ØµÄÊÇVARRAYºÍǶÌ×±íÖÐÒѾ·ÖÅäÁË´æ´¢¿Õ¼äµÄÔªËصÄÊýÄ¿¡£ÔÚÁªºÏÊý×éÉÏʹÓÃÕâ¸ö·½·¨Ê±£¬Ëü·µ»ØÁªºÏÊý×éÖÐÔªËصÄÊýÄ¿¡£COUNT·½·¨¿ÉÄÜ»á±ÈVARRAYµÄLIMIT·½·¨ÒªÐ¡¡£
PLS_INTEGER
ËùÓм¯ºÏÀàÐÍ
DELETE(n)
DELETE·½·¨´øÓÐÒ»¸öÖØÔصÄÐÎʽ²ÎÊý£¬ÐÎʽ²ÎÊýµÄÀàÐÍΪPLS_INTEGER¡¢VARCHAR2»òLONGÀàÐÍ¡£Õâ¸öÐÎʽ²ÎÊý¶ÔÓ¦µÄÊǼ¯ºÏÖÐÔªËصÄϱꡣËüÊÇÒ»¸ö¹ý³Ì£¬Ã»Óзµ»ØÖµ¡£
ÎÞ·µ»ØÖµ
ËùÓм¯ºÏÀàÐÍ
DELETE(n,m)
DELETE·½·¨´øÓÐÒ»¸öÖØÔصÄÐÎʽ²ÎÊý£¬ÐÎʽ²ÎÊýµÄÀàÐÍΪPLS_INTEGER¡¢VARCHAR2»òLONGÀàÐÍ¡£ÕâÁ½¸öÐÎʽ²ÎÊý·Ö±ð¶ÔÓ¦µÄÊÇ×îСºÍ×î´óϱꡣÕâÁ½¸ö²ÎÊýÉ趨Á˼¯ºÏÖÐÔªËصİüº¬·¶Î§¡£ËüÊÇÒ»¸ö¹ý³Ì£¬Ã»Óзµ»ØÖµ¡£
ÎÞ·µ»ØÖµ
ËùÓм¯ºÏÀàÐÍ
EXISTS(n)
EXISTS·½·¨ÅжÏij¸öÔªËØÊÇ·ñ´æÔÚÓÚ¼¯ºÏÖС£Ëü´øÓÐÒ»¸öÖØÔصÄÐÎʽ²ÎÊý£¬ÐÎʽ²ÎÊýµÄÊý¾ÝÀàÐÍΪPLS_INTEGER¡¢VARCHAR2»òLONGÀàÐÍ¡£Õâ¸öÐÎʽ²ÎÊý¶ÔÓ¦µÄÊǼ¯ºÏÖÐÔªËصÄϱꡣ¼´Ê¹Õâ¸ö¼¯ºÏÊÇÒ»¸ö¿ÕÔªËؼ¯ºÏ£¬µ÷ÓÃEXISTS·½·¨Ò²²»»áÒý·¢COLLECTION_IS_NULLÒì³£
TRUE»òFALSE
ËùÓм¯ºÏÀàÐÍ
EXTEND
EXTEND·½·¨Îª¼¯ºÏÖеÄÐÂÔªËØ·ÖÅä´æ´¢¿Õ¼ä¡£ËüÓÃÔÚÏò¼¯ºÏÌí¼ÓÖµÒÔÇ°£¬Îª¸ÃÖµ·ÖÅä´æ´¢¿Õ¼ä¡£Èç¹ûÊÔͼ·ÖÅä¿Õ¼äµÄÔªËس¬¹ýÁËVARRAYµÄLIMIT·µ»ØÖµ£¬¸Ã·½·¨¾Í»áʧ°Ü¡£
ûÓзµ»ØÖµ
VARRAY»òǶÌ×±í
EXTEND(n)
EXTEND·½·¨Îª¼¯ºÏÖеĶà¸öÐÂÔªËØ·ÖÅä´æ´¢¿Õ¼ä¡£Ëü´øÓÐÒ»¸öÐÎʽ²ÎÊý£¬ÐÎʽ²ÎÊýµÄÊý¾ÝÀàÐÍΪPLS_INTEGERÀàÐÍ¡£ËüÓÃÔÚÏò¼¯ºÏÌí¼ÓÖµÒÔÇ°£¬Îª¸ÃÖµ·ÖÅä´æ´¢¿Õ¼ä¡£Èç¹ûÊÔͼ·ÖÅä¿Õ¼äµÄÔªËس¬¹ýÁËVARRAYµÄLIMIT·µ»ØÖµ£¬¸Ã·½·¨¾Í»áʧ°Ü¡£
ûÓзµ»ØÖµ
VARRAY»òǶÌ×±í
EXTEND(n,i)
EXTEND·½·¨Îª¼¯ºÏÖеĶà¸öÐÂÔªËØ·ÖÅä´æ´¢¿Õ¼ä¡£Ëü´øÓÐÁ½¸öÐÎʽ²ÎÊý£¬ÕâÁ½¸öÐÎʽ²ÎÊýÀàÐ;ùΪPLS_INTEGERÀàÐÍ¡£µÚÒ»¸ö²ÎÊý±íʾҪÌí¼Ó¶àÉÙ¸öÐÂÔªËØ£¬µÚ¶þ¸ö²ÎÊýÊÇÒýÓü¯ºÏÖÐÒÑÓеÄÔªËØ£¬¸ÃÔªËػᱻ¸´ÖƵ½ÐÂÔªËØÉÏ¡£Èç¹ûÊÔͼ·ÖÅä¿Õ¼äµÄÔªËس¬¹ýÁËVARRAYµÄLIMIT·µ»ØÖµ£¬¸Ã·½·¨¾Í»áʧ°Ü¡£
Ïà¹ØÎĵµ£º
ÍêȫжÔØOracle·½·¨£º
Èí¼þ»·¾³£º
1¡¢Windows XP + Oracle 10g
2¡¢Oracle°²×°Â·¾¶Îª£ºd:\Oracle
1¡¢Èç¹ûÊý¾Ý¿âÅäÖÃÁË×Ô¶¯´æ´¢¹ÜÀí(ASM),Ó¦¸ÃÏÈɾ³ý¾Û¼¯Í¬²½·þÎñCSS£¨cluster Synchronization Services).ɾ³ýCSS·þÎñµÄ·½·¨ÊÇÔÚDOSÃüÁîÐÐÖÐÖ´ÐÐÈçÏÂÃüÁ localconfig delete
2¡¢ÔÚ“·þÎñ”´°¿ÚÖÐÍ£ ......
µÚÒ»²½¡¢¼ì²é²Ù×÷ϵͳ»·¾³
rpm -q gcc make binutils openmotif glibc setarch compat-db compat-gcc-34 openmotif compat-gcc-34-c++ compat-libstdc++-33
Èç¹û¼ì²âµ½Äĸö°üûÓÐ×°£¬Ôò·Ö±ðÔÚISO¾µÏñÎļþÖÐÕÒµ½½øÐа²×°
¹ÒÔØ6ÕÅ»ò7ÕÅISOÎļþ£¬
±ÈÈç˵£ºrpm -ivh /mnt/iso/3/CentOS/openmotif*
Ö»ÒªÊÇûÓÐ×°µÄ¶¼Òª½øÐа ......
½¨±í
create table users(
id number(4) primary key,
username varchar2(10),
password varchar2(10)
)
²éѯ±í²¢½âËø±í(¼´¿ÉÒÔµã»÷ÊäÈë¿òÏÂÃæµÄ"Ëø"ͼ±ê¹¤¾ß, ¼´"Edit data")
select * from users for update
ɾ³ý±íÖжàÓàµÄÁÐ
alter table mobilephone drop column mobiletype
תÔØ
------------------- ......
¶þ¡¢ÒÔÐβεÄÐÎʽ¶¨ÒåºÍʹÓüǼ¡¢¶ÔÏóÀàÐÍ
ÔÚÓÃ×÷ÐÎʽ²ÎÊýʱ£¬¼Ç¼ÀàÐͺͶÔÏóÀàÐÍÓкܶàÏà֮ͬ´¦¡£ÔÚ½«ËüÃÇ×÷ΪÓαꡢº¯Êý»ò¹ý³ÌµÄÐÎʽ²ÎÊýÒÔÇ°£¬ÊÂÏȶ¼±ØÐ붨ÒåÒ»¸ö¼Ç¼ÀàÐÍ»òÕ߶ÔÏóÀàÐÍ¡£
ÈçÏÂÀýËùʾ£º
¼Ç¼
DECLARE
-- Define a record type.
TYPE individual_record IS RECORD
(individual_id ......