亚洲激情专区-91九色丨porny丨老师-久久久久久久女国产乱让韩-国产精品午夜小视频观看

溫馨提示×

溫馨提示×

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

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

第一次接觸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

伊川县| 河东区| 佛教| 兴海县| 油尖旺区| 阜宁县| 西和县| 高陵县| 金沙县| 新巴尔虎右旗| 莆田市| 同仁县| 舞阳县| 沿河| 望江县| 易门县| 开原市| 漳平市| 白河县| 平乡县| 密山市| 远安县| 忻城县| 慈利县| 揭西县| 遂宁市| 郸城县| 德州市| 北票市| 滦南县| 阿瓦提县| 类乌齐县| 齐河县| 建昌县| 元谋县| 新宁县| 梅河口市| 安国市| 丰都县| 凤冈县| 武川县|