回覆列表
  • 1 # 使用者9796667935279

    首先需要授權

    sqlplus / as sysdba

    grant create view to your_user;

    然後建立表和儲存過程

    drop table table1;create table TABLE1( user_id VARCHAR2(10), user_name VARCHAR2(10), user_mail VARCHAR2(10), user_mobile VARCHAR2(10), user_telephone VARCHAR2(10));CREATE OR REPLACE PROCEDURE CREATEVIEWS IS V_SQL VARCHAR2(10240);BEGIN V_SQL := "CREATE OR REPLACE VIEW V_TEST AS SELECT T1.USER_ID, T1.USER_NAME, --使用者姓名 T1.USER_MAIL, --使用者MAIL T1.USER_MOBILE, --使用者手機 T1.USER_TELEPHONE --使用者電話 FROM TABLE1 T1"; EXECUTE IMMEDIATE V_SQL;END CREATEVIEWS;/

    執行,OK

    SQL> exec createviews;PL/SQL procedure successfully completed

  • 2 # pietr49411

    sqlplus / as sysdbagrant create view to your_user;然後建立表和儲存過程執行,OK

  • 中秋節和大豐收的關聯?
  • 巴基斯坦電影《人世間》劇情?