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

SQLÓï¾äPART5

Confirming granted privileges
Data Dictionary View                Description
ROLE_SYS_PRIVS                System privileges granted to roles
ROLE_TAB_PRIVS                Table privileges granted to roles
USER_ROLE_PRIVS             Roles accessible by the user
USER_SYS_PRIVS               System privileges granted to the user
USER_TAB_PRIVS_MADE     Object privileges granted on the user's objects
USER_TAB_PRIVS_RECD     Object privileges granted to the user
USER_ROLE_PRIVS_MADE  Object privileges granted on the columns of the user's objects
USER_ROLE_PRIVS_RECD:  Object privileges granted to the user on specific columns
Revoking Object Privileges
grammer:
revoke {privileges [, privileges...] | all}
on object from {user [,...user...] | role | pubic} cascade constraints;
// privileges granted to others through the WITH GRANT OPTION clause are also revoked.
 Alter table statement
grammer:
alter table table1 add (column datatype [default expr] [, column datatype]...);
alter table table1 modify (column datatype [default expr] [, column datatype]...);
alter table table1 drop (column);
Alter table (set unused option)
grammer:
alter table <table_name> set unsed (<column_name>);
or
alter table <table_name> set unsed column <column_name>;
then:
alter table <table_name> drop unused columns;
Constraint: Adding a constraint Syntax
grammer:
alter table <table_name> add [constraint <constraint_name>] type (<column_name>);
e.g.:
alter table emp2 modify employee_id primary key;
alter table emp2 add constraint emp_mgr_fk foreign key(manager_id) references emp2(employee_id);


Ïà¹ØÎĵµ£º

Oracle PL/SQL¿é½á¹¹ºÍ×é³ÉÔªËØÑ§Ï°±Ê¼Ç(Ò»)

Ò»£¬PL/SQL¿éµÄ½á¹¹ºÍ×é³ÉÔªËØ
PL/SQL³ÌÐòÓÉÉùÃ÷²¿·Ö£¬Ö´Ðв¿·Ö£¬Òì³£´¦Àí²¿·ÖÈý¸ö²¿·Ö×é³É¡£½á¹¹ÈçÏ£º
DECLARE
/*ÉùÃ÷²¿·Ö£ºÔÚ´ËÉùÃ÷PL/SQL±äÁ¿£¬ÀàÐͼ°Óα꣬ÒÔ¼°¾Ö²¿µÄ´æ´¢¹ý³ÌºÍº¯Êý*/
BEGIN
/*Ö´Ðв¿·Ö£º¹ý³Ì¼°sqlÓï¾ä£¬³ÌÐòÖ÷Òª²¿·Ö£¬ÊDZØÐëµÄ*/
EXCEPTION
/*Òì³£´¦Àí²¿·Ö£º´íÎó´¦Àí*/
END
 
PL/SQL¿ ......

06—PL/SQL±à³Ì

PL/SQL: OracleÖеÄSQL¹ý³Ì»¯±à³ÌÓïÑÔ
1. PL/SQL³ÌÐòÊÇÓÉ¿é½á¹¹¹¹³É£¬¸ñʽÈçÏ£º
  [DECLARE
   --ÉùÃ÷²¿·Ö
¡¡]
  BEGIN
   -- Ö÷Ìå
   [EXCEPTION
     -- Òì³£´¦Àí¿é
   ]
  END;
  /  --¿éµÄ½áÊø
2.±äÁ¿
¼òµ¥±äÁ¿£º ......

ORACLE PL/SQL ´¥·¢Æ÷(trigger)ѧϰ±Ê¼Ç

1¡¢´¥·¢Æ÷µÄ¸ÅÄî
´¥·¢Æ÷Ò²ÊÇÒ»ÖÖ´øÃûµÄPL/SQL¿é¡£´¥·¢Æ÷ÀàËÆÓÚ¹ý³ÌºÍº¯Êý£¬ÒòΪËüÃǶ¼ÊÇÓµÓÐÉùÃ÷¡¢Ö´ÐкÍÒì³£´¦Àí¹ý³ÌµÄ´øÃûPL/SQL¿é¡£Óë°üÀàËÆ£¬´¥·¢Æ÷±ØÐë´æ´¢ÔÚÊý¾Ý¿âÖв¢ÇÒ²»Äܱ»¿é½øÐб¾µØ»¯ÉùÃ÷¡£
¶ÔÓÚ´¥·¢Æ÷¶øÑÔ£¬µ±´¥·¢Ê¼þ·¢ÉúµÄʱºò¾Í»áÏÔʽµØÖ´Ðиô¥·¢Æ÷£¬²¢ÇÒ´¥·¢Æ÷²»½ÓÊܲÎÊý¡£
 
´´½¨´¥·¢Æ÷µÄÓï·¨È ......

ORACLE PL/SQL ¶ÔÏó(object)ѧϰ±Ê¼Ç(Èý)

7¡¢¶ÔÏóÀàÐͼ̳Ð
 
¶ÔÏóÀàÐÍʵÏÖÔÊÐíÎÒÃÇ´´½¨Ò»¸ö»ùÀàÐÍ£¬»ò½Ð¸¸ÀàÐÍ£¬ÕâÖÖÀàÐ͵ÄÊôÐÔ»ò·½·¨¿ÉÒÔ±»ÁíÒ»¸ö¶ÔÏóÀàÐͼ̳С£È»ºó¿ÉÒÔ´´½¨Ò»¸ö×ÓÀàÐÍ£¬»ò½Ðº¢×ÓÀàÐÍ£¬Ö±½ÓʹÓü̳йýÀ´µÄÊôÐÔ»ò·½·¨£¬»òÕßÓÃ×Ô¼ºµÄÊôÐԺͷ½·¨ÖØÐ´¸¸ÀàÐ͵ÄÊôÐÔ»ò·½·¨¡£
 
INSTANTIABLE¹Ø¼ü×Ö±íʾÎÒÃÇ¿ÉÒÔ´Ó¸ÃÀàÐÍÖÐʵÀý»¯»òÕß´´½¨¶ÔÏ ......

SQLÓï¾äPART3

constraint Example:
1. grammer:
 create table [schema.]table
      (column datatype [DEFAULT expr]
     [column_constraint], ...
     [table_constraint] [,......]);
2. example of a column_level constraint:
create table empl ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ