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

Oracleѧϰ±Ê¼Çժ¼6


  declare
  begin
   --SQLÓï¾ä
   --Ö±½ÓдµÄSQLÓï¾ä(DML/TCL)
   --¼ä½Óдexecute immediate <DDL/DCLÃüÁî×Ö·û´®>
   --select Óï¾ä
        <1>±ØÐë´øÓÐinto×Ó¾ä
         select empno into eno from emp
           where empno =7369;
        <2>Ö»Äܲ鵽һÐÐ**********
        <3>×ֶθöÊý±ØÐëºÍ±äÁ¿µÄ¸öÊýÒ»ÖÂ
  exception
    --Òì³£
    when <Òì³£Ãû×Ö> then --ÌØ¶¨Òì³£
        <´¦ÀíÓï¾ä>
    when others then  --ËùÓÐÒì³£¶¼¿É²¶»ñ
        <´¦ÀíÓï¾ä>   
  end;
<Àý×Ó>
   ±àд³ÌÐò ÏòDEPT±íÖвåÈëÒ»Ìõ¼Ç¼£¬
   ´Ó¼üÅÌÊäÈëÊý¾Ý£¬Èç¹û
      Êý¾ÝÀàÐÍÊäÈë´íÎóÒªÓÐÌáʾ
      ÎÞ·¨²åÈë¼Ç¼ Ò²ÒªÓÐÌáʾ
      Ö»ÄÜÊäÈëÕýÊý,Èç¹ûÓиºÊýÌáʾ
   declare
    n number;
    no dept.deptno%type;
    nm dept.dname%type;
    lc dept.loc%type;
    exp exception;   --Òì³£µÄ±äÁ¿
    exp1 exception;
    num number:=0;  --¼ÆÊýÆ÷
    pragma exception_init(exp,-1); --Ô¤¶¨ÒåÓï¾ä
         --(-1´íÎóºÍÒì³£±äÁ¿¹ØÁª)
    pragma exception_init(exp1,-1476);
    e1 exception; --×Ô¶¨ÒåÒì³£±äÁ¿
   begin
    --ÊäÈëÖµ
     no := '&±àºÅ';
     num := num + 1;
     if no < 0 then
        raise e1;    --×Ô¶¨ÒåÒì³£µÄÒý·¢
&


Ïà¹ØÎĵµ£º

ORACLEºÍPOSTGRESQLµÄSQLÓï¾ä±È½Ï

oracle ·½·¨                                                & ......

sql serverÖÐinºÍexistsµÄÐ¡Çø±ð oracleδ²âÊÔ

in µÄ»°£¬ Èç¹ûÊÇnull ¾Í²»±È½ÏÁË£¬¼È²»ÊÇin Ò²²»ÊÇ not in
existsµÄ»° ÒòΪÓà = ¼ÓÔÚÌõ¼þÀï±È½ÏÁË£¬ËùÒÔ null ÊÇ not exists
select *
from pricetemp
where cast(ÉÌÆ·¥³ー¥É as varchar(10))not in(
           select shohin_cd
  &nbs ......

ÈçºÎ½«TXT,EXCEL»òCSVÊý¾Ýµ¼ÈëORACLEµ½¶ÔÓ¦±íÖÐ

 ·½·¨Ò»£¬Ê¹ÓÃSQL*Loader  
  Õâ¸öÊÇÓõĽ϶àµÄ·½·¨£¬Ç°Ìá±ØÐëoracleÊý¾ÝÖÐÄ¿µÄ±íÒѾ­´æÔÚ¡£  
  ´óÌå²½ÖèÈçÏ£º  
  1   ½«excleÎļþÁí´æÎªÒ»¸öÐÂÎļþ±ÈÈçÎļþÃûΪtext.txt£¬ÎļþÀàÐÍÑ¡Îı¾Îļþ£¨ÖƱí·û·Ö¸ô£©£¬ÕâÀïÑ¡ÔñÀàÐÍΪcsv£¨¶ººÅ·Ö¸ô£©Ò²ÐУ¬µ«ÊÇÔÚдºóÃæµÄcontrol. ......

oracleʵ¼ù

1.
´íÎóÌáʾ£ºORA-12545:ÒòÄ¿±êÖ÷»ú»ò¶ÔÏó²»´æÔÚ,Á¬½Óʧ°Ü.
´íÎóÖ¢×´£ºÐ½¨µÄÊý¾Ý¿âÔÚOEM¿ØÖÆÌ¨ÎÞ·¨ÏÔʾ£¨sysmanÓû§µÇ½£©£¬¶ÀÁ¢Æô¶¯Ä£Ê½¿ÉÒÔÕÒµ½£¬µ«ÎÞ·¨µÇ½£¬³öÏÖÈçÉÏ´íÎó¡£
½â¾ö°ì·¨£ºÐÞ¸Äoracle°²×°Ä¿Â¼Ï£¨oracle\ora90\network\ADMIN£©µÄtnsnames.oraÎļþ£¬½«µ±Ç°Êý¾Ý¿âÌí¼Óµ½¼àÌý¶ÔÏóÖС£ÐÞ¸ÄÖ®ºó£¬¿ÉÒÔÔÚ¶ÀÁ¢Ä ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ