ORACLEº¯Êý´óÈ«
SQLÖеĵ¥¼Ç¼º¯Êý
1.ASCII
·µ»ØÓëÖ¸¶¨µÄ×Ö·û¶ÔÓ¦µÄÊ®½øÖÆÊý;
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
¸ø³öÕûÊý,·µ»Ø¶ÔÓ¦µÄ×Ö·û;
SQL> select chr(54740) zhao,chr(65) chr65 from dual;
ZH C
-- -
ÕÔ A
3.CONCAT
Á¬½ÓÁ½¸ö×Ö·û´®;
SQL> select concat('010-','88888888')||'ת23' ¸ßǬ¾ºµç»° from dual;
¸ßǬ¾ºµç»°
----------------
010-88888888ת23
4.INITCAP
·µ»Ø×Ö·û´®²¢½«×Ö·û´®µÄµÚÒ»¸ö×Öĸ±äΪ´óд;
SQL> select initcap('smith') upp from dual;
UPP
-----
Smith
5.INSTR(C1,C2,I,J)
ÔÚÒ»¸ö×Ö·û´®ÖÐËÑË÷Ö¸¶¨µÄ×Ö·û,·µ»Ø·¢ÏÖÖ¸¶¨µÄ×Ö·ûµÄλÖÃ;
C1 ±»ËÑË÷µÄ×Ö·û´®
C2 Ï£ÍûËÑË÷µÄ×Ö·û´®
I ËÑË÷µÄ¿ªÊ¼Î»ÖÃ,ĬÈÏΪ1
J ³öÏÖµÄλÖÃ,ĬÈÏΪ1
SQL> select instr('oracle traning','ra',1,2) instring from dual;
INSTRING
---------
9
6.LENGTH
·µ»Ø×Ö·û´®µÄ³¤¶È;
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 ±±¾©Êк£¶§Çø 6 9999.99 &nbs
Ïà¹ØÎĵµ£º
Oracle´æ´¢¹ý³Ì°üº¬Èý²¿·Ö£º¹ý³ÌÉùÃ÷£¬Ö´Ðйý³Ì²¿·Ö£¬´æ´¢¹ý³ÌÒì³£¡£
Oracle´æ´¢¹ý³Ì¿ÉÒÔÓÐÎÞ²ÎÊý´æ´¢¹ý³ÌºÍ´ø²ÎÊý´æ´¢¹ý³Ì¡£
Ò»¡¢Î޲γÌÐò¹ý³ÌÓï·¨
1 create or replace procedure NoParPro
2 as ;
3 begin
4 ;
5 exception &nb ......
1.´´½¨±í£º
a. ´´½¨xs±íÖмÆËã»úרҵѧÉúµÄ±¸·Ý
Create table xs_jsj as select * from xs where zym=’¼ÆËã»ú’;
b.ÍêÕûµÄÀý×Ó£º
¡¡¡¡¡¡¡¡¡¡ Create table test ......
дµÄ´ÎÐò:
redo--> undo-->datafile
insertÒ»Ìõ¼Ç¼ʱ, ±í¸úundoµÄÐÅÏ¢¶¼»á·Å½ø redo ÖÐ, ÔÚcommit »ò֮ǰ, redo µÄÐÅÏ¢»á·Å½øÓ²ÅÌÉÏ. ¹ÊÕÏʱ, redo ±ã¿É»Ö¸´ÄÇЩÒѾcommit Á˵ÄÊý¾Ý.
redo->ÿ´Î²Ù×÷¶¼ÏȼǼµ½redoÈÕÖ¾ÖУ¬µ±³öÏÖʵÀý¹ÊÕÏ£¨Ïñ¶Ïµç£©£¬µ¼ÖÂÊý¾ÝδÄܸüе½Êý¾ÝÎļþ£¬ÔòÊý¾Ý¿âÖØÆôʱÐëredo£¬ÖØÐ ......
author£ºskate
time£º2010-05-31
ÎÒÃÇÔÚʹÓÃwindowsµÄʱºò£¬¶¼ÖªµÀÒª¶¨ÆÚÕûÀí´ÅÅÌË鯬£¬ÒòΪ´ÅÅÌË鯬»áÓ°ÏìÐÔÄÜ£¬¸ø¹ÜÀíÉÏ´øÀ´¶îÍâµÄ
¸ºµ£¡£ÄÇoracle¸üÊÇÈç´Ë£¬µ±Ëæ×ÅÊý¾ÝÔö¼Ó£¬oracle´¦Àíº£Á¿Êý¾Ý±¾Éí¾ÍÒѾºÜ·ÑÁ¦Á˰¡£¬Èç¹ûÔÙÓдóÁ¿
µÄË鯬£¬ÄǾÍÊÇÑ©ÉϼÓ˪°¡¡£ËùÒÔËéÆ¬ÒªÒýÆðdbaµÄ¸ß¶ÈÖØÊÓ£¬¾¡Ôç·¢ÏÖ¾¡Ôç´¦Àí¡£
莮 ......
oracle×Ö·û´®·Ö¸îºÍÌáÈ¡
·Ö¸î
create or replace function Get_StrArrayLength
(
av_str varchar2, --Òª·Ö¸îµÄ×Ö·û´®
av_split varchar2 --·Ö¸ô·ûºÅ
)
return number
is
lv_str varchar2(1000);
lv_length number;
begin
lv_str:=ltrim(rtrim(av_str));
&nb ......