oracle SQLÃüÁî´óÈ«
delete ɾ³ýÒ»ÕÅ´ó±íʱ¿Õ¼ä²»ÊÍ·Å£¬·Ç³£ÂýÊÇÒòΪռÓôóÁ¿µÄϵͳ×ÊÔ´£¬Ö§³Ö»ØÍ˲Ù×÷£¬¿Õ¼ä»¹±»ÕâÕűíÕ¼ÓÃ×Å¡£
truncate table ±íÃû (ɾ³ý±íÖмǼʱÊͷűí¿Õ¼ä)
DML Óï¾ä£º
±í¼¶¹²ÏíËø£º ¶ÔÓÚ²Ù×÷Ò»ÕűíÖеIJ»Í¬¼Ç¼ʱ£¬»¥²»Ó°Ïì
Ðм¶ÅÅËüËø£º¶ÔÓÚÒ»ÐмǼ£¬oracle »áÖ»ÔÊÐíÖ»ÓÐÒ»¸öÓû§¶ÔËüÔÚͬһʱ¼ä½øÐÐÐ޸IJÙ×÷
wait() µÈµ½Ðм¶Ëø±»ÊÍ·Å£¬²Å½øÐÐÊý¾Ý²Ù×÷
dropÒ»ÕűíʱҲ»á¶Ô±í¼ÓËø£¬DDLÅÅËüËø,ËùÒÔÔÚɾ³ýÒ»ÕűíʱÈç¹ûµ±Ç°»¹ÓÐÓû§²Ù×÷±íʱ²»ÄÜɾ³ý±í
alter table ÃüÁîÓÃÓÚÐ޸ıíµÄ½á¹¹(ÕâЩÃüÁî²»»á¾³£ÓÃ)£º
Ôö¼ÓÔ¼Êø£º
alter table ±íÃû add constraint ¡¡Ô¼ÊøÃû primary key (×ֶΣ©;
½â³ýÔ¼Êø£º(ɾ³ýÔ¼Êø)
alter table ±íÃû drop primary key£¨¶ÔÓÚÖ÷¼üÔ¼Êø¿ÉÒÔÖ±½ÓÓô˷½·¨£¬ÒòΪһÕűíÖÐÖ»ÓÐÒ»¸öÖ÷¼üÔ¼ÊøÃû, ×¢ÒâÈç¹ûÖ÷¼ü´Ëʱ»¹ÓÐÆäËü±íÒýÓÃʱɾ³ýÖ÷¼üʱ»á³ö´í£©
alter tbale father drop primary key cascade ; (Èç¹ûÓÐ×Ó±íÒýÓÃÖ÷¼üʱ£¬ÒªÓôËÓï·¨À´É¾³ýÖ÷¼ü,Õâʱ×Ó±í»¹´æÔÚÖ»ÊÇ×Ó±íÖеÄÍâ¼üÔ¼Êø±»¼°ÁªÉ¾³ýÁË£©
alter table ±íÃû drop constraint Ô¼ÊøÃû;
(ÔõÑùÈ¡Ò»¸öÔ¼ÊøÃû£º1¡¢ÈËΪµÄÎ¥·´Ô¼Êø¹æ¶¨¸ù¾Ý´íÎóÐÅÏ¢»ñÈ¡!
2¡¢²éѯʾͼ»ñÈ¡Ô¼ÊøÃû!)
alter table ±íÃû disable from primary key ; (Ï൱ÓÚ°ÑÒ»¸ö±íµÄÖ÷¼ü½ûÓÃ)
alter table ±íÃû enable primary key ;£¨enable ʱ»á×Ô¶¯È¥¼ì²é±íµÄ¼Ç¼ÊDz»ÊÇ·ûºÏÒªÇó,Èç¹ûÓÐÔàÊý¾Ýʱ±ØÐëÒªÏÈɾ³ýÔàÊý¾Ý²Å¿ÉÒÔ enable£©
*******************************************************************
Ôö¼Ó×ֶΣº
alter table ¡¡¡¡±íÃû¡¡¡¡¡¡add(×Ö¶Î×Ö ×Ö¶ÎÀàÐÍ)
ɾ³ý×ֶΣº
alter table ¡¡¡¡±íÃû drop(×Ö¶Î)
alter tbale ±íÃû drop column ×ֶΠ; (8i ÒÔºó²ÅÖ§³Ö£©
¸øÁиÄÃû:920²ÅÖ§³Ö
alter table ±íÃû rename column ¾É×Ö¶ÎÃû to ÐÂ×Ö¶ÎÃû;
ÐÞ¸Ä×Ö¶Î
(´ËʱӦעÒâµÄÎÊÌ⣬¸ü¸ÄʱҪ¿´¾ßÌåÖµÇé¿öÖ®¼äµÄת´ï»»£¬¡¡¸ÄΪ×Ö·ûÀàÐÍʱ£¬±ØÐëҪΪ¿Õ)
alter table ¡¡±íÃû modify( ×ֶΣ¬ÀàÐÍ)
¸ü¸Ä±íÖеÄ×ֶΣº
update ±íÃû set ×ֶΠ£½ Öµ where Ìõ¼þ
¸ü¸Ä±íÃû
rename ¾É±íÃû to ¡¡ ¡¡Ð±íÃû £»
ɾ³ý±í£º
trucate table ±íÃû:(±í½á¹¹»¹ÔÚ£¬Êý¾ÝÈ«²¿É¾³ý£¬ÊͷűíËùÕ¼µÄ¿Õ¼ä£¬²»Ö§³Ö»ØÍË,³£ÓÃɾ³ý´ó±í£©
¹ØÓÚoralceÖвúÉúÐòÁÐ(sequence):
create sequence ÐòÁÐÃûalter system flush shared_pool;
(²»´ø²ÎÊýʱĬÈÏΪ´Ó1 ¿ªÊ¼Ã¿´ÎµÝÔö 1£¬o
Ïà¹ØÎĵµ£º
ËäȻѧϰJavaºÜ¾ÃÁË£¬×Ô¼ºÒ²Á¬½Ó¹ýһЩÊý¾Ý¿â£¬±ÈÈçmysqlÖ®ÀàµÄ£¬Èç½ñÄØ£¬Ò²Ñ§Ï°ÁËÒ»¶Îʱ¼äµÄOracle£¬È»¶øÄØ£¬½ñÌìÊÇÎÒµÚÒ»´ÎÁ¬½ÓOracle£¬ºÙºÙ£¬Ó¦¸Ã»¹²»ËãÌ«³Ù°É¡£
½ñÌìÄØ£¬Óе㱿׾£¬´ó¼ÒĪЦ£¡
ÎÒÕâÊÇÒ»¸ö²éѯÀý×Ó
Ê×ÏÈ£¬Ô ......
1¡¢´´½¨´æ´¢¹ý³Ì
create or replace procedure test(var_name_1 in type,var_name_2 out type) as
--ÉùÃ÷±äÁ¿(±äÁ¿Ãû ±äÁ¿ÀàÐÍ)
begin
--´æ´¢¹ý³ÌµÄÖ´ÐÐÌå
end test;
´òÓ¡³öÊäÈëµÄʱ¼äÐÅÏ¢
E.g:
create or replace procedure test(workDate in Date) is
begin
dbms_output.putline('The input date is: ......
1.»ù±¾½á¹¹
CREATE OR REPLACE PROCEDURE ´æ´¢¹ý³ÌÃû×Ö
(
²ÎÊý1 IN NUMBER,
²ÎÊý2 IN NUMBER
) IS
±äÁ¿1 INTEGER :=0;
±äÁ¿2 DATE;
BEGIN
END ´æ´¢¹ý³ÌÃû×Ö
2.SELECT INTO STATEMENT
½«select²éѯµÄ½á¹û´æÈëµ½±äÁ¿ÖУ¬¿ÉÒÔͬʱ½«¶à¸öÁд洢¶à¸ö±äÁ¿ÖУ¬±ØÐëÓÐÒ»Ì ......
ÅäÖöà¸öSDE·þÎñ(oracle) ÏîĿҪ׼±¸Á½·ÝÏàͬ½á¹¹µÄÊý¾Ý¸ø²»Í¬µÄÓû§£¬ÓÉÓÚÊý¾ÝÁ¿ºÜ´ó£¬²»¶ÏµÄ±¸·Ý»¹ÔЧÂÊÊ®·ÖµÍÏ£¬Òò´Ë¿¼ÂÇн¨Ò»¸öÊý¾Ý¿â£¬½¨Á¢Á½¸öSDE·þÎñ¡£
1.н¨Êý¾Ý¿âDXGX_GX(ÔÊý¾Ý¿â£ºDXGX)
2.ÔËÐÐSDE POST д´½¨Ò»¸ö·þÎñ£¨ÔÚ´´½¨Ö®Ç°ÐèÒªÏȹرÕÒÑÔÚÔËÐÐÖеÄSDE·þÎñ£©
3.ÔÚArcCatalogÀィÁ¢ÐµÄSDEÁ¬ ......
ͨ³£Ö´ÐÐsqlÓï¾ä£¬´ó¼ÒÓõĶ¼ÊÇexec£¬exec¹¦ÄÜÇ¿´ó£¬µ«²»Ö§³ÖǶÈë²ÎÊý£¬sp_executesql½â¾öÁËÕâ¸öÎÊÌâ¡£³Ò»¶Îsqlserver°ïÖú£º
sp_executesql
Ö´ÐпÉÒÔ¶à´ÎÖØÓûò¶¯Ì¬Éú³ÉµÄ Transact-SQL Óï¾ä»òÅú´¦Àí¡£Transact-SQL Óï¾ä»òÅú´¦Àí¿ÉÒÔ°üº¬Ç¶Èë²ÎÊý¡£
Óï·¨
sp_executesql
[@stmt
=
] stmt
[
&n ......