PLS-00103:遇到符号“;"当期待以下之一时: [英] PLS-00103: Encountered the symbol ";" when expecting one of the following:

查看:108
本文介绍了PLS-00103:遇到符号“;"当期待以下之一时:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试插入用户安全问题的答案,以用于 PIN 重置功能.<​​/p>

Ellucian banner v8+ 提供了一个用于运行它的 API,我对他们的 API 非常陌生,从下面的错误消息的外观来看,我远未正确运行它.任何帮助表示赞赏.

我尝试在 Oracle SQL Developer 中运行它:

执行 gb_pin_answer.p_create(P_PIDM =>12345,P_NUM =>1、p_gobqstn_id =>1、p_qstn_desc =>'',p_ansr_desc =>'大卫',p_ansr_salt =>'A123B456',p_user_id =>'W:H12345678',p_data_origin =>'WWW_USER',p_rowid_out OUT gb_common.internal_record_id_type);

这是在黑暗中的一个镜头,但我想我会试一试,尝试执行该包的 p_create 函数时会显示错误消息:

<块引用>

从命令第 15 行开始出错:执行 gb_pin_answer.p_create(错误报告:ORA-06550:第 1 行,第 30 列:PLS-00103:遇到象征 ";"当期待以下之一时:

( ) - + case mod 新的非空表继续平均计数当前存在最大最小先验sql stddev总和方差执行multiset 两个领先的尾随合并年月日小时分秒 timezone_hour timezone_minute timezone_regiontimezone_abbr 时间时间戳间隔日期06550. 00000 - 第 %s 行,第 %s 列:\n%s"*原因:通常是 PL/SQL 编译错误.*动作:

从命令中的第 16 行开始的错误:P_PIDM => 12345,错误报告:未知命令

错误从第 17 行开始:P_NUM => 1,错误报告:未知命令

Error 从第 18 行开始的命令:p_gobqstn_id => 1,错误报告:未知命令

从命令第 19 行开始出错:p_qstn_desc => '', Error报告:未知命令

从命令第 20 行开始出错:p_ansr_desc => 'David',错误报告:未知命令

从命令中的第 21 行开始出错:p_ansr_salt => 'A123B456',错误报告:未知命令

从第 22 行开始的错误:p_user_id => 'W:H12345678',错误报告:未知命令

从命令第 23 行开始出错:p_data_origin => 'WWW_USER',错误报告:未知命令

从命令第 24 行开始出错:p_rowid_out OUTgb_common.internal_record_id_type 错误报告:未知命令

从第 25 行开始的命令错误:) 错误报告:未知命令

这是我阅读使用此函数 p_create 的地方:http://inb1.banner.ecu.edu:9090/api_erd_index_guide/api/general/gb_pin_answer.html#p_create

更新:出错的代码:

SET SERVEROUTPUT ON宣布l_rowid_out gb_common.internal_record_id_type;开始gb_pin_answer.p_create(P_PIDM => 36706, P_NUM => 1, P_GOBQSTN_ID => 1, P_QSTN_DESC => '', P_ANSR_DESC => 'David', P_ANSR_SALT => 5USER_6HB1H00036657', P_DATA_ORIGIN => 'WWW_USER', P_ROWID_OUT => 1_rowid_out);dbms_output.put_line('rowid:' || l_rowid_out);结尾;

错误信息:

<块引用>

错误报告:ORA-06550:第 4 行,第 199 列:PLS-00363:表达式1"不能用作赋值目标 ORA-06550:第 4 行,第 3 列:PL/SQL:忽略语句06550. 00000 - 第 %s 行,第 %s 列:\n%s"*原因:通常是 PL/SQL 编译错误.*动作:

解决方案

问题在于 execute.这实际上是简短的匿名 PL/SQL 块的简写,并且不能跨行拆分.(除了可能有一个延续字符,但我不记得我是否曾经让它工作过).只有第一行被翻译,所以它有效地尝试运行:

开始执行 gb_pin_answer.p_create(; end;/

... 并且它很合理地不喜欢以 p_create(; 结尾的命令.然后将过程调用的其余部分视为 10 个单独的命令,这些命令会生成其他错误get,并且在这种情况下它们也是合理的.

解决办法是要么把整个过程调用放在一行,这样会更难阅读;或者只是使用你自己的块,而不是依赖 execute:

开始gb_pin_answer.p_create(...);结尾;/

不过最后一个参数不对;OUT ... 中的位需要替换为 =>;some_value,就像你对其他人所做的那样.但它是一个 out 参数,所以你需要一些东西来把值放进去. 没有看到你正在运行的脚本中还有什么我不知道你是否已经处理过它,但是使用这种模式你可以可能只是向匿名块添加一个变量:

设置 serveroutput on宣布l_rowid_out gb_common.internal_record_id_type;开始gb_pin_answer.p_create(...p_rowid_out =>l_rowid_out);-  可选的dbms_output.put_line('rowid:' || l_rowid_out);结尾;/

I am trying to insert the answer to a user's security question, for use in the pin reset feature.

Ellucian banner v8+ provides an API for running this and I very new to their API and from the looks of the error message below, I am far from running this correctly. Any help is appreciated.

I tried running this in Oracle SQL Developer:

execute gb_pin_answer.p_create(
    P_PIDM        =>    12345,
    P_NUM         =>    1,
    p_gobqstn_id  =>    1,
    p_qstn_desc   =>    '',
    p_ansr_desc   =>    'David',
    p_ansr_salt   =>    'A123B456',
    p_user_id     =>    'W:H12345678',
    p_data_origin =>    'WWW_USER',
    p_rowid_out         OUT gb_common.internal_record_id_type
);

This is a shot in the dark, but I thought I'd give it a shot, error message that displays when trying to execute that package's p_create function:

Error starting at line 15 in command: execute gb_pin_answer.p_create( Error report: ORA-06550: line 1, column 30: PLS-00103: Encountered the symbol ";" when expecting one of the following:

( ) - + case mod new not null table continue avg count current exists max min prior sql stddev sum variance execute multiset the both leading trailing forall merge year month day hour minute second timezone_hour timezone_minute timezone_region timezone_abbr time timestamp interval date 06550. 00000 - "line %s, column %s:\n%s" *Cause: Usually a PL/SQL compilation error. *Action:

Error starting at line 16 in command: P_PIDM => 12345, Error report: Unknown Command

Error starting at line 17 in command: P_NUM => 1, Error report: Unknown Command

Error starting at line 18 in command: p_gobqstn_id => 1, Error report: Unknown Command

Error starting at line 19 in command: p_qstn_desc => '', Error report: Unknown Command

Error starting at line 20 in command: p_ansr_desc => 'David', Error report: Unknown Command

Error starting at line 21 in command: p_ansr_salt => 'A123B456', Error report: Unknown Command

Error starting at line 22 in command: p_user_id => 'W:H12345678', Error report: Unknown Command

Error starting at line 23 in command: p_data_origin => 'WWW_USER', Error report: Unknown Command

Error starting at line 24 in command: p_rowid_out OUT gb_common.internal_record_id_type Error report: Unknown Command

Error starting at line 25 in command: ) Error report: Unknown Command

This is where I read up on using this function, p_create: http://inb1.banner.ecu.edu:9090/api_erd_index_guide/api/general/gb_pin_answer.html#p_create

UPDATE: code that is erroring out:

SET SERVEROUTPUT ON
declare
  l_rowid_out gb_common.internal_record_id_type;
BEGIN
  gb_pin_answer.p_create(P_PIDM => 36706, P_NUM => 1, P_GOBQSTN_ID => 1, P_QSTN_DESC => '', P_ANSR_DESC => 'David', P_ANSR_SALT => 'HB123456', P_USER_ID => 'H00036657', P_DATA_ORIGIN => 'WWW_USER', P_ROWID_OUT => 1_rowid_out);
  dbms_output.put_line('rowid: ' || l_rowid_out);
END;

Error msg:

Error report: ORA-06550: line 4, column 199: PLS-00363: expression '1' cannot be used as an assignment target ORA-06550: line 4, column 3: PL/SQL: Statement ignored 06550. 00000 - "line %s, column %s:\n%s" *Cause: Usually a PL/SQL compilation error. *Action:

解决方案

The problem is the execute. That's actually shorthand for a short anonymous PL/SQL block, and cannot be split across lines. (Except maybe with a continuation character, but I can't remember off-hand if I've ever got that to work). Only the first line is translated, so it's effectively trying to run:

begin execute gb_pin_answer.p_create(; end;
/

... and it quite reasonably then doesn't like the command ending as p_create(;. The rest of the procedure call is then treated as 10 separate commands, which generate the other errors you get, and they are also reasonable in that context.

The solution is to either put the entire procedure call on one line, which will make it harder to read; or simply to use your own block, rather than relying on execute:

begin
    gb_pin_answer.p_create(
        ...
    );
end;
/

The last parameter isn't right though; the bit from OUT ... needs to be replaced with => some_value, like you've done with the others. But it is an out parameter, so you need something to put the value in. Without seeing what else is in the script you're running I can't tell if you've already taken care of it, but with this pattern you can probably just add a variable to the anonymous block:

set serveroutput on
declare
    l_rowid_out gb_common.internal_record_id_type;
begin
    gb_pin_answer.p_create(
        ...
        p_rowid_out => l_rowid_out
    );
    -- optional
    dbms_output.put_line('rowid: ' || l_rowid_out);
end;
/

这篇关于PLS-00103:遇到符号“;"当期待以下之一时:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆