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

oracle Óαê

1.       Óαê: ÈÝÆ÷£¬´æ´¢SQLÓï¾äÓ°ÏìÐÐÊý¡£
2.       ÓαêÀàÐÍ: ÒþʽÓα꣬ÏÔʾÓα꣬REFÓαꡣÆäÖУ¬ÒþʽÓαêºÍÏÔʾÓαêÊôÓÚ¾²Ì¬Óα꣨ÔËÐÐÇ°½«ÓαêÓëSQLÓï¾ä¹ØÁª£©,REFÓαêÊôÓÚ¶¯Ì¬Óαê(ÔËÐÐʱ½«ÓαêÓëSQLÓï¾ä¹ØÁª)¡£
3.       ÒþʽÓαê: DMLÓï¾ä¶ÔÓ¦µÄÓα꣬ÓÉOracle×Ô¶¯¹ÜÀí£¬Ò²³ÆSQLÓαꡣ£¨ËùÓеÄDML²Ù×÷¶¼±»OracleÄÚ²¿½âÎöΪһ¸öcursorÃûΪSQLµÄÒþʽÓα꣩
--      ÒþʽÓαêµÄÊôÐÔÓУº
--     %FOUND – SQL Óï¾äÓ°ÏìÁËÒ»Ðлò¶àÐÐʱΪ TRUE
--    %NOTFOUND – SQL Óï¾äûÓÐÓ°ÏìÈκÎÐÐʱΪTRUE
--    %ROWCOUNT – SQL Óï¾äÓ°ÏìµÄÐÐÊý
--    %ISOPEN - ÓαêÊÇ·ñ´ò¿ª£¬Ê¼ÖÕΪFALSE
declare aid a.name%type:='liaomin';  --a.name¼´±íaµÄname×ֶΠÕâÑù¶¨Òå¿ÉÒÔ²»ÐèÒªÖªµÀÀàÐÍ
begin
    update a set name='liaomin1' where name=aid;
    --ÒþʽÓαêÔÚÖ´ÐÐÉÏÃæÓï¾ä¾ÍÒѾ­Í£Ö¹ ËùÓÐÕâÀïÊDz»ÖªµÀÊÇ·ñ´ò¿ªµÄ
    if(SQL%isopen) then
        dbms_output.put_line('´ò¿ªÓαê');
    end if;
    --ÒþÊ¿ÓαêµÄÐÅÏ¢¶¼ÔÚSQL±äÁ¿ÖÐ Èç¹ûupdateµÄÊý¾ÝÓжàÌõ¼Ç¼ SQL¾ÍÖ¸Ïò×îºóÒ»Ìõ
    if(SQL%notfound) then
        dbms_output.put_line('ûÓÐ');
    end if;
    if(SQL%found) then
        dbms_output.put_line('ÕÒµ½');
    end if;
end;
ÏÔʾÓαê²Ù×÷:
                  (1)ÉùÃ÷Óα꣨¹ØÁªSQLÓï¾ä£©    cursor+ÓαêÃû is/as sqlÓï¾ä
                  (2)´ò¿ªÓαִ꣨ÐÐSQLÓï¾ä£¬Ìî³äÓα꣩    open+ÓαêÃû
                 


Ïà¹ØÎĵµ£º

oracle´æ´¢¹ý³ÌʵÀý

ÈÏʶ´æ´¢¹ý³ÌºÍº¯Êý
´æ´¢¹ý³ÌºÍº¯ÊýÒ²ÊÇÒ»ÖÖPL/SQL¿é£¬ÊÇ´æÈëÊý¾Ý¿âµÄPL/SQL¿é¡£µ«´æ´¢¹ý³ÌºÍº¯Êý²»Í¬ÓÚÒѾ­½éÉܹýµÄPL/SQL³ÌÐò£¬ÎÒÃÇͨ³£°ÑPL/SQL³ÌÐò³ÆΪÎÞÃû¿é£¬¶ø´æ´¢¹ý³ÌºÍº¯ÊýÊÇÒÔÃüÃûµÄ·½Ê½´æ´¢ÓÚÊý¾Ý¿âÖеġ£ºÍPL/SQL³ÌÐòÏà±È£¬´æ´¢¹ý³ÌÓкܶàÓŵ㣬¾ßÌå¹éÄÉÈçÏ£º
* ´æ´¢¹ý³ÌºÍº¯ÊýÒÔÃüÃûµÄÊý¾Ý¿â¶ÔÏóÐÎʽ´æ´¢ ......

Éî¶È¶Ô±ÈOracleÓëSQL Server——µÚÒ»²¿·Ö

²Ù×÷ϵͳµÄÖ§³Ö °æ±¾ºÍ·¢Ðаæ ʵÀý¡¢Êý¾Ý¿âºÍ±í¿Õ¼ä ʵÀýÃûºÍSID ϵͳÊý¾Ý¿âºÍϵͳ±í¿Õ¼ä
Ò»°ãµÄ¹«Ë¾Í¨³£»áÔÚËûÃǵÄÐÅϢϵͳ¼Ü¹¹ÖÐÒýÈë¶àÖÖÊý¾Ý¿âƽ̨£¬Í¬Ê±ÒýÈëÈýµ½ËÄÖÖ²»Í¬µÄRDBMS½â¾ö·½°¸µÄÖдóÐ͹«Ë¾Ò²²¢²»ÉÙ¼û£¬µ±È»ÕâЩ¹«Ë¾ÀïÃæµÄDBAÃÇͨ³£Ò²ÐèҪͬʱӵÓйÜÀí¶àÖÖ²»Í¬Æ½Ì¨µÄ¼¼ÄÜÁË¡£
Ö»ÔÚÒ»ÖÖƽ̨ÉÏÕ¹¿ª¹¤×÷µÄÊý¾Ý ......

ת SQL server ÓëOracle¿ª·¢±È½Ï

Ô­ÎĵØÖ·£ºhttp://www.cnblogs.com/wangxiaohuo/archive/2008/04/20/1162631.html
 
±¾ÎĵµÖ÷Òª´ÓoracleÓësql serverÓï·¨ÉϽøÐвîÒìÐԱȽϣ¬ÖîÈçÁ½ÕßÔÚ¹ÜÀí£¬ÐÔÄÜ£¬ÓÅ»¯µÈ·½ÃæµÄ²îÒì²»×÷±È½Ï¡£
¡ñ¸ÅÄîÉÏÇø±ð
   1.Oracle ÊÇÒ»ÖÖ¶ÔÏó¹ØϵÊý¾Ý¿â¹ÜÀíϵͳ£¨ORDBMS),¶øSql server Ö»ÊǹØϵÐÍÊý¾Ý¿â¹Ü
&nbs ......

ORACLE Óë mysql µÄÇø±ð

1.ÔÚORACLEÖÐÓÃselect * from all_usersÏÔʾËùÓеÄÓû§£¬¶øÔÚMYSQLÖÐÏÔʾËùÓÐÊý¾Ý¿âµÄÃüÁîÊÇshow
databases¡£¶ÔÓÚÎÒµÄÀí½â£¬ORACLEÏîÄ¿À´ËµÒ»¸öÏîÄ¿¾ÍÓ¦¸ÃÓÐÒ»¸öÓû§ºÍÆä¶ÔÓ¦µÄ±í¿Õ¼ä£¬¶øMYSQLÏîÄ¿ÖÐÒ²Ó¦¸ÃÓиöÓû§ºÍÒ»¸ö¿â¡£ÔÚ
ORACLE(db2Ò²Ò»Ñù)Öбí¿Õ¼äÊÇÎļþϵͳÖеÄÎïÀíÈÝÆ÷µÄÂß¼­±íʾ£¬ÊÓͼ¡¢´¥·¢Æ÷ºÍ´æ´¢¹ý³ÌÒ²¿É ......

ORACLEÊý¾Ý×Öµä

²é¿´µ±Ç°Óû§µÄȱʡ±í¿Õ¼ä
 SQL>select username,default_tablespace from user_users;
        ²é¿´µ±Ç°Óû§µÄ½ÇÉ«
        SQL>select * from user_role_privs;
        ²é¿´µ±Ç°Óû§µÄÏµÍ³È ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ