PowerDesginer 產生的Oracle 11g 組合觸發器代碼編譯錯誤(29): PLS-00103

來源:互聯網
上載者:User

標籤:

問題描述:

採用PowerDesigner15針對Oracle 11g 建立物理資料模型,想實現一個欄位的自增,採用如下步驟:

1、建立序列,命名為Sequence_1;

2、在自增欄位編輯視窗中,選擇序列Sequence_01;

3、將表視窗Preview標籤頁,產生代碼複製到SqlDeveloper 11gr2中執行,編譯錯誤: 

PowerDeginer產生的部分代碼:

-------------------------------------------------------------------

create or replace trigger CompoundUpdateTrigger_user1
for update on User1 compound trigger
//Declaration
//Body
before statement is
begin
NULL;
end before statement;

before each row is
begin
NULL;
end before each row;

after each row is
begin
NULL;
end after each row;

after statement is
begin
NULL;
end after statement;

END
/

-------------------------------------------------------------------

觸發器編譯錯誤如下

 錯誤(29): PLS-00103: 出現符號 "end-of-file"在需要下列之一時:  ; <an identifier>    <a double-quoted delimited-identifier> 符號 ";" 被替換為 "end-of-file" 後繼續。 

 

問題解決;

1、將產生的程式碼中的 // 修改成 --

2、在END後加上分號(;)

如下:

-------------------------------------------------------------------

create or replace trigger CompoundUpdateTrigger_user1
for update on User1 compound trigger
--Declaration
-- Body
before statement is
begin
NULL;
end before statement;

before each row is
begin
NULL;
end before each row;

after each row is
begin
NULL;
end after each row;

after statement is
begin
NULL;
end after statement;

END;
/

-------------------------------------------------------------------

編譯成功提示:

 COMPOUNDDELETETRIGGER_USER1 已編譯

 

總結:

在SqlDeveloper中,建立觸發器時,在末尾要添加分號(;)和斜杠(/)

1、分號(;)是語句塊結束的標識;

2、斜杠(/)是語句塊執行的標識;

PowerDesginer 產生的Oracle 11g 組合觸發器代碼編譯錯誤(29): PLS-00103

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.