<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    巷尾的酒吧

      BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
      64 Posts :: 0 Stories :: 5 Comments :: 0 Trackbacks
    oracle 創建表table:
    create table abin1(
    id number(20,0) not null,
    name varchar2(100)not null,
    pwd nvarchar2(100) not null,
    create_time date,
    constraint pk_abin1 primary key(id)
    )

    oracle創建索引(index):
    create index myname on abin1(name);

    oracle創建序列sequence:
    create sequence abin1_seq
    minvalue 1
    maxvalue 999999999
    start with 1
    increment by 1
    cache 20;
    創建觸發器:
    create or replace trigger abin1_tri
    before insert on abin1
    for each row
    begin
    select abin1_seq.nextval into :new.id from dual;
    end;


    測試一條記錄:
    insert into abin1 (name,pwd,create_time) values ('abin','lee',sysdate); 
    呵呵,這里插入了數據,主鍵自增了,說明成功了。


    創建存儲過程procedure:
    create or replace procedure abin1_pro
    is
    cursor mycur is select t.* from abin1 t;
    abin mycur%rowtype;
    begin
         open mycur;
         loop
            fetch mycur into abin;
            if(abin.name='abin')then
                  update abin1 t set t.name='abining',t.pwd=abin.pwd,t.create_time=sysdate where t.id=abin.id;
                  commit;
            end if;
            exit when mycur%NOTFOUND;
         end loop;
            if(mycur%ISOPEN)then
                 close mycur;
            end if;
    end;


    測試存儲過程示例:
    declare
    begin
            abin1_pro;
    end;


    創建oracle函數function:
    create or replace function abin_func
    return number
    is
    total number;
    begin
    select count(1) into total from abin1 t;
    return(total);
    end;


    創建測試函數示例:
    declare
    total number;
    begin
          total:=abin_func;
          dbms_output.put_line(total);
    end;


    oracle創建視圖:
    create or replace view abin1_view
    as
    select t.* from abin1 t;


    oracle創建package:
    create or replace package abin_pac is
    procedure abinpac;
    end;


    oracle創建package body:
    create or replace package body abin_pac is
    procedure abinpac is
    total number;
    begin
     select count(1) into total from abin1;
     dbms_output.put_line(total);
    end;
    end;

    測試代碼:
    begin
     abin_pac.abinpac;
    end;



    posted on 2013-06-02 23:26 abing 閱讀(1251) 評論(0)  編輯  收藏 所屬分類: oracle
    主站蜘蛛池模板: 在线亚洲午夜片AV大片| 一色屋成人免费精品网站| 国产亚洲中文日本不卡二区| 亚洲精品无码永久中文字幕| 又粗又大又长又爽免费视频 | 狼友av永久网站免费观看| 久久成人无码国产免费播放| 日韩免费高清一级毛片| 亚洲熟妇无码八V在线播放| 亚洲日韩图片专区第1页| 亚洲午夜久久久影院| 免费va人成视频网站全| 国外成人免费高清激情视频| 成人福利免费视频| 久久国产乱子伦免费精品| a级男女仿爱免费视频| jizz免费观看| 一级毛片在线免费播放| 特级毛片A级毛片100免费播放 | 丁香花免费完整高清观看| 久久ww精品w免费人成| 久久香蕉国产线看免费| av永久免费网站在线观看| 中国videos性高清免费| 在线视频网址免费播放| 国产精品1024在线永久免费| 一级看片免费视频| 一级毛片免费观看不收费| 一级免费黄色大片| j8又粗又长又硬又爽免费视频 | 亚洲午夜无码片在线观看影院猛 | 亚洲精品无码不卡在线播放| 亚洲人成77777在线观看网| 亚洲av日韩av无码av| 亚洲AV成人无码天堂| 国产成人精品日本亚洲直接| 久久亚洲精品国产亚洲老地址| 亚洲AV色吊丝无码| 亚洲AV无码片一区二区三区| 精品国产亚洲第一区二区三区 | 亚洲麻豆精品国偷自产在线91|