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

oracleÖеÄdual±íÏê½â

1.DUAL±íµÄÓÃ;
Dual ÊÇ OracleÖеÄÒ»¸öʵ¼Ê´æÔÚµÄ±í£¬ÈκÎÓû§¾ù¿É¶ÁÈ¡£¬³£ÓÃÔÚûÓÐÄ¿±ê±íµÄSelectÓï¾ä¿éÖÐ
--²é¿´µ±Ç°Á¬½ÓÓû§
SQL> select user from dual;
USER
------------------------------
SYSTEM
--²é¿´µ±Ç°ÈÕÆÚ¡¢Ê±¼ä
SQL> select sysdate from dual;
SYSDATE
-----------
2007-1-24 1
SQL> select to_char(sysdate,''yyyy-mm-dd hh24:mi:ss'') from dual;
TO_CHAR(SYSDATE,''YYYY-MM-DDHH2
------------------------------
2007-01-24 15:02:47
--µ±×÷¼ÆËãÆ÷ÓÃ
SQL> select 1+2 from dual;
1+2
----------
3
--²é¿´ÐòÁÐÖµ
SQL> create sequence aaa increment by 1 start with 1;
SQL> select aaa.nextval from dual;
NEXTVAL
----------
1
SQL> select aaa.currval from dual;
CURRVAL
----------
1
2¡¢¹ØÓÚDUAL±íµÄ²âÊÔÓë·ÖÎö
DUAL¾ÍÊǸöÒ»ÐÐÒ»ÁÐµÄ±í£¬Èç¹ûÄãÍùÀïÖ´ÐÐinsert¡¢delete¡¢truncate²Ù×÷£¬¾Í»áµ¼Öºܶà³ÌÐò³öÎÊÌâ¡£½á¹ûÒ²Òòsql*plus¡¢pl/sql devµÈ¹¤¾ß¶øÒì¡£
--²é¿´DUALÊÇʲôOBJECT
--DUALÊÇÊôÓÚSYS schemaµÄÒ»¸ö±í,È»ºóÒÔPUBLIC SYNONYMµÄ·½Ê½¹©ÆäËûÊý¾Ý¿âUSERʹÓÃ.
SQL> select owner, object_name , object_type from dba_objects where object_name like ''%DUAL%'';
OWNER OBJECT_NAME OBJECT_TYPE
---------- ----------------- ------------------
SYS DUAL TABLE
PUBLIC DUAL SYNONYM
--²é¿´±í½á¹¹£¬Ö»ÓÐÒ»¸ö×Ö¶ÎDUMMY£¬ÎªVARCHAR2(1)ÐÍ
SQL> desc dual
Name Type Nullable Default Comments
----- ----------- -------- ------- --------
DUMMY VARCHAR2(1) Y
--DUAL±íµÄ½á¹¹£º
create table SYS.DUAL
(
DUMMY VARCHAR2(1)
)
tablespace SYSTEM
pctfree 10
pctused 40
initrans 1
maxtrans 255
storage
(
initial 16K
next 16K
minextents 1
maxextents 505
pctincrease 50
);
/*
ºÜÊÇÀ§»ó£¬ORACLEΪʲôҪÓÃVARCHAR(1)ÐÍ£¬ÓÃCHAR(1)ÄѵÀ²»ºÃô£¿´ÓÕâÑùµÄ±í½á¹¹À´¿´£¬DUAL±íÉè¼ÆµÄÄ¿µÄ¾ÍÊÇÒª¾¡¿ÉÄܵļòµ¥£¬ÒÔ¼õÉÙ¼ìË÷µÄ¿ªÏú¡£
»¹ÓУ¬DUAL±íÊǽ¨Á¢ÔÚSYSTEM±í¿Õ¼äµÄ£¬µÚÒ»ÊÇÒòΪDUAL±íÊÇSYSÕâ¸öÓû§½¨µÄ£¬±¾À´Ä¬Èϵıí¿Õ¼ä¾ÍÊÇSYSTEM£»µÚ¶þ£¬°ÑÕâ¸ö¿ÉÄܾ­³£±»²éѯµÄ±íºÍÓû§±í·Ö¿ªÀ´´æ·Å£¬¶ÔÓÚϵͳÐÔÄܵÄÊÇÓкô¦µÄ¡£
ÓÐÁË´´½¨ÁË±í¡¢´´½¨ÁËͬÒå´Ê


Ïà¹ØÎĵµ£º

OracleÅäÖñ¾µØNet·þÎñÃû

Ò».ÅäÖñ¾µØNet·þÎñÃûÊǸÉʲôÓõģ¿
Èç¹ûҪͨ¹ýÍøÂç·ÃÎÊOracleÊý¾Ý¿â»òÆäËû·þÎñ£¬¾Í»áÓõ½Net·þÎñÃû¡£Oracle Net
Configuration AssistantÔÊÐíʹÓÃÓɱ¾µØÃüÃû½âÎöµÄÍøÂç·þÎñÃû¡£
¶þ.ÔõÑùÅäÖñ¾µØNet·þÎñÃû£¿
1.´ò¿ª->³ÌÐò/Oracle - OraClient10g_home1/ÅäÖúÍÒÆÖ²¹¤¾ß/Net
Configuration Assistant´ò¿ªNet Co ......

Oracleʱ¼äÈÕÆÚ²Ù×÷

Oracleʱ¼äÈÕÆÚ²Ù×÷
sysdate+(5/24/60/60) ÔÚϵͳʱ¼ä»ù´¡ÉÏÑÓ³Ù5Ãë
sysdate+5/24/60 ÔÚϵͳʱ¼ä»ù´¡ÉÏÑÓ³Ù5·ÖÖÓ
sysdate+5/24 ÔÚϵͳʱ¼ä»ù´¡ÉÏÑÓ³Ù5Сʱ
sysdate+5 ÔÚϵͳʱ¼ä»ù´¡ÉÏÑÓ³Ù5Ìì
add_months(sysdate,-5) ÔÚϵͳʱ¼ä»ù´¡ÉÏÑÓ³Ù5ÔÂ
add_months(sysdate,-5*12) ÔÚϵͳʱ¼ä»ù´¡ÉÏÑÓ³Ù5Äê
ÉÏÔÂÄ©µÄÈÕÆÚ£ºsel ......

¡¾×ª¡¿oracle´óÊý¾ÝÁ¿µÄµ¼ÈëºÍµ¼³ö

ÔÚoracleÖÐÅúÁ¿Êý¾ÝµÄµ¼³öÊǽèÖúsqlplusµÄspoolÀ´ÊµÏֵġ£ÅúÁ¿Êý¾ÝµÄµ¼ÈëÊÇͨ¹ýsqlloadÀ´ÊµÏֵġ£
´óÁ¿Êý¾ÝµÄµ¼³ö²¿·ÖÈçÏ£º
/***************************
 *  sql½Å±¾²¿·Ö demo.sql begin
 **************************/
/**************************
 * @author meconsea
 * @date 20050 ......

ͼƬ¶þ½øÖÆ´æÈëORACLEºÍд³ö

using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Syste ......

oracle merge into Ó÷¨Ïê½â


ת×Ô£ºhttp://hi.baidu.com/magus163/blog/item/a4f783178e39ef00c93d6de6.html
¡¾ÕâƪÎÄÕÂÀý×Ó½²½âµÄ±È½ÏÏêϸ£¬ÎÒ¾Íת¹ýÀ´ÁË¡¿
Oracle9iÒýÈëÁËMERGEÃüÁî,ÄãÄܹ»ÔÚÒ»¸öSQLÓï¾äÖжÔÒ»¸ö±íͬʱִÐÐinsertsºÍupdates²Ù×÷. MERGEÃüÁî´ÓÒ»¸ö»ò¶à¸öÊý¾ÝÔ´ÖÐÑ¡ÔñÐÐÀ´updating»òinsertingµ½Ò»¸ö»ò¶à¸ö±í.
Oracle 10gÖÐMERGEÓÐÈ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ