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

PL/SQL ѧϰ


1¡¢INSTR4(string1,string2[,a][,b]) ·µ»Østring1Öаüº¬string2µÄλÖÃaºÍbÊÇÒÔUCS4´úÂëµãΪµ¥Î»¡£
ÒÔÉϺ¯Êý·µ»Østring1Öаüº¬string2µÄλÖᣴÓ×ó±ß¿ªÊ¼É¨Ãèstring1,ÆðʼλÖÃÊÇA¡£Èç¹ûAΪ¸ºÊýÄÇô´ÓÓұ߿ªÊ¼É¨Ãè¡£µÚB´Î³öÏÖµÄλÖý«±»·µ»Ø¡£AºÍBȱʡ¶¼Îª1£¬¼´·µ»ØÔÚ
string1ÖеÚÒ»´Î³öÏÖstring2µÄλÖá£Èç¹ûstring2ÔÚAºÍBµÄ¹æ¶¨ÏÂûÓÐÕÒµ½ÄÇô¾Í·µ»Ø0¡£Î»ÖõļÆËãÊÇÏà¶ÔÓÚstring1µÄ¿ªÊ¼Î»Öõģ¬¶ø²»¹ØAºÍBµÄÈ¡Öµ¡£
}
2¡¢LPAD£¨ÁÐÃû,Êý×Ö,‘Òª²¹ÉϵÄ×Ö·û’£©×ó²¹Î»
   RPAD£¨ÁÐÃû£¬Êý×Ö£¬‘Òª²¹ÉϵÄ×Ö·û’£©ÓÒ²¹Î»
3¡¢TRIM£¨‘child_str’ from ‘parents_str’£©½«Á¬Ðø×Ó´®£¨Ö»ÄÜÓÐÒ»¸ö×Ö·û£©´ÓÖ÷´®µÄÁ½±ß½ØÈ¡³öÀ´£¬Çø·Ö´óСд¡£
ĬÈÏΪ½ØÈ¡¿Õ¸ñ¡£
LTRIM£¨£©×ó½ØÈ¡
RTRIM£¨£©ÓÒ½ØÈ¡
4¡¢ascii(x)º¯Êý£¬·µ»Ø'X'×Ö·ûµÄÊ®½øÖÆÊý£¬¼´XµÄASCIIÂëÖµ¡£
5¡¢chr(x)º¯Êý£¬·µ»ØASCIIÂëΪXµÄ×Ö·û¡£
6¡¢length(x)º¯Êý£¬Çó´®XµÄ³¤¶È£¬ÓëÖ®ÏàËƵÄÊÇlengthb(x)º¯Êý£¬ÓÃÔÚ¶à×Ö½Ú×Ö·ûÖС£
7¡¢replace(x,y[,z])º¯Êý£¬·µ»ØֵΪ½«´®XÖеÄY´®ÓÃZ´®Ìæ»»ºóµÄ½á¹û×Ö·û´®¡£ÈôÊ¡ÂÔZ²ÎÊý£¬Ôò½«´®XÖÐΪY´®µÄµØ·½É¾³ý¡£
8¡¢soundex(x)º¯Êý£¬·µ»Ø´®XµÄÓïÒôÃèÊö£¬Õâ¸öÃèÊöÓÉ4¸ö×Ö·û×é³É£¬ËµÃ÷´®XµÄÉùÒô±íʾÐÎʽ·¢Òô£¬ÓÐʱÔÚÖ»ÖªµÀÒ»¸öÃû×ֵķ¢Òô¶ø²»ÖªµÀƴдÇé¿öÏ»òÐíÄÜÓõ½¡£
Àý£ºselect soundex('smith') from dual; ·µ»ØֵΪ£ºS530.
 
9¡¢translate(x,y,z)º¯Êý£¬·µ»Ø½«X´®ÖÐÿ¸ö×Ö·û°´ËüÔÚY´®ÖгöÏÖµÄλÖ÷­Òë³ÉZ´®ÖÐÏàӦλÖõÄ×Ö·ûºóµÄ½á¹û£¬Ï൱ÓëÌæ»»¡£
Àý£ºselect translate('this is an example','my is','@#$%^&') from dual;
10¡¢NLSº¯Êý
   ³ýÁËNCHR£¬ÕâЩº¯Êý¶¼ÊÇÒÔ×Ö·ûÀàÐÍΪ²ÎÊý·µ»Ø×Ö·ûÀàÐÍÖµ¡£
11¡¢CONVERT(string,dest_charset[,source_charset])
    ½«ÊäÈëstringת»»ÎªÖ¸¶¨×Ö·û¼¯dest_charset¡£source_charsetÊÇÊäÈëÖµµÄ×Ö·û¼¯——Èç¹ûËüûÓб»Ö¸¶¨£¬ÔòȱʡΪÊý¾Ý¿â×Ö·û¼¯¡£ÊäÈëÖµ¿ÉÒÔÊÇCHAR¡¢VARCHAR2¡¢NCHAR¡¢
NVARCHAR2¡¢CLOBºÍNCLOBÀàÐÍ¡£·µ»ØֵΪVARCHAR2ÀàÐÍ¡£Èç¹ûdest_charsetÖÐûÓÐÊäÈë×Ö·û´®ÖеÄÒ»¸ö×Ö·û£¬½«»áʹÓÃÒ»¸ö´úÌæ×Ö·û£¨ÓÉdest_charset¶¨Ò壩
12¡¢NCHR(X)
    ·µ»ØÊý¾Ý¿â¹ú¼Ò×Ö·û¼¯ÖÐֵΪXµÄ×Ö·û¡£NCHR(X) µÈ¼ÛÓÚCHR(x USING NCHAR_CS).
13¡¢NLS_CHARSET_DECL_LEN(byte_width,charset)
  


Ïà¹ØÎĵµ£º

SQL SERVER ÓëACCESS¡¢EXCELµÄÊý¾Ýת»»

 ÊìϤSQL SERVER 2000µÄÊý¾Ý¿â¹ÜÀíÔ±¶¼ÖªµÀ£¬ÆäDTS¿ÉÒÔ½øÐÐÊý¾ÝµÄµ¼Èëµ¼³ö£¬Æäʵ£¬ÎÒÃÇÒ²¿ÉÒÔʹÓÃTransact-SQLÓï¾ä½øÐе¼Èëµ¼³ö²Ù×÷¡£ÔÚTransact-SQLÓï¾äÖУ¬ÎÒÃÇÖ÷ҪʹÓÃOpenDataSourceº¯Êý¡¢OPENROWSET º¯Êý£¬¹ØÓÚº¯ÊýµÄÏêϸ˵Ã÷£¬Çë²Î¿¼SQLÁª»ú°ïÖú¡£ÀûÓÃÏÂÊö·½·¨£¬¿ÉÒÔÊ®·ÖÈÝÒ×µØʵÏÖSQL SERVER¡¢ACCESS¡¢EXC ......

PL/SQLʹÓü¼ÇÉ£¨PL/SQL 7.0.0ÒÔÉÏ£©

 
1¡¢PL
/SQL
Developer¼ÇסµÇ½ÃÜÂë
   ÔÚʹÓÃPL
/SQL
Developerʱ£¬ÎªÁ˹¤×÷·½±ãÏ£ÍûPL
/SQL
Developer¼ÇסµÇ¼OracleµÄÓû§ÃûºÍÃÜÂ룻
ÉèÖ÷½·¨£ºPL
/SQL
Developer 7.1.4 ->tools->Preferences->Oracle->Logon History
£¬ “Store history”ÊÇĬÈϹ´Ñ¡µÄ£¬¹´ÉÏ ......

SQLÖÐtruncate tableºÍdeleteµÄÇø±ð

TRUNCATE TABLE ÔÚ¹¦ÄÜÉÏÓë²»´ø Where ×Ó¾äµÄ Delete
Óï¾äÏàͬ£º¶þÕß¾ùɾ³ý±íÖеÄÈ«²¿ÐС£µ« TRUNCATE TABLE ±È Delete Ëٶȿ죬ÇÒʹÓõÄϵͳºÍÊÂÎñÈÕÖ¾×ÊÔ´ÉÙ¡£
Delete
Óï¾äÿ´Îɾ³ýÒ»ÐУ¬²¢ÔÚÊÂÎñÈÕÖ¾ÖÐΪËùɾ³ýµÄÿÐмǼһÏî¡£TRUNCATE TABLE ͨ¹ýÊÍ·Å´æ´¢±íÊý¾ÝËùÓõÄÊý¾ÝÒ³À´É¾³ýÊý¾Ý£¬²¢ÇÒÖ»ÔÚÊÂÎñÈÕÖ¾ÖмÇÂ¼Ò ......

SQL×Ô¶¯Éú³ÉʵÌåÀà

declare @tablename varchar(20)
select @tablename = 'o_ems'
-------------Éú³É±äÁ¿,ʹÓñí¸ñÐÎʽ(ctrl + D)Êä³ö£¬È¡µÚÒ»¸ö×ֶεÄÖµ----------------------------------
select 'private '+  
Case when t.name='varchar' Then 'string'
    when t.name='char' Then 'string' &nb ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ