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

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 to_date,to_char,trunc,decodeÓ÷¨

select decode('X','Q','±äÁ¿1','±äÁ¿2') from dual
¡¡select sysdate,to_char(sysdate,’yyyy-mm-dd hh24:mi:ss’) from dual
¡¡
¡¡select to_date(’2003-10-17 21:15:37’,’yyyy-mm-dd hh24:mi:ss’) from dual  
ÈÕÆÚ¸ñʽ²ÎÊý º¬Òå˵Ã÷
D Ò»ÖÜÖеÄÐÇÆÚ¼¸
DAY ÌìµÄÃû ......

OracleÊý¾Ý¿â±¸·Ý¼¼ÇÉ

¡¡¡¡oracle% sqlplus /nolog
¡¡¡¡SQL> conn / as sysdba
¡¡¡¡Êý¾Ý¿âµÄÎïÀíÎļþ
¡¡¡¡Êý¾ÝÎļþ
¡¡¡¡select file_name from dba_data_files;
¡¡¡¡¿ØÖÆÎļþ
¡¡¡¡select name from v$controlfile;
¡¡¡¡ÈÕÖ¾Îļþ
¡¡¡¡select member from v$logfile;
¡¡¡¡---------------------------------------------------------
......

oracle 10.2g ÔÚCentOS 5.1µÄ°²×°¹ý³Ì

µÚÒ»²½¡¢¼ì²é²Ù×÷ϵͳ»·¾³
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*
Ö»ÒªÊÇûÓÐ×°µÄ¶¼Òª½øÐа ......

SQLÓï¾ä´ó·¨

 SQLÓïÑÔÓÉÃüÁî¡¢×Ӿ䡢ÔËËãºÍ¼¯ºÏº¯ÊýµÈ¹¹³É¡£ÔÚSQLÖУ¬Êý¾Ý¶¨ÒåÓïÑÔDDL£¨ÓÃÀ´½¨Á¢¼°¶¨ÒåÊý¾Ý±í¡¢×Ö¶ÎÒÔ¼°Ë÷ÒýµÈÊý¾Ý¿â½á¹¹£©°üº¬µÄÃüÁîÓÐCREATE¡¢DROP¡¢ALTER£»Êý¾Ý²Ù×ÝÓïÑÔDML£¨ÓÃÀ´ÌṩÊý¾ÝµÄ²éѯ¡¢ÅÅÐòÒÔ¼°É¸Ñ¡Êý¾ÝµÈ¹¦ÄÜ£©°üº¬µÄÃüÁîÓÐSELECT¡¢INSERT¡¢UPDATE¡¢DELETE¡£
Ò»¡¢SQLÓï¾ä
£¨1£©Select ²éѯÓï¾ä
Óï ......

ORACLE PL/SQL ¼Ç¼(Record)ѧϰ±Ê¼Ç(¶þ)

¶þ¡¢ÒÔÐβεÄÐÎʽ¶¨ÒåºÍʹÓüǼ¡¢¶ÔÏóÀàÐÍ
ÔÚÓÃ×÷ÐÎʽ²ÎÊýʱ£¬¼Ç¼ÀàÐͺͶÔÏóÀàÐÍÓкܶàÏà֮ͬ´¦¡£ÔÚ½«ËüÃÇ×÷ΪÓαꡢº¯Êý»ò¹ý³ÌµÄÐÎʽ²ÎÊýÒÔÇ°£¬ÊÂÏȶ¼±ØÐ붨ÒåÒ»¸ö¼Ç¼ÀàÐÍ»òÕ߶ÔÏóÀàÐÍ¡£
ÈçÏÂÀýËùʾ£º
 
¼Ç¼
DECLARE

-- Define a record type.
TYPE individual_record IS RECORD
(individual_id ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ