当我在 pl/sql 开发人员中执行以下代码时它会抛出错误?
When i execute the following code in pl/sql developer it throws a error?
**create or replace procedure Xml_Table is
begin
DECLARE
l_xmltype XMLTYPE;
BEGIN
SELECT XMLELEMENT("employees",
XMLAGG(
XMLELEMENT("employee",
XMLFOREST(
e.empno AS "empno",
e.ename AS "ename",
e.job AS "job",
TO_CHAR(e.hiredate, 'DD-MON-YYYY') AS "hiredate"
)
)
)
)
INTO l_xmltype
FROM emp e;
INSERT INTO xml_tab VALUES (1, l_xmltype);
COMMIT;
end Xml_Table;**
在这个 Xml_Table 中是我创建的程序。 Xml_tab 是我在数据库中创建的 xml 数据类型的 table。还有一个问题是我可以创建一个过程 pl/sql,在其中我可以删除并创建新的 xml 类型 table 而不是在过程之外进行。
错误 MESSAGE:Compilation 程序错误 APPS.XML_TABLE
错误:PLS-00103:在期望以下之一时遇到符号 "end-of-file":
( begin case declare end exception exit for goto if loop mod
null pragma raise return select update while with
<an identifier> <a double-quoted delimited-identifier>
<a bind variable> << continue close current delete fetch lock
insert open rollback savepoint set sql execute commit forall
merge pipe purge
Try this:
create or replace procedure Xml_Table as
/*
begin --> REMOVE
DECLARE --> REMOVE
*/
l_xmltype XMLTYPE;
BEGIN
...
**create or replace procedure Xml_Table is
begin
DECLARE
l_xmltype XMLTYPE;
BEGIN
SELECT XMLELEMENT("employees",
XMLAGG(
XMLELEMENT("employee",
XMLFOREST(
e.empno AS "empno",
e.ename AS "ename",
e.job AS "job",
TO_CHAR(e.hiredate, 'DD-MON-YYYY') AS "hiredate"
)
)
)
)
INTO l_xmltype
FROM emp e;
INSERT INTO xml_tab VALUES (1, l_xmltype);
COMMIT;
end Xml_Table;**
在这个 Xml_Table 中是我创建的程序。 Xml_tab 是我在数据库中创建的 xml 数据类型的 table。还有一个问题是我可以创建一个过程 pl/sql,在其中我可以删除并创建新的 xml 类型 table 而不是在过程之外进行。
错误 MESSAGE:Compilation 程序错误 APPS.XML_TABLE
错误:PLS-00103:在期望以下之一时遇到符号 "end-of-file":
( begin case declare end exception exit for goto if loop mod
null pragma raise return select update while with
<an identifier> <a double-quoted delimited-identifier>
<a bind variable> << continue close current delete fetch lock
insert open rollback savepoint set sql execute commit forall
merge pipe purge
Try this:
create or replace procedure Xml_Table as
/*
begin --> REMOVE
DECLARE --> REMOVE
*/
l_xmltype XMLTYPE;
BEGIN
...