??xml version="1.0" encoding="utf-8" standalone="yes"?>porn视频在线观看,污网站在线看,精品一区二区三区免费毛片爱 http://www.aygfsteel.com/cyantide/archive/2009/09/21/295866.htmlcyantidecyantideMon, 21 Sep 2009 07:04:00 GMThttp://www.aygfsteel.com/cyantide/archive/2009/09/21/295866.htmlhttp://www.aygfsteel.com/cyantide/comments/295866.htmlhttp://www.aygfsteel.com/cyantide/archive/2009/09/21/295866.html#Feedback1http://www.aygfsteel.com/cyantide/comments/commentRss/295866.htmlhttp://www.aygfsteel.com/cyantide/services/trackbacks/295866.html
在PowerDesiger中,在physical data model 中找到菜单中的Database下的Edit current DBMS?选择Script->Sql->FormatQ有一CaseSensitivityUsingQuoteQ它的comment?#8220;Determines if the case sensitivity for identifiers is managed using double quotes”Q表C是否适用双引h规定标识W的大小写,可以看到双的values默认gؓ“YES”,改ؓ“No”Q点凅R应用】按钮?br />    q样再生成sql语句Ӟ表和字段名上是没有引号了?br />

在用PowerDesigner?常常在NAME或Comment中写中文在Code中写英文.Name只会昄l我们看,Code会用在代码?但Comment中的文字会保存到数据库TABLE的Description?有时候我们写好了Name再写一ơComment很麻?以下两段代码可以解册个问?
代码一:Name中的字符COPY至Comment?/font>


'****************************************************************************** 
'
*   File:           name2comment.vbs 
'
*   Purpose:     Database   generation   cannot   use   object   names   anymore   
'
                         in   version   7   and   above. 
'
                         It   always   uses   the   object   codes. 
'
 
'
                         In   case   the   object   codes   are   not   aligned   with   your   
'
                         object   names   in   your   model,   this   script   will   copy   
'
                         the   object   Name   onto   the   object   Comment   for   
'
                         the   Tables   and   Columns. 
'
 
'
*   Title:         
'
*   Version:     1.0 
'
*   Company:     Sybase   Inc.   
'
****************************************************************************** 


Option   Explicit 
ValidationMode   
=   True 
InteractiveMode   
=   im_Batch 

Dim   mdl   '   the   current   model 

'   get   the   current   active   model 
Set   mdl   =   ActiveModel 
If   (mdl   Is   Nothing)   Then 
      
MsgBox   "There   is   no   current   Model " 
ElseIf   Not   mdl.IsKindOf(PdPDM.cls_Model)   Then 
      
MsgBox   "The   current   model   is   not   an   Physical   Data   model. " 
Else 
      ProcessFolder   mdl 
End   If 

'   This   routine   copy   name   into   comment   for   each   table,   each   column   and   each   view 
'
   of   the   current   folder 
Private   sub   ProcessFolder(folder) 
      
Dim   Tab   'running     table 
      for   each   Tab   in   folder.tables 
            
if   not   tab.isShortcut   then 
                  tab.comment   
=   tab.name 
                  
Dim   col   '   running   column 
                  for   each   col   in   tab.columns 
                        col.comment
=   col.name 
                  
next 
            
end   if 
      
next 

      
Dim   view   'running   view 
      for   each   view   in   folder.Views 
            
if   not   view.isShortcut   then 
                  view.comment   
=   view.name 
            
end   if 
      
next 

      
'   go   into   the   sub-packages 
      Dim   f   '   running   folder 
      For   Each   f   In   folder.Packages 
            
if   not   f.IsShortcut   then 
                  ProcessFolder   f 
            
end   if 
      
Next 
end   sub

代码?Comment中的字符COPY至Name?/font>

Option   Explicit 
ValidationMode   
=   True 
InteractiveMode   
=   im_Batch 

Dim   mdl   '   the   current   model 

'   get   the   current   active   model 
Set   mdl   =   ActiveModel 
If   (mdl   Is   Nothing)   Then 
      
MsgBox   "There   is   no   current   Model " 
ElseIf   Not   mdl.IsKindOf(PdPDM.cls_Model)   Then 
      
MsgBox   "The   current   model   is   not   an   Physical   Data   model. " 
Else 
      ProcessFolder   mdl 
End   If 

Private   sub   ProcessFolder(folder) 
On Error Resume Next
      
Dim   Tab   'running     table 
      for   each   Tab   in   folder.tables 
            
if   not   tab.isShortcut   then 
                  tab.name   
=   tab.comment
                  
Dim   col   '   running   column 
                  for   each   col   in   tab.columns 
                  
if col.comment="" then
                  
else
                        col.name
=   col.comment 
                  
end if
                  
next 
            
end   if 
      
next 

      
Dim   view   'running   view 
      for   each   view   in   folder.Views 
            
if   not   view.isShortcut   then 
                  view.name   
=   view.comment 
            
end   if 
      
next 

      
'   go   into   the   sub-packages 
      Dim   f   '   running   folder 
      For   Each   f   In   folder.Packages 
            
if   not   f.IsShortcut   then 
                  ProcessFolder   f 
            
end   if 
      
Next 
end   sub


cyantide 2009-09-21 15:04 发表评论
]]>
oracle函数集锦(转帖)http://www.aygfsteel.com/cyantide/archive/2008/12/17/246895.htmlcyantidecyantideWed, 17 Dec 2008 08:19:00 GMThttp://www.aygfsteel.com/cyantide/archive/2008/12/17/246895.htmlhttp://www.aygfsteel.com/cyantide/comments/246895.htmlhttp://www.aygfsteel.com/cyantide/archive/2008/12/17/246895.html#Feedback0http://www.aygfsteel.com/cyantide/comments/commentRss/246895.htmlhttp://www.aygfsteel.com/cyantide/services/trackbacks/246895.htmlSQL中的单记录函?
1.ASCII
q回与指定的字符对应的十q制?
SQL> select ascii(’A’) A,ascii(’a’) a,ascii(’0’) zero,ascii(’ ’) space from dual;
A A ZERO SPACE
--------- --------- --------- ---------
65 97 48 32

2.CHR
l出整数,q回对应的字W?
SQL> select chr(54740) zhao,chr(65) chr65 from dual;
ZH C
-- -
?A
3.CONCAT
q接两个字符?
SQL> select concat(’010-’,’88888888’)||’?3’ 高乾竞电?from dual;
高乾竞电?
----------------
010-88888888?3
4.INITCAP
q回字符串ƈ字W串的第一个字母变为大?
SQL> select initcap(’smith’) upp from dual;
UPP
-----
Smith

5.INSTR(C1,C2,I,J)
在一个字W串中搜索指定的字符,q回发现指定的字W的位置;
C1 被搜索的字符?
C2 希望搜烦的字W串
I 搜烦的开始位|?默认?
J 出现的位|?默认?
SQL> select instr(’oracle traning’,’ra’,1,2) instring from dual;
INSTRING
---------
9

6.LENGTH
q回字符串的长度;
SQL> select name,length(name),addr,length(addr),sal,length(to_char(sal)) from gao.nchar_tst;
NAME LENGTH(NAME) ADDR LENGTH(ADDR) SAL LENGTH(TO_CHAR(SAL))
------ ------------ ---------------- ------------ --------- --------------------
高乾?3 北京市v锭区 6 9999.99 7

7.LOWER
q回字符?q将所有的字符写
SQL> select lower(’AaBbCcDd’)AaBbCcDd from dual;
AABBCCDD
--------
aabbccdd

8.UPPER
q回字符?q将所有的字符大写
SQL> select upper(’AaBbCcDd’) upper from dual;
UPPER
--------
AABBCCDD

9.RPAD和LPAD(_脓字符)
RPAD 在列的右边粘贴字W?
LPAD 在列的左边粘贴字W?
SQL> select lpad(rpad(’gao’,10,’*’),17,’*’)from dual;
LPAD(RPAD(’GAO’,1
-----------------
*******gao*******
不够字符则用*来填?

10.LTRIM和RTRIM
LTRIM 删除左边出现的字W串
RTRIM 删除双出现的字W串
SQL> select ltrim(rtrim(’ gao qian jing ’,’ ’),’ ’) from dual;
LTRIM(RTRIM(’
-------------
gao qian jing

11.SUBSTR(string,start,count)
取子字符?从start开?取count?
SQL> select substr(’13088888888’,3,8) from dual;
SUBSTR(’
--------
08888888

12.REPLACE(’string’,’s1’,’s2’)
string 希望被替换的字符或变?
s1 被替换的字符?
s2 要替换的字符?
SQL> select replace(’he love you’,’he’,’i’) from dual;
REPLACE(’H
----------
i love you

13.SOUNDEX
q回一个与l定的字W串读音相同的字W串
SQL> create table table1(xm varchar(8));
SQL> insert into table1 values(’weather’);
SQL> insert into table1 values(’wether’);
SQL> insert into table1 values(’gao’);
SQL> select xm from table1 where soundex(xm)=soundex(’weather’);
XM
--------
weather
wether

14.TRIM(’s’ from ’string’)
LEADING 剪掉前面的字W?
TRAILING 剪掉后面的字W?
如果不指?默认为空格符
15.ABS
q回指定值的l对?
SQL> select abs(100),abs(-100) from dual;
ABS(100) ABS(-100)
--------- ---------
100 100

16.ACOS
l出反余弦的?
SQL> select acos(-1) from dual;
ACOS(-1)
---------
3.1415927

17.ASIN
l出反正弦的?
SQL> select asin(0.5) from dual;
ASIN(0.5)
---------
.52359878

18.ATAN
q回一个数字的反正切?
SQL> select atan(1) from dual;
ATAN(1)
---------
.78539816

19.CEIL
q回大于或等于给出数字的最整?
SQL> select ceil(3.1415927) from dual;
CEIL(3.1415927)
---------------
4

20.COS
q回一个给定数字的余u
SQL> select cos(-3.1415927) from dual;
COS(-3.1415927)
---------------
-1
21.COSH
q回一个数字反余u?
SQL> select cosh(20) from dual;
COSH(20)
---------
242582598

22.EXP
q回一个数字e的nơ方?
SQL> select exp(2),exp(1) from dual;
EXP(2) EXP(1)
--------- ---------
7.3890561 2.7182818

23.FLOOR
对给定的数字取整?
SQL> select floor(2345.67) from dual;
FLOOR(2345.67)
--------------
2345

24.LN
q回一个数字的Ҏ?
SQL> select ln(1),ln(2),ln(2.7182818) from dual;
LN(1) LN(2) LN(2.7182818)
--------- --------- -------------
0 .69314718 .99999999

25.LOG(n1,n2)
q回一个以n1为底n2的对?
SQL> select log(2,1),log(2,4) from dual;
LOG(2,1) LOG(2,4)
--------- ---------
0 2

26.MOD(n1,n2)
q回一个n1除以n2的余?
SQL> select mod(10,3),mod(3,3),mod(2,3) from dual;
MOD(10,3) MOD(3,3) MOD(2,3)
--------- --------- ---------
1 0 2

27.POWER
q回n1的n2ơ方?
SQL> select power(2,10),power(3,3) from dual;
POWER(2,10) POWER(3,3)
----------- ----------
1024 27

28.ROUND和TRUNC
按照指定的精度进行舍?
SQL> select round(55.5),round(-55.4),trunc(55.5),trunc(-55.5) from dual;
ROUND(55.5) ROUND(-55.4) TRUNC(55.5) TRUNC(-55.5)
----------- ------------ ----------- ------------
56 -55 55 -55

29.SIGN
取数字n的符?大于0q回1,于0q回-1,{于0q回0
SQL> select sign(123),sign(-100),sign(0) from dual;
SIGN(123) SIGN(-100) SIGN(0)
--------- ---------- ---------
1 -1 0

30.SIN
q回一个数字的正u?
SQL> select sin(1.57079) from dual;
SIN(1.57079)
------------
1

31.SIGH
q回双曲正u的?
SQL> select sin(20),sinh(20) from dual;
SIN(20) SINH(20)
--------- ---------
.91294525 242582598

32.SQRT
q回数字n的根
SQL> select sqrt(64),sqrt(10) from dual;
SQRT(64) SQRT(10)
--------- ---------
8 3.1622777

33.TAN
q回数字的正切?
SQL> select tan(20),tan(10) from dual;
TAN(20) TAN(10)
--------- ---------
2.2371609 .64836083

34.TANH
q回数字n的双曲正切?
SQL> select tanh(20),tan(20) from dual;
TANH(20) TAN(20)
--------- ---------
1 2.2371609

35.TRUNC
按照指定的精度截取一个数
SQL> select trunc(124.1666,-2) trunc1,trunc(124.16666,2) from dual;
TRUNC1 TRUNC(124.16666,2)
--------- ------------------
100 124.16

36.ADD_MONTHS
增加或减L?
SQL> select to_char(add_months(to_date(’199912’,’yyyymm’),2),’yyyymm’) from dual;
TO_CHA
------
200002
SQL> select to_char(add_months(to_date(’199912’,’yyyymm’),-2),’yyyymm’) from dual;
TO_CHA
------
199910

37.LAST_DAY
q回日期的最后一?
SQL> select to_char(sysdate,’yyyy.mm.dd’),to_char((sysdate)+1,’yyyy.mm.dd’) from dual;
TO_CHAR(SY TO_CHAR((S
---------- ----------
2004.05.09 2004.05.10
SQL> select last_day(sysdate) from dual;
LAST_DAY(S
----------
31-5?-04

38.MONTHS_BETWEEN(date2,date1)
l出date2-date1的月?
SQL> select months_between(’19-12?1999’,’19-3?1999’) mon_between from dual;
MON_BETWEEN
-----------
9
SQL>selectmonths_between(to_date(’2000.05.20’,’yyyy.mm.dd’),to_date(’2005.05.20’,’yyyy.mm.dd’)) mon_betw from dual;
MON_BETW
---------
-60

39.NEW_TIME(date,’this’,’that’)
l出在this时区=other时区的日期和旉
SQL> select to_char(sysdate,’yyyy.mm.dd hh24:mi:ss’) bj_time,to_char(new_time
2 (sysdate,’PDT’,’GMT’),’yyyy.mm.dd hh24:mi:ss’) los_angles from dual;
BJ_TIME LOS_ANGLES
------------------- -------------------
2004.05.09 11:05:32 2004.05.09 18:05:32

40.NEXT_DAY(date,’day’)
l出日期date和星期x之后计算下一个星期的日期
SQL> select next_day(’18-5?2001’,’星期?#8217;) next_day from dual;
NEXT_DAY
----------
25-5?-01
41.SYSDATE
用来得到pȝ的当前日?
SQL> select to_char(sysdate,’dd-mm-yyyy day’) from dual;
TO_CHAR(SYSDATE,’
-----------------
09-05-2004 星期?
trunc(date,fmt)按照l出的要求将日期截断,如果fmt=’mi’表示保留?截断U?
SQL> select to_char(trunc(sysdate,’hh’),’yyyy.mm.dd hh24:mi:ss’) hh,
2 to_char(trunc(sysdate,’mi’),’yyyy.mm.dd hh24:mi:ss’) hhmm from dual;
HH HHMM
------------------- -------------------
2004.05.09 11:00:00 2004.05.09 11:17:00

42.CHARTOROWID
字W数据类型{换ؓROWIDcd
SQL> select rowid,rowidtochar(rowid),ename from scott.emp;
ROWID ROWIDTOCHAR(ROWID) ENAME
------------------ ------------------ ----------
AAAAfKAACAAAAEqAAA AAAAfKAACAAAAEqAAA SMITH
AAAAfKAACAAAAEqAAB AAAAfKAACAAAAEqAAB ALLEN
AAAAfKAACAAAAEqAAC AAAAfKAACAAAAEqAAC WARD
AAAAfKAACAAAAEqAAD AAAAfKAACAAAAEqAAD JONES

43.CONVERT(c,dset,sset)
源字符?sset从一个语a字符集{换到另一个目的dset字符?
SQL> select convert(’strutz’,’we8hp’,’f7dec’) "conversion" from dual;
conver
------
strutz

44.HEXTORAW
一个十六进制构成的字符串{换ؓ二进?

45.RAWTOHEXT
一个二q制构成的字W串转换为十六进?

46.ROWIDTOCHAR
ROWID数据cd转换为字W类?

47.TO_CHAR(date,’format’)
SQL> select to_char(sysdate,’yyyy/mm/dd hh24:mi:ss’) from dual;
TO_CHAR(SYSDATE,’YY
-------------------
2004/05/09 21:14:41

48.TO_DATE(string,’format’)
字W串转化为ORACLE中的一个日?

49.TO_MULTI_BYTE
字W串中的单字节字W{化ؓ多字节字W?
SQL> select to_multi_byte(’?#8217;) from dual;
TO
--
?

50.TO_NUMBER
给出的字符转换为数?
SQL> select to_number(’1999’) year from dual;
YEAR
---------
1999

51.BFILENAME(dir,file)
指定一个外部二q制文g
SQL>insert into file_tb1 values(bfilename(’lob_dir1’,’image1.gif’));

52.CONVERT(’x’,’desc’,’source’)
x字段或变量的源source转换为desc
SQL> select sid,serial#,username,decode(command,
2 0,’none’,
3 2,’insert’,
4 3,
5 ’select’,
6 6,’update’,
7 7,’delete’,
8 8,’drop’,
9 ’other’) cmd from v$session where type!=’background’;
SID SERIAL# USERNAME CMD
--------- --------- ------------------------------ ------
1 1 none
2 1 none
3 1 none
4 1 none
5 1 none
6 1 none
7 1275 none
8 1275 none
9 20 GAO select
10 40 GAO none

53.DUMP(s,fmt,start,length)
DUMP函数以fmt指定的内部数字格式返回一个VARCHAR2cd的?
SQL> col global_name for a30
SQL> col dump_string for a50
SQL> set lin 200
SQL> select global_name,dump(global_name,1017,8,5) dump_string from global_name;
GLOBAL_NAME DUMP_STRING
------------------------------ --------------------------------------------------
ORACLE.WORLD Typ=1 Len=12 CharacterSet=ZHS16GBK: W,O,R,L,D

54.EMPTY_BLOB()和EMPTY_CLOB()
q两个函数都是用来对大数据类型字D进行初始化操作的函?

55.GREATEST
q回一l表辑ּ中的最大?x较字W的~码大小.
SQL> select greatest(’AA’,’AB’,’AC’) from dual;
GR
--
AC
SQL> select greatest(’?#8217;,’?#8217;,’?#8217;) from dual;
GR
--
?

56.LEAST
q回一l表辑ּ中的最?
SQL> select least(’?#8217;,’?#8217;,’?#8217;) from dual;
LE
--
?

57.UID
q回标识当前用户的唯一整数
SQL> show user
USER ?GAO"
SQL> select username,user_id from dba_users where user_id=uid;
USERNAME USER_ID
------------------------------ ---------
GAO 25

58.USER
q回当前用户的名?
SQL> select user from dual;
USER
------------------------------
GAO

59.USEREVN
q回当前用户环境的信?opt可以?
ENTRYID,SESSIONID,TERMINAL,ISDBA,LABLE,LANGUAGE,CLIENT_INFO,LANG,VSIZE
ISDBA 查看当前用户是否是DBA如果是则q回true
SQL> select userenv(’isdba’) from dual;
USEREN
------
FALSE
SQL> select userenv(’isdba’) from dual;
USEREN
------
TRUE
SESSION
q回会话标志
SQL> select userenv(’sessionid’) from dual;
USERENV(’SESSIONID’)
--------------------
152
ENTRYID
q回会话人口标志
SQL> select userenv(’entryid’) from dual;
USERENV(’ENTRYID’)
------------------
0
INSTANCE
q回当前INSTANCE的标?
SQL> select userenv(’instance’) from dual;
USERENV(’INSTANCE’)
-------------------
1
LANGUAGE
q回当前环境变量
SQL> select userenv(’language’) from dual;
USERENV(’LANGUAGE’)
----------------------------------------------------
SIMPLIFIED CHINESE_CHINA.ZHS16GBK
LANG
q回当前环境的语a的羃?
SQL> select userenv(’lang’) from dual;
USERENV(’LANG’)
----------------------------------------------------
ZHS
TERMINAL
q回用户的终端或机器的标?
SQL> select userenv(’terminal’) from dual;
USERENV(’TERMINA
----------------
GAO
VSIZE(X)
q回X的大?字节)?
SQL> select vsize(user),user from dual;
VSIZE(USER) USER
----------- ------------------------------
6 SYSTEM


60.AVG(DISTINCT|ALL)
all表示Ҏ有的值求q_?distinct只对不同的值求q_?
SQLWKS> create table table3(xm varchar(8),sal number(7,2));
语句已处理?
SQLWKS> insert into table3 values(’gao’,1111.11);
SQLWKS> insert into table3 values(’gao’,1111.11);
SQLWKS> insert into table3 values(’zhu’,5555.55);
SQLWKS> commit;
SQL> select avg(distinct sal) from gao.table3;
AVG(DISTINCTSAL)
----------------
3333.33
SQL> select avg(all sal) from gao.table3;
AVG(ALLSAL)
-----------
2592.59

61.MAX(DISTINCT|ALL)
求最大?ALL表示Ҏ有的值求最大?DISTINCT表示对不同的值求最大?相同的只取一?
SQL> select max(distinct sal) from scott.emp;
MAX(DISTINCTSAL)
----------------
5000

62.MIN(DISTINCT|ALL)
求最?ALL表示Ҏ有的值求最?DISTINCT表示对不同的值求最?相同的只取一?
SQL> select min(all sal) from gao.table3;
MIN(ALLSAL)
-----------
1111.11

63.STDDEV(distinct|all)
求标准差,ALL表示Ҏ有的值求标准?DISTINCT表示只对不同的值求标准?
SQL> select stddev(sal) from scott.emp;
STDDEV(SAL)
-----------
1182.5032
SQL> select stddev(distinct sal) from scott.emp;
STDDEV(DISTINCTSAL)
-------------------
1229.951

64.VARIANCE(DISTINCT|ALL)
求协方差
SQL> select variance(sal) from scott.emp;
VARIANCE(SAL)
-------------
1398313.9

65.GROUP BY
主要用来对一l数q行l计
SQL> select deptno,count(*),sum(sal) from scott.emp group by deptno;
DEPTNO COUNT(*) SUM(SAL)
--------- --------- ---------
10 3 8750
20 5 10875
30 6 9400

66.HAVING
对分l统计再加限制条?
SQL> select deptno,count(*),sum(sal) from scott.emp group by deptno having count(*)>=5;
DEPTNO COUNT(*) SUM(SAL)
--------- --------- ---------
20 5 10875
30 6 9400
SQL> select deptno,count(*),sum(sal) from scott.emp having count(*)>=5 group by deptno ;
DEPTNO COUNT(*) SUM(SAL)
--------- --------- ---------
20 5 10875
30 6 9400

67.ORDER BY
用于Ҏ询到的结果进行排序输?
SQL> select deptno,ename,sal from scott.emp order by deptno,sal desc;
DEPTNO ENAME SAL
--------- ---------- ---------
10 KING 5000
10 CLARK 2450
10 MILLER 1300
20 SCOTT 3000
20 FORD 3000
20 JONES 2975
20 ADAMS 1100
20 SMITH 800
30 BLAKE 2850
30 ALLEN 1600
30 TURNER 1500
30 WARD 1250
30 MARTIN 1250
30 JAMES 950



cyantide 2008-12-17 16:19 发表评论
]]>
oracle 数据库库 自增讄http://www.aygfsteel.com/cyantide/archive/2008/07/24/217117.htmlcyantidecyantideThu, 24 Jul 2008 02:59:00 GMThttp://www.aygfsteel.com/cyantide/archive/2008/07/24/217117.htmlhttp://www.aygfsteel.com/cyantide/comments/217117.htmlhttp://www.aygfsteel.com/cyantide/archive/2008/07/24/217117.html#Feedback0http://www.aygfsteel.com/cyantide/comments/commentRss/217117.htmlhttp://www.aygfsteel.com/cyantide/services/trackbacks/217117.htmlALTER DATABASE DATAFILE 'E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\ITIL.DBF' AUTOEXTEND ON NEXT 256M MAXSIZE UNLIMITED



cyantide 2008-07-24 10:59 发表评论
]]>
oracle sql 用法http://www.aygfsteel.com/cyantide/archive/2008/07/04/212490.htmlcyantidecyantideFri, 04 Jul 2008 01:39:00 GMThttp://www.aygfsteel.com/cyantide/archive/2008/07/04/212490.htmlhttp://www.aygfsteel.com/cyantide/comments/212490.htmlhttp://www.aygfsteel.com/cyantide/archive/2008/07/04/212490.html#Feedback0http://www.aygfsteel.com/cyantide/comments/commentRss/212490.htmlhttp://www.aygfsteel.com/cyantide/services/trackbacks/212490.htmlalter table t add  c1 varchar2(30)
alter table t add  (c1 varchar2(30),c2 number(4))

alter table t rename column c1  to c2
alter table t modify c1 varchar(40)


alter table t drop column  c1

alter table trename to t1
rename t1 to t2


从一个表中查扑֏一个表中没有的?

比如要从DEPT中查扑֜表EMP中不存在数据的所有部门(数据中,DEPTNOgؓ40的记录在表EMP中不存在Q?


1select deptno from dept  
2minus  
3select deptno from emp







cyantide 2008-07-04 09:39 发表评论
]]>
Oracle varchar2 默认值问?/title><link>http://www.aygfsteel.com/cyantide/archive/2008/06/19/209185.html</link><dc:creator>cyantide</dc:creator><author>cyantide</author><pubDate>Thu, 19 Jun 2008 08:30:00 GMT</pubDate><guid>http://www.aygfsteel.com/cyantide/archive/2008/06/19/209185.html</guid><wfw:comment>http://www.aygfsteel.com/cyantide/comments/209185.html</wfw:comment><comments>http://www.aygfsteel.com/cyantide/archive/2008/06/19/209185.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/cyantide/comments/commentRss/209185.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/cyantide/services/trackbacks/209185.html</trackback:ping><description><![CDATA[oracle遇到'',卛_成NULL处理.   <br /> <br />   查询NULL要用is   null   而不是用=null <img src ="http://www.aygfsteel.com/cyantide/aggbug/209185.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/cyantide/" target="_blank">cyantide</a> 2008-06-19 16:30 <a href="http://www.aygfsteel.com/cyantide/archive/2008/06/19/209185.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>doracle临时表空?/title><link>http://www.aygfsteel.com/cyantide/archive/2008/05/28/203437.html</link><dc:creator>cyantide</dc:creator><author>cyantide</author><pubDate>Wed, 28 May 2008 03:39:00 GMT</pubDate><guid>http://www.aygfsteel.com/cyantide/archive/2008/05/28/203437.html</guid><wfw:comment>http://www.aygfsteel.com/cyantide/comments/203437.html</wfw:comment><comments>http://www.aygfsteel.com/cyantide/archive/2008/05/28/203437.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/cyantide/comments/commentRss/203437.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/cyantide/services/trackbacks/203437.html</trackback:ping><description><![CDATA[<p>CREATE SMALLFILE TEMPORARY TABLESPACE "TempTableName" TEMPFILE 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\TempTableName ' SIZE 100M EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1M<br /> ALTER DATABASE DEFAULT TEMPORARY TABLESPACE "TempTableName" </p> <img src ="http://www.aygfsteel.com/cyantide/aggbug/203437.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/cyantide/" target="_blank">cyantide</a> 2008-05-28 11:39 <a href="http://www.aygfsteel.com/cyantide/archive/2008/05/28/203437.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>oracle 序列http://www.aygfsteel.com/cyantide/archive/2008/05/27/203112.htmlcyantidecyantideTue, 27 May 2008 01:37:00 GMThttp://www.aygfsteel.com/cyantide/archive/2008/05/27/203112.htmlhttp://www.aygfsteel.com/cyantide/comments/203112.htmlhttp://www.aygfsteel.com/cyantide/archive/2008/05/27/203112.html#Feedback0http://www.aygfsteel.com/cyantide/comments/commentRss/203112.htmlhttp://www.aygfsteel.com/cyantide/services/trackbacks/203112.html序列名称>
         start with <
起始?/span>>
         increment by <
增长?/span>>
         [maxvalue  
?/span>]
         [minvalue  
?/span>]
         [cycle 
当到达最大值的时候,l从头开?/span>]
         [Nocycle  -- 
一直篏加,不@?/span>]  
      [Cache ]


W一?span lang="EN-US" style="font-size: 10pt; line-height: 150%; font-family: Verdana">NEXTVAL
q回的是初始|随后?/span>NEXTVAL会自动增加你定义?/span>INCREMENT BY|然后q回增加后的倹{?/span>CURRVAL Lq回当前SEQUENCE的|但是在第一?/span>NEXTVAL初始化之?a class="qs_highlight1" id="hl_3" onmouseover="window.clearTimeout(_ht[3]);qs_show_frame(event,this,3);" style="font-size: 1em" onclick="_write_cookie('click29',3);" onmouseout="_on_div[3]=false;_ht[3]=window.setTimeout('qs_is_on_div(3)',500);" target="_blank">才能使用CURRVALQ否则会出错。一?/span>NEXTVAL会增加一?/span>SEQUENCE的倹{  
  如果指定CACHE|ORACLE可以预先在内存里面攄一?/span>sequenceQ这样存取的快些?/span>cache里面的取完后Q?/span>oracle自动再取一l到cache?/span> 使用cache或许会蟩P 比如数据库突然不正常down掉(shutdown abort),cache中的sequence׃丢失所以可以在create sequence的时候用nocache防止q种情况?/span>


cyantide 2008-05-27 09:37 发表评论
]]>
sql语言分类http://www.aygfsteel.com/cyantide/archive/2008/05/24/202587.htmlcyantidecyantideSat, 24 May 2008 05:55:00 GMThttp://www.aygfsteel.com/cyantide/archive/2008/05/24/202587.htmlhttp://www.aygfsteel.com/cyantide/comments/202587.htmlhttp://www.aygfsteel.com/cyantide/archive/2008/05/24/202587.html#Feedback0http://www.aygfsteel.com/cyantide/comments/commentRss/202587.htmlhttp://www.aygfsteel.com/cyantide/services/trackbacks/202587.html阅读全文

cyantide 2008-05-24 13:55 发表评论
]]>
վ֩ģ壺 | | ¸| | | ɽ| ٹ| ľ| | ҳ| | | ־| Ȫ| | | ˮ| ͬ| Դ| | ʡ| | żҿ| ̩| Ͽ| | | ء| | | ֶ| ɯ| | | | ׿| | | | | ͼ|