²âÁ¿sql ½âÎöºÄ·ÑµÄʱ¼ä±ÈÀý
Çå¿Õ¹²Ïí³Ø£¬¹Ø±Õ£¬ÖØÆôÊý¾Ý¿â
SQL> shutdown immediate;
SQL> startup;
¿ªÆô ʱ¼äͳ¼Æ
SQL> set timi on
SQL> select count(*) from dba_objects;
COUNT(*)
----------
11308
Elapsed: 00:00:00.19
SQL> /
COUNT(*)
----------
11308
Elapsed: 00:00:00.03
SQL> /
COUNT(*)
----------
11308
Elapsed: 00:00:00.03
SQL> select 16/19 from dual;
16/19
----------
.842105263
¿ÉÒÔ¿´µ½ ½âÎöʱ¼ä ËùÕ¼ÓÃÁ˾ø´ó²¿·Öʱ¼ä £¬µ¥Æ¾Õâ¸öʵÑé ²»ÄÜ˵SQL½âÎö»áÕ¼ÓÃ84%µÄʱ¼ä£¬²»¹ý¿ÉÒԿ϶¨µÄÊÇ SQL½âÎö»áÕ¼ÓÃSQLÓï¾äÔËÐеĺܴ󲿷Öʱ¼ä¡£
ÏÂÃæÀ´²âÊÔһϠʹÓð󶨱äÁ¿ ºÍ²»Ê¹Óð󶨱äÁ¿ËùSQL½âÎöËù´øÀ´µÄÐÔÄÜÎÊÌâ
Ö´ÐÐÁ½¸ö½Å±¾ µÚÒ»¸ö ½Å±¾²»Ê¹Óð󶨱äÁ¿
bind1.sql½Å±¾ÄÚÈÝÈçÏÂ:
declare
type cur is ref cursor;
cur1 cur;
name varchar2(1000);
begin
for i in 1..1000 loop
open cur1 for 'select object_name from dba_objects where object_id=' || i;
fetch cur1 into name;
close cur1;
end loop;
end ;
/
bind2.sql ½Å±¾ÄÚÈÝ£º
declare
type cur is ref cursor;
cur1 cur;
name varchar2(1000);
begin
for i in 1..1000 loop
open cur1 for 'select object_name from dba_objects where object_id=:x'using i;
fetch cur1 into name;
close cur1;
end loop;
end ;
/
¿ªÊ¼²âÊÔ
SQL> alter system flush shared_pool;
System altered.
SQL> set timi on
SQL> @bind1
PL/SQL procedure successfully completed.
Elapsed: 00:00:07.51
SQL>select sql_text from v$sqlarea where sql_text like '%dba_objects%';
SQL_TEXT
----------------------------------------------------------------------------------------------------
select object_name from dba_objects where object_id=506
select object_name from dba_objects where object_id=716
select object_name from dba_objects where object_id=129
....................
¿ÉÒÔ¿´µ½ ¸ÃÓï¾ä½âÎöÁË1000´Î
SQL> alter system flush shared_pool;
System altered.
SQL> @bind2
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.64
Ïà¹ØÎĵµ£º
ÔÚPL/SQLÖÐÒ²ÌṩGOTOÓï¾ä,ÆäÓï·¨ÊÇ
GOTO label;
ÕâÀïlabelÊÇÔÚPL/SQL¿éÖж¨ÒåµÄ±êÇ©.±êÇ©ÊÇÓÃË«¼ýÍ·À¨ºÅÀ¨ÆðÀ´µÄ.µ±Ö´ÐÐGOTOÓï¾äµÄʱºò,¿ØÖÆ»áÁ¢¼´×ªµ½ÓɱêÇ©±êʶµÄÓï¾ä.
1.¶ÔÓÚGOTOµÄÏÞÖÆ
a.¶ÔÓÚ¿é,Ñ»·»òÕßIFÓï¾ä¶øÑÔ,ÏëÒª´ÓÍâ²ãÌøµ½ÄÚ²ãÊÇ·Ç·¨µÄ.
b.ʹÓÃGOTO×Ó¾ä´ÓÒ»¸öIF×Ó¾äÌøµ½ÁíÒ»¸ö×Ó¾äÖÐÒ²ÊÇ·Ç·¨µÄ.
begin
......
±êÌâ¡¡: sql ×Ö·û´¦Àíº¯Êý´óÈ«
¹Ø¼ü×Ö:
·ÖÀà¡¡: ¸öÈËרÇø
Ãܼ¶¡¡: ¹«¿ª
(ÆÀ·Ö: , »Ø¸´: 0, ÔĶÁ: 278) »»
SQL×Ö·û´®´¦Àíº¯Êý´óÈ«(ת)2008-04-01 17:21SQL×Ö·û´®´¦Àíº¯Êý´óÈ«(ת)select ×Ö¶Î1 from ±í1 where ×Ö¶Î1.IndexOf("ÔÆ")=1;
ÕâÌõÓï¾ä²»¶ÔµÄÔÒòÊÇindexof£¨£©º¯Êý²»ÊÇsqlº¯Êý£¬¸Ä³És ......
È·¶¨¸ø¶¨µÄ×Ö·û´®ÊÇ·ñÓëÖ¸¶¨µÄģʽƥÅ䡣ģʽ¿ÉÒÔ°üº¬³£¹æ×Ö·ûºÍͨÅä·û×Ö·û¡£Ä£Ê½Æ¥Åä¹ý³ÌÖУ¬³£¹æ×Ö·û±ØÐëÓë×Ö·û´®ÖÐÖ¸¶¨µÄ×Ö·ûÍêÈ«Æ¥Å䡣Ȼ¶ø£¬¿É ʹÓÃ×Ö·û´®µÄÈÎÒâƬ¶ÎÆ¥ÅäͨÅä·û¡£ÓëʹÓà = ºÍ != ×Ö·û´®±È½ÏÔËËã·ûÏà±È£¬Ê¹ÓÃͨÅä·û¿Éʹ LIKE ÔËËã·û¸ü¼ÓÁé»î¡£Èç¹ûÈκβÎÊý¶¼²»ÊôÓÚ×Ö·û´®Êý¾ÝÀàÐÍ£¬Microsoft SQL Server ......
ÉÏÉϸöÐÇÆÚ£¬ÓÐÈË·´À¡£¬CSDNÓÐSQL×¢È붶´£¬º¹ÑÕ£¬¼¸ÄêǰΪSQL×¢È붶´£¬²¿ÃÅרÃŶÔËùÓдúÂë×ö¹ýÒ»´Î·Ç³£´óµÄ¼ì²é£¬¾¹È»ÄǴμì²é»¹ÓÐÒÅ©µÄµØ·½¡£×î½üÕ⼸¸öÐÇÆÚ£¬¾ÍÊÇÒ»Ö±ÔÙ¶Ô´úÂë×öÔٴθ´²é£¬¿´ÓÐûÓÐSQL×¢È붶´¡£
´æÔÚSQL×¢È붶´£¬¾ÍÒòΪÄãµÄSQLÓï¾äÊÇ×Ô¼ºÆ´´ ......
Ê×ÏȾÍÊÇÒª×Ô¼º±àдһ¶Î´úÂ룬´æΪ.stx
Îļþ£¨ÀýÈçsql.stx£©£¬È»ºóÔÚeditplusµÄ²Ëµ¥À¸Tools->Configure User
Tools->Files->Setting &syntax,µãadd°´Å¥£¬ÔÚdescriptionÀ¸Î»ÌîÉÏsql,file
ExtensionsÀ¸Î»Ò²ÌîÉÏsql,Èç¹ûÓжà¸öÀ©Õ¹Ãû£¬Ö®¼äÓÓ£»”¸ô¿ª£¨ÀýÈ磺sql;db2£©,È»ºóÔÚsyntax
fileÀ¸Î»ÌîÉ ......