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

oracleѧϰ£¨´´½¨±í£©

ÎÒÏë×î³õѧϰÊý¾Ý¿âʱ¶¼ÊÇÒÔstudent±í¡¢course±íºÍsc±íΪÀýµÄ°É
Ê×ÏÈ´´½¨ÕâÈýÕÅ±í£º±ØÒªÊ±¿ÉÖØÐ´´½¨Óû§¼°ÃÜÂë²¢µÇ½
»·¾³£ºoracle 10g
declare
  vcnt number;
begin
  select count(*) into vcnt from user_tables where table_name='SC';
  If vcnt = 1 Then
    Execute immediate 'drop table sc';
  end if;
  select count(*) into vcnt from user_tables where table_name='STUDENT';
  If vcnt = 1 Then
    Execute immediate 'drop table student';
  end if;
  select count(*) into vcnt from user_tables where table_name='COURSE';
  If vcnt = 1 Then
    Execute immediate 'drop table course';
  end if;
end;
/
--´´½¨±í
Create table student
(sno char(10) primary key,
 sname varchar(20) not null,
 sage smallint,
 ssex char(2),
 sdept varchar(20));
Create table course
(cno char(10) primary key,
 cname varchar(20) not null,
 credit smallint);
Create table sc
(sno char(10),
 cno char(10),
 grade smallint,
 primary key(sno,cno));
--Ïò±íÖвåÈëÊý¾Ý
insert into student values('001','¸ðÁé','19','f','MA');
insert into student values('002','ÔÀÁÖÔÂ','25','f','MA');
insert into student values('003','¼§Ê¤¿¡','16','f','CS');
insert into student values('004','ÂíÔ´','20','f','MA');
insert into student values('005','ÎÌÓ¡','23','m','C');
insert into course values('C01','CÓïÑÔ','4');
insert into course values('C02','Êýѧ','4');
insert into course values('C03','Ó¢Óï','2');
insert into course values('C04','¼ÆËã»ú','5');
insert into course values('C05','Êý×Öµç·','3');
insert into course values('C06','Êý¾Ý¿â','2');
--001ºÅѧÉúÑ¡Ð޿γÌ
insert into sc values('001','C05','75');
insert into sc values('001','C01','68');
insert into sc values('001','C03','86');
insert into sc values('001','C02','40');
insert into sc values('001','C04','97');
--002ºÅѧÉúÑ¡Ð޿γÌ
insert into sc values('002','C01','60');
insert into sc values('002','


Ïà¹ØÎĵµ£º

OracleÖеÄdecode

ÉÏһƪÎÄÕÂдÁËÒ»¸öoracleµÄÒ»¸öÐÐתÁеÄÀý×Ó£¬ÀïÃæÓõ½ÁËoracleÖÐÖØÒªµÄº¯Êý decode,ÕâÆªÎÄÕ¾ÍÀ´¼òµ¥µÄѧϰÕâ¸öº¯Êý
DECODEº¯ÊýºÍÎÒÃÇÓïÑԽṹÖеÄÌõ¼þÓï¾ä£¨IF£©ÏàËÆ¡£Ëü½«ÊäÈëÊýÖµÓ뺯ÊýÖеIJÎÊýÁбíÏà±È½Ï£¬¸ù¾ÝÊäÈëÖµ·µ»ØÒ»¸ö¶ÔÓ¦Öµ¡£
DECODEº¯ÊýÏ൱ÓÚÒ»Ìõ¼þÓï¾ä(IF).Ëü½«ÊäÈëÊýÖµÓ뺯ÊýÖеIJÎÊýÁбíÏà±È½Ï£¬¸ù¾ÝÊ ......

oracle 10g em¡¢isqlplus·ÃÎʲ»Á˵Ľâ¾ö·½·¨£¨»ã×Ü£©

oracle 10g em¡¢isqlplus·ÃÎʲ»Á˵Ľâ¾ö·½·¨£¨»ã×Ü£©
oracle 10g em¡¢isqlplusµÄ¹ÜÀí
Èç¹ûweb·½Ê½µÄem£¬isqlplus·ÃÎʲ»ÁË¡£
1. ¼ì²éÖ÷»úÃû/IP¡¢¶Ë¿ÚÊÇ·ñÕýÈ·
°²×°Ê±µÄÖ÷»úÃû/IP¡¢¶Ë¿Ú¼Ç¼ÔÚ$ORACLE_HOME/install/portlist.ini ÎļþÖС£
ȱʡÊÇ£º
Ò»°ãÓû§               ......

oracleÖÐtypeµÄʹÓÃ

create or replace type mytype IS TABLE OF varchar2(20);
declare type1 mytype :=mytype('1','2','3','4');
i number:=1;
var_str varchar(20):='liaomin';
begin
type1.EXTEND;
type1(type1.COUNT):=var_str;
loop
  dbms_output.put_line(type1(i));
  i:=i+1;
  exit when i=type1.count+1; ......

Oracle²âÊÔ´æ´¢¹ý³ÌÁ½ÖÖ·½Ê½

ÔÚ³õѧOracleʱ£¬Ð´ÁËÒ»¸ö´æ´¢¹ý³Ì£¬Ãû³ÆÊÇ£ºPROC_GET_BILL£¬Èý¸ö²ÎÊý£¬µÚ1£¬3ÊÇin²ÎÊý£¬µÚ2ÊÇout²ÎÊý£¬Ð´ÍêÖ®ºó£¬Ïë²âһϣ¬½á¹û·¢ÏÖÍøÉÏÓжàÖÖ·½Ê½£¨ÆäÖØÒªÊÇÏÂÃæÕâÁ½ÖÖ£¬Ö»ÊÇд·¨²»Í¬¶øÒÑ£©£¬¸Õ¿ªÊ¼°ÑÁ½ÖÖ±äÁ¿¶¨Ò巽ʽ¸ã´íÁË£¬Ò»Ö±Ö´Ðв»¹ý£¬¾­ÂýÂý³¢ÊÔ£¬µÃµ½ÁËÏÂÃæÁ½ÖÖд·¨£¬Ï£ÍûÏñÎÒÕâÑù³õѧÕßÉÙ×ßÍä·£¬Ö±½Ó¸ãÇåÁ½ÖÖ· ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ