ÔÚOracleÊý¾Ý¿â´´½¨½Å±¾ÖÐÈçºÎ³õʼ»¯Ä³Ð©±í
Sample
±í¿Õ¼ä£ºIMPTEMP
±í£ºRoles ¡¢Users
ͨ¹ýPL/SQLµ¼³öµÄÊý¾Ý¿â½Å±¾
-----------------------------------------------------
-- Export file for user IMPTEMP --
-- Created by Administrator on 2010-1-29, 14:14:25 --
-----------------------------------------------------
spool sample.log
prompt
prompt Creating table ROLES
prompt ====================
prompt
create table IMPTEMP.ROLES
(
ROLENAME NVARCHAR2(50) not null,
ROLEXML NCLOB
)
tablespace IMPTEMP
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
alter table IMPTEMP.ROLES
add constraint ROLES_PRIMARY_KEY primary key (ROLENAME)
using index
tablespace IMPTEMP
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
prompt
prompt Creating table USERS
prompt ====================
prompt
create table IMPTEMP.USERS
(
USERID NVARCHAR2(50) not null,
USERNAME NVARCHAR2(50),
ROLENAME NVARCHAR2(50),
PASSWORD NVARCHAR2(50),
USERXML NCLOB,
USERDN NVARCHAR2(100),
ISLOCAL NUMBER(1)
)
tablespace IMPTEMP
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
comment on column IMPTEMP.USERS.ISLOCAL
is '0-ISNOTLOCAL : 1-ISLOCAL';
alter table IMPTEMP.USERS
add constraint USERS_PRIMARY_KEY primary key (USERID)
using index
tablespace IMPTEMP
pctfree 10
initrans 2
Ïà¹ØÎĵµ£º
Èç¹û²»ÊÇÒòΪÕâ´Î»»hisµÄ·þÎñÆ÷£¬¹À¼ÆÎÒÒ»Ö±Ò²²»»áÓöµ½Õâ¸öÎÊÌ⣬һֱ¾õµÃoracleºÜ¸ßÉ¶ÔËüҲûÓÐÑо¿£¬¿ÉÕâ´Î»»·þÎñÆ÷£¬Æ«Æ«ÈÃÎÒÓöµ½ÁËÒ»¸öÎÊÌ⣬ÕÛÄ¥ÁËÕûÕûÁ½Ì죬ÖÕÓÚÔÚ×òÌì½â¾öµôÁË£¬¼Ç¼ÏÂÀ´£¬ÒÔ±¸ÒÔºóËùÓá£
ÖÜÎåÍíÉÏ»»ÁË·þÎñÆ÷£¬ÖÜÒ»ÔçÉÏ·¢ÏÖ³¬ÉùµÄ¹¤×÷Õ ......
ÔÚlinuxÏÂÆô¶¯oracle ºÍÔÚwindowsÊÇÓвî±ðµÄ£¬¶ÔÓÚÒ»°ãÔÚwindowsϲÙ×÷ϰ¹ßÈËÓкܶ಻ÊÊÓ¦£¬ËùÒÔÎÒÌØ±ðдÕâÑùÎÄÕ£¬ÒÔ·½±ãÐÂÊÖ½øÐвÙ×÷£¬ÏÂÃæ¾ÍÒ»²½Ò»²½½²½âÆô¶¯¹ý³Ì¡£
1.ͨ¹ýÖÕ¶ËÁ¬½Óµ½linux·þÎñÆ÷,µ±È»ÕâÑùµÄÈí¼þºÜ¶àÀýÈçputty,SecureCRT,²¢ÒÔoracleÓû§½øÐеǼ£¬·ñÔòÆô¶¯oracleʱ»á´íµÄ£¬Ã»ÓÐȨÏÞÆô¶¯.(Ò²¿ÉÓû§root µ ......
SQL> select * from ta;
ID NAME
---------- --------------------
1 gorey
2 gorey2
SQL> select * from tb;
I ......
ת×Ô£ºhttp://download.oracle.com/docs/cd/B13789_01/server.101/b10759/statements_6004.htm
Creating User-Defined Operators: Example
This example creates a very simple functional implementation of equality and then creates an operator that uses the function:
CREATE FUNCTION eq_f(a VARCHAR2, b VARCHA ......