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
Ïà¹ØÎĵµ£º
sql > variable jobno number ;
sql > begin
sql > DBMS_JOB.submit(:jobno, ' pro_name(); ' ,sysdate, ' sysdate+1 ' );
dbms_job.submit(:job1, ' MYPROC; ' ,sysdate, ' sysdate+1/1440 ' );¡¡¡¡ -- ÿÌì1440·ÖÖÓ£¬¼´Ò»·ÖÖÓÔËÐÐtest¹ý³ÌÒ»´Î
sql > commit ;
sql > end ; ......
µ¥±í²åÈëÒÔinsert into¿ªÍ·,²»ÄÜÓÐthen intoÓï¾ä.
¶à±í²åÈëÒÔinsert first/all ¿ªÍ·,¿ÉÒÔÓÐthen intoÓï¾ä
ÔÚOracle²Ù×÷¹ý³ÌÖо³£»áÓöµ½Í¬Ê±Ïò¶à¸ö²»Í¬µÄ±í²åÈëÊý¾Ý£¬´ËʱÓøÃÓï¾ä¾Í·Ç³£ºÏÊÊ¡£
All±íʾ·Ç¶Ì·ÔËË㣬¼´Âú×ãÁ˵ÚÒ»¸öÌõ¼þÒ²µÃÏòÏÂÖ´Ðв鿴ÊÇ·ñÂú×ãÆäËüÌõ¼þ£¬¶øFirstÊǶÌ·ÔËËãÕÒµ½ºÏÊÊÌõ¼þ¾Í²»ÏòϽøÐС£
I ......
Á·Ï°:
drop table Employee;
create table Employee(
id number primary key,
  ......
Êý¾ÝÀàÐÍ
²ÎÊý
ÃèÊö
char(n)
n=1 to 2000×Ö½Ú
¶¨³¤×Ö·û´®£¬n×Ö½Ú³¤£¬Èç¹û²»Ö¸¶¨³¤¶È£¬È±Ê¡Îª1¸ö×Ö½Ú³¤£¨Ò»¸öºº×ÖΪ2×Ö½Ú£©
varchar2(n)
n=1 to 4000×Ö½Ú
¿É±ä³¤µÄ×Ö·û´®£¬¾ßÌ嶨ÒåʱָÃ÷×î´ó³¤¶Èn£¬
ÕâÖÖÊý¾ÝÀàÐÍ¿ÉÒÔ·ÅÊý×Ö¡¢×ÖĸÒÔ¼°ASCIIÂë×Ö·û¼¯(»òÕßEBCDICµÈÊý¾Ý¿âϵͳ½ÓÊܵÄ×Ö·û¼¯±ê×¼)ÖеÄËùÓзûºÅ¡£
Èç¹ ......
¿ªÔ´¿çƽ̨±à³ÌÓïÑÔJava¼ÓÉÏ¿ªÔ´Êý¾Ý¿âMySQL£¡×ÔSunÊÕ¹ºMySQL¿ªÊ¼£¬±¾ÒÔΪSun½«´óÕ¹ºêͼ¡£È»SunȴûÓаÑÎÕ»ú»á£¬·´¶øûÓнûµÃס½ðÈÚΣ»úµÄ³å»÷¡£ÂäµÃ¸öÃæÁÙÊÕ¹ºµÄ¾ÖÃæ¡£»òÐíMySQLÖ®¸¸Richard StallmanÒ²¾ø¶ÔûÓÐÏëµ½£¬ÈÃSunÊÕ¹ºMySQL£¬È´ÊÇ°ÑMySQLÍÆÏòÁËÉîÔ¨¡£MySQLµÄºÎÈ¥ºÎ´Ó£¡
Ãæ¶ÔÕâ¸öÎÊÌ⣬MySQLÖ ......