91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

第一次接觸Oracle存儲過程

發布時間:2020-06-17 18:15:18 來源:網絡 閱讀:462 作者:flyinglxr 欄目:關系型數據庫

CREATE TABLE STUDENT(
    ID NUMBER(10)  NOT NULL ,
    NAME VARCHAR2(10) ,
    SEX CHAR(1),
    AGE Number(3),
    CREATIONDATE  DATE,
    MODIFIEDDATE DATE,
    PRIMARY KEY (ID));
    
 --查詢數據
select * from student;



 --插入數據
insert into student(id,name,sex,age,creationdate,modifieddate)
values(7023107001,'Liu','B',19,to_date('20160322','YYMMDD'),to_date('20160322','YYMMDD'));
insert into student(id,name,sex,age,creationdate,modifieddate)
values(7023107002,'Jack','B',19,to_date('20160322','YYMMDD'),to_date('20160322','YYMMDD'));
insert into student(id,name,sex,age,creationdate,modifieddate)
values(7023107003,'Robin','B',19,to_date('20160322','YYMMDD'),to_date('20160322','YYMMDD'));
insert into student(id,name,sex,age,creationdate,modifieddate)
values(7023107004,'Fuck','B',19,to_date('20160322','YYMMDD'),to_date('20160322','YYMMDD'));
insert into student(id,name,sex,age,creationdate,modifieddate)
values(7023107005,'Duck','B',19,to_date('20160322','YYMMDD'),to_date('20160322','YYMMDD'));
insert into student(id,name,sex,age,creationdate,modifieddate)
values(7023107006,'God','B',19,to_date('20160322','YYMMDD'),to_date('20160322','YYMMDD'));
insert into student(id,name,sex,age,creationdate,modifieddate)
values(7023107007,'Dog','B',19,to_date('20160322','YYMMDD'),to_date('20160322','YYMMDD'));
insert into student(id,name,sex,age,creationdate,modifieddate)
values(7023107008,'Bike','B',19,to_date('20160322','YYMMDD'),to_date('20160322','YYMMDD'));
insert into student(id,name,sex,age,creationdate,modifieddate)
values(7023107009,'Ella','B',19,to_date('20160322','YYMMDD'),to_date('20160322','YYMMDD'));
insert into student(id,name,sex,age,creationdate,modifieddate)
values(7023107010,'Make','B',19,to_date('20160322','YYMMDD'),to_date('20160322','YYMMDD'));
insert into student(id,name,sex,age,creationdate,modifieddate)
values(7023107011,'Cela','B',19,to_date('20160322','YYMMDD'),to_date('20160322','YYMMDD'));
insert into student(id,name,sex,age,creationdate,modifieddate)
values(7023107012,'MeLe','B',19,to_date('20160322','YYMMDD'),to_date('20160322','YYMMDD'));
insert into student(id,name,sex,age,creationdate,modifieddate)
values(7023107013,'LooK','B',19,to_date('20160322','YYMMDD'),to_date('20160322','YYMMDD'));
insert into student(id,name,sex,age,creationdate,modifieddate)
values(7023107014,'Jack','B',19,to_date('20160322','YYMMDD'),to_date('20160322','YYMMDD'));
insert into student(id,name,sex,age,creationdate,modifieddate)
values(7023107015,'EKK','B',19,to_date('20160322','YYMMDD'),to_date('20160322','YYMMDD'));
insert into student(id,name,sex,age,creationdate,modifieddate)
values(7023107016,'Jack','B',19,to_date('20160322','YYMMDD'),to_date('20160322','YYMMDD'));

select * from user_procedures where PROCEDURE_NAME='PRO_STUDENT';  

--存儲過程例子(計算學生總人數)

    CREATE OR REPLACE PROCEDURE PRO_STUDENT   
    AS  
    S_TOTAL NUMBER(10);   
    BEGIN  
     SELECT COUNT(*) INTO S_TOTAL FROM STUDENT;   
     DBMS_OUTPUT.PUT_LINE('學生人數:'||S_TOTAL);   
    END;  
    
    EXECUTE PRO_STUDENT;  

--統計女孩人數(帶輸入參數)
     --注意變量定義不能與表中變量相同
    CREATE OR REPLACE PROCEDURE PRO_GIRL_STUDENT(student_sex in CHAR)   
    AS  
    S_TOTAL NUMBER(10);   
    BEGIN  
     SELECT COUNT(*) INTO S_TOTAL FROM STUDENT s WHERE s.sex=student_sex;   
     DBMS_OUTPUT.PUT_LINE('學生人數:'||S_TOTAL);   
    END;  
    
    EXECUTE PRO_STUDENT;  
   

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

五家渠市| 北宁市| 陕西省| 濮阳市| 涡阳县| 成武县| 韶关市| 金湖县| 高台县| 宁南县| 抚顺市| 甘谷县| 伊川县| 临西县| 安宁市| 杨浦区| 澄江县| 铁力市| 万州区| 自贡市| 红桥区| 临城县| 南康市| 百色市| 察雅县| 罗城| 正定县| 溧阳市| 富锦市| 遂川县| 新郑市| 文成县| 武夷山市| 内丘县| 凉山| 木里| 泾阳县| 云阳县| 夏津县| 杭锦后旗| 枣强县|