[Oracle]¸ßЧµÄPL/SQL³ÌÐòÉè¼Æ(Èý)
±¾ÏµÁÐÎÄÕµ¼º½
[Oracle]¸ßЧµÄPL/SQL³ÌÐòÉè¼Æ(Ò»)--αÁÐROWNUMʹÓü¼ÇÉ
[Oracle]¸ßЧµÄPL/SQL³ÌÐòÉè¼Æ(¶þ)--±êÁ¿×Ó²éѯ
[Oracle]¸ßЧµÄPL/SQL³ÌÐòÉè¼Æ(Èý)--PackageµÄÓŵã
[Oracle]¸ßЧµÄPL/SQL³ÌÐòÉè¼Æ(ËÄ)--ÅúÁ¿´¦Àí
[Oracle]¸ßЧµÄPL/SQL³ÌÐòÉè¼Æ(Îå)--µ÷Óô洢¹ý³Ì·µ»Ø½á¹û¼¯
[Oracle]¸ßЧµÄPL/SQL³ÌÐòÉè¼Æ(Áù)--%ROWTYPEµÄʹÓÃ
ʹÓÃPackageµÄÓŵãÔÚÓÚÌṩÁ˱ØÐèµÄ³ÌÐòÉè¼Æ½á¹¹, ´Ù½øÁËÄ£¿é»¯±à³ÌÉè¼Æ, ×îÖØÒªµÄÊÇPackage¶Ï¿ªÁËÒÀÀµÁ´, ʹµÃ¶Ôij¸öÊý¾Ý¿âģʽµÄ¸Ä¶¯²»»áµ¼ÖÂÕû¸öģʽµÄÎÞЧ,´Ó¶ø±ÜÃâÁË°º¹óµÄÖرàÒë!
ÀýÈç: ´æÔÚtable t , procedure p1 p2, view v, function f, ËüÃÇÖ®¼äÒýÓùØϵÈçÏ£º
select name,type,referenced_name,referenced_type from user_dependencies
where referenced_owner='SCOTT'
order by name;
F FUNCTION T TABLE
P1 PROCEDURE V VIEW
P2 PROCEDURE P1 PROCEDURE
V VIEW T TABLE
µ±alter table t add y numberʱ, ÒÀÀµÓÚtµÄËùÓжÔÏó(°üÀ¨´«µÝÒÀÀµµÄ¶ÔÏó, ¼´p1ÒÀÀµÓÚt, p2ÒÀÀµÓÚp1)¾ÍÈ«²¿ÎÞЧ, ÐèÒªÖØбàÒë(Èç¹û´úÂëºÜ¸´ÔÓ, ¾Í»áÓнϴóµÄÏûºÄ)
select user_objects.object_name,user_objects.object_type,user_objects.status from user_objects
F FUNCTION INVALID
P1 PROCEDURE INVALID
&
Ïà¹ØÎĵµ£º
ÔÚʹÓÃODP.NET½øÐÐOracle±à³Ìʱ£¬ÓÐʱºòSQLÓï¾ä·Ç³£¸´ÔÓ£¬ÐèÒª²ÉÓö¯Ì¬¹¹Ôì²éѯÓï¾äµÄÇé¿ö£¬ÓÐÁ½ÖÖ·½·¨¿ÉÒÔ¹¹Ô춯̬µÄSQLÓï¾ä£¬²¢Ö´Ðзµ»Ø½á¹û¼¯¡£
1¡¢ÔÚÊý¾Ý·ÃÎʲ㹹ÔìSQLÓï¾ä
ÀýÈçÏÂÃæµÄÓï¾ä£¬½«¹¹ÔìÍêÕûµÄSQLÓï¾ä¸³Öµ¸øCommandText£¬ÔÙ´«µÝµ½Êý¾Ý¿â½øÐÐÖ´ÐУ¬·µ»Ø½á¹û¼¯¡£
loadCommand.CommandType = Com ......
±¾ÏµÁÐÎÄÕµ¼º½
[Oracle]¸ßЧµÄSQLÓï¾äÖ®·ÖÎöº¯Êý(Ò»)--sum()
[Oracle]¸ßЧµÄSQLÓï¾äÖ®·ÖÎöº¯Êý(¶þ)--max()
[Oracle]¸ßЧµÄSQLÓï¾äÖ®·ÖÎöº¯Êý(Èý)--row_number() /rank()/dense_rank()
[Oracle]¸ßЧµÄSQLÓï¾äÖ®·ÖÎöº¯Êý(ËÄ)--lag()/lead()
ʵ¼ÊÓ¦ÓÃÖÐÎÒÃÇ¿ÉÒÔͨ¹ýsum()ͳ¼Æ³ö×éÖеÄ×ܼƻòÕßÊÇÀÛ¼ÓÖµ£¬¾ßÌåʾÀýÈçÏ£º
......
±¾ÏµÁÐÎÄÕµ¼º½
[Oracle]¸ßЧµÄSQLÓï¾äÖ®·ÖÎöº¯Êý(Ò»)--sum()
[Oracle]¸ßЧµÄSQLÓï¾äÖ®·ÖÎöº¯Êý(¶þ)--max()
[Oracle]¸ßЧµÄSQLÓï¾äÖ®·ÖÎöº¯Êý(Èý)--row_number() /rank()/dense_rank()
[Oracle]¸ßЧµÄSQLÓï¾äÖ®·ÖÎöº¯Êý(ËÄ)--lag()/lead()
Èç¹ûÎÒÃÇ°´ÕÕʾÀýÏëµÃµ½Ã¿¸ö²¿ÃÅнˮֵ×î¸ßµÄ¹ÍÔ±µÄ¼Í¼£¬¿ÉÒÔÓÐËÄÖÖ·½·¨ÊµÏÖ£ ......