2 yuqiong968 yuqiong968 于 2014.04.01 11:26 提问

oracle package Error: PLS-00103: Encountered the symbol "CREATE"

想了解下Oracle的package,特地从网上下载如下语句在Pl/sql 中执行
Create Or Replace Package Package_Demo Is
Function Getage(Birthst Varchar, Birthend Varchar) Return Integer;
Function Getsalary(Vfpsncode Varchar) Return Number;
End Package_Demo;
--创建包体
Create Or Replace Package Body Package_Demo Is
Function Getage(Birthst Varchar, Birthend Varchar) Return Integer --得到年龄函数
Is 。。。。(省略)

执行package后,报错PLS-00103: Encountered the symbol "CREATE",网上查找方法,说是在后Create前加上/ ,故在Create Or Replace Package Body Package_Demo Is前加上了/,再次执行,仍报错PLS-00103: Encountered the symbol "/"

请问各位,这个是怎么回事呢??

1个回答

lancyllz
lancyllz   2014.06.22 11:55

你的问题解决了么 我也遇到类似的呢 sql: declare
cursor c_session is
select sid,serial# serial,t.* from v$session t
where username is not null
and username in ('LANCY')
and status in ('INACTIVE');
c_session_row c_session%rowtype;
begin
for c_session_row in c_session loop
execute immediate 'alter system kil session '''||c_session_row.sid||',
'||c_session_row.serial||'''';
end loop;
end;
/ 执行后也报错PLS-00103:

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!