oracle £º´æ´¢¹ý³ÌºÍº¯ÊýµÄ¼¸ÖÖд·¨
¹ØÓÚ´æ´¢¹ý³ÌºÍº¯ÊýµÄ¶¨ÒåÍøÉÏÒ»ËÑÒ»´ó°Ñ£¬ÕâÀï¾Í²»ÌØÊâ½éÉÜÁË£¬ÕâÀï¾ÍÖ»¶ÔÎÒ×Ô¼ºÐ´µÄ¼¸ÖÖ¸ñʽµÄ´æ´¢¹ý³ÌºÍº¯Êý×öһЩ×ܽᣬϣÍû¶Ô´ó¼ÒÓеã°ïÖú¡£
Ò»£º´æ´¢¹ý³Ì
1£º×îÆÕͨµÄÒ»ÖÖ¡££¨´«²Î£¬²éѯÓαִ꣬ÐУ¬Ñ»·Óαê×ö²åÈ붯×÷£©¡£
create or replace procedure zy2040_sirole(rolekey in varchar2) is
roleid varchar2(30);
cursor cur_zy2040_department_id(rolekeys in varchar2) is
select distinct d.department_id
from si a, si_staff b, sec_staff c, sec_department d
where a.siid = b.siid
and b.staffid = c.staff_id
and c.department_id = d.department_id
and a.provinceid = '0'
and a.si_status in ('A', 'W')
and d.department_id not in
(select a.department_id
from sec_department_role a, sec_role b
where a.role_id = b.role_id
and b.role_key = rolekeys);
cursor cur_zy2040_staffid(rolekeys in varchar2) is
select distinct b.staffid, d.department_id
from si a, si_staff b, sec_staff c, sec_department d
where a.siid = b.siid
and b.staffid = c.staff_id
and c.department_id = d.department_id
and a.provinceid = '0'
and a.si_status in ('A', 'W')
and b.staffid not in (select a.staff_id
&nb
Ïà¹ØÎĵµ£º
C:\Documents and Settings\Administrator>sqlplus/nolog
SQL> CONNECT/AS SYSDBA
SQL> SHUTDOWN NORMAL/IMMEDIATE
SQL> STARTUP MOUNT
SQL> ARCHIVE LOG LIST
SQL> ALTER DATA ......
rownum ÕæµÄÊǺܺõĶ«Î÷£¬ÏÖÔÚ´ó¶àÊýÓÃÓÚ´æ´¢¹ý³Ì·ÖÒ³. µ«ÔõôÓÃÄØ£¿Õâ¾ÍÀ´Ñо¿Ò»Ï¡£ ºÙºÙ
--- ÒÔÏÂΪתÔØÖ®´¦£¬½ö¹©Ñ§Ï°
¶ÔÓÚrownumÀ´ËµËüÊÇoracleϵͳ˳Ðò·ÖÅäΪ´Ó²éѯ·µ»ØµÄÐеıàºÅ£¬·µ»ØµÄµÚÒ»ÐзÖÅäµÄÊÇ1£¬µÚ¶þÐÐÊÇ2£¬ÒÀ´ËÀàÍÆ£¬Õâ¸öα×ֶοÉÒÔÓÃÓÚÏÞÖƲéѯ·µ»ØµÄ×ÜÐÐÊý£¬¶øÇÒrownum²»ÄÜÒÔÈκαíµÄà ......
¶ÔÓÚrownumÀ´ËµËüÊÇoracleϵͳ˳Ðò·ÖÅäΪ´Ó²éѯ·µ»ØµÄÐеıàºÅ£¬·µ»ØµÄµÚÒ»ÐзÖÅäµÄÊÇ1£¬µÚ¶þÐÐÊÇ2£¬ÒÀ´ËÀàÍÆ£¬Õâ¸öα×ֶοÉÒÔÓÃÓÚÏÞÖƲéѯ·µ»ØµÄ×ÜÐÐÊý£¬¶øÇÒrownum²»ÄÜÒÔÈκαíµÄÃû³Æ×÷Ϊǰ׺¡£
¾ÙÀý˵Ã÷£º
ÀýÈç±í£ºstudent(ѧÉú)±í£¬±í½á¹¹Îª£º
ID¡¡¡¡¡¡ char(6)¡¡¡¡¡¡¡¡¡¡ --ѧºÅ
name¡¡¡¡¡¡¡¡VA ......