oracleѧϰ±Ê¼Ç2 ±íµÄ»ù±¾²Ù×÷
Oracle±íµÄ¹ÜÀí
±íÃûºÍÁÐÃûµÄÃüÃû¹æÔò£º
1±ØÐëÒÔ×Öĸ¿ªÍ·
2³¤¶È²»Äܳ¬¹ý30¸ö×Ö·û
3²»ÄÜʹÓÃOracleµÄ±£Áô×Ö
4Ö»ÄÜʹÓÃÈçÏÂ×Ö·û£ºA-Z,a-z,0-9,$,#µÈ
OracleÖ§³ÖµÄÊý¾ÝÀàÐÍ£º
1char ¶¨³¤£¬×î´ó2000×Ö·û
Àý×Ó£ºchar(10) ‘Ïþ»Ô’ Ç°Ëĸö×Ö·û·Å’Ïþ»Ô’£¬ºóÌíÁù¸ö¿Õ¸ñ²¹È«
2varchar2(20) ±ä³¤£¬×î´ó4000¸ö×Ö·û
Àý×Ó£ºvarchar2(20) ‘Ïþ»Ô’ OracleΪÆä·ÖÅä4¸ö×Ö·û£¬ÕâÑù½ÚÊ¡¿Õ¼ä£¬µ«ÊÇÔÚ²éÕÒʱ£¬varchar2ÀàÐÍÒª±ÈcharÀàÐÍÂýºÜ¶à¡£
3clob(character large object) ×Ö·ûÐÍ´ó¶ÔÏó£¬×î´ó4G¡£
Êý×ÖÐÍ£º
1number ·¶Î§ -1038~1038 ¿ÉÒÔ±íʾÕûÊý£¬Ò²¿ÉÒÔ±íʾСÊý¡£
2number£¨5£¬2£©±íʾһ¸öСÊý£¬ÓÐ5λÓÐЧÊý£¬2λСÊý£¬·¶Î§-999.99~999.99
3number(5)±íʾһ¸ö5λÕûÊý£¬·¶Î§ÊÇ£º-99999~99999
ÈÕÆÚÀàÐÍ£º
1date °üÀ¨ÄêÔÂÈÕʱ·ÖÃë
2timestamp ÕâÊǶÔdateÊý¾ÝÀàÐ͵ÄÀ©Õ¹¡£
¶þ½øÖÆÊý¾ÝÀàÐÍ£º
Blob ¶þ½øÖÆÊý¾Ý£¬¿ÉÒÔ´æ·ÅͼƬ¡¢ÉùÒô……4G
ÆäʵÕæʵÏîÄ¿Öнö½öÊÇÔÚÊý¾Ý¿âÖдæ·Å·¾¶¶øÒÑ£¬²»»áÕæµÄÈ¥´æ´¢¶þ½øÖÆÊý¾Ý£¬µ±È»£¬Êý¾Ý¿âÖдæ·Å¶«Î÷ÊǺܰ²È«µÄ£¬ËùÒÔ£¬Èç¹û¶ÔÊý¾Ý°²È«ÐÔµÄÒªÇóºÜ¸ß£¬¿ÉÒ԰Ѹöþ½øÖÆÊý¾Ý·ÅÈëÊý¾Ý¿âÖС£
½¨±í£º
Àý×Ó£º
Create table student(--±íÃû
Xh number(4),--ѧºÅ
Xm varchar2(20),---ÐÕÃû
Sex char(2),--ÐÔ±ð
Birthday date,--ÉúÈÕ
Sal number(7,2)—½±Ñ§½ð
);
ɾ³ý±í£º
Drop table student;
Ϊ±íÌí¼ÓÒ»¸ö×ֶΣº
Alter table student add(classid number(2));
ÐÞ¸Ä×ֶεij¤¶È£º
Alter table student modify (xm varchar2(30));
ÐÞ¸Ä×ֶεÄÀàÐÍ»òÊÇÃû×Ö£º£¨²»ÄÜÓÐÊý¾Ý£©
Alter table student modify(xm char(30));
ɾ³ýÒ»¸ö×ֶΣº
Alter table student drop column sal;
Ð޸ıíµÄÃû×Ö£º
Rename student to stu;
²¹³ä£º
Desc emp£»
¸ÃÃüÁî»áÁгöempµÄ±íÍ·ÐÅÏ¢¡£
SQL> desc myemp;
Name Type Nullable Default Comments
-------- ------------ -------- ------- --------
EMPNO NUMBER(4) Y
ENAME &nb
Ïà¹ØÎĵµ£º
dc-test2<oracle>sqlplus /nolog
SQL*Plus: Release 10.2.0.4.0 - Production on Thu Feb 25 19:23:35 2010
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
SQL> desc v$datafile;
SP2-0640: Not connected
SP2-0641: "DESCRIBE" requires connection to server
SQL> conn / a ......
PL/SQLÊǶÔOracleÊý¾Ý¿â½øÐвÙ×÷µÄÒ»ÖÖ¹ý³ÌÐÔ±à³ÌÓïÑÔ£¬Ëü¿ÉÒÔÔÚSQL * plusÖÐÖ´ÐУ¬Ò²¿ÉÒÔǶÈëµ½JAVA»òÕßC++ÖС£Æä»ù±¾×é³ÉΪ£º
DECLARE
...
BEGIN
...
EXCEPTION
...
END
¿ÉÓÃÀ´½«¶ÔÊý¾Ý¿âµÄ¸÷ÖÖ²Ù×÷·âװΪһ¸ö´úÂë¿é£¬ÎªÁ˼ÓÇ¿¿ÉÖØÓÃÐÔ£¬»¹¿É½«Öظ´ÐÔ´úÂëд³Éº¯ÊýÓë´æ´¢¹ý³Ì£¬Ó ......
תÔØÒ»¸öBDBµÄÏà¹Ø½éÉÜ£¬»ù±¾¿ÉÒÔµ±ËÙ³ÉÊÖ²áÓ㬸ü¶àµÄÎĵµ¿ÉÒÔÈ¥Oracle¹Ù·½ÍøÕ¾ÏÂÔØ¡£
SQL ¿ª·¢ÈËÔ± Oracle Berkeley DB Ö¸ÄÏ
×÷ÕߣºMargo Seltzer
Oracle Berkeley DB Öг£Óà SQL º¯ÊýʹÓÃÖ¸ÄÏ¡£
2007 Äê 9 Ô·¢±í
³£³£ÓÐÈËÎÊ Oracle Berkeley DB “ÎÒÈçºÎÔÚ Berkeley DB ÖнøÐÐ <SQL ²éѯ>£¿"Òò´Ë£¬ÎÒÃÇ ......
ÏȽ¨ÁËÕŲâÊÔ±í
SQL> select * from test_a;
ID PLAYNAME SCORE
-------------------- --- ......