gpt4 book ai didi

oracle - PLS-00103 : Encountered the symbol ";" when expecting one of the following:

转载 作者:行者123 更新时间:2023-12-02 00:51:01 26 4
gpt4 key购买 nike

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

Ellucian 横幅 v8+ 提供了一个用于运行此 API 的 API,我对他们的 API 非常陌生,从下面的错误消息来看,我距离正确运行它还很远。如有任何帮助,我们将不胜感激。

我尝试在 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
);

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

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

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

更新:错误的代码:

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 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:

最佳答案

问题在于执行。这实际上是短匿名 PL/SQL block 的简写,并且不能跨行拆分。 (也许除了一个延续字符,但我不记得我是否曾经让它工作过)。仅翻译第一行,因此它实际上正在尝试运行:

begin execute gb_pin_answer.p_create(; end;
/

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

解决方案是将整个过程调用放在一行中,这将使其更难以阅读;或者只是使用您自己的 block ,而不是依赖 execute:

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

最后一个参数不正确;来自 OUT ... 的位需要替换为 => some_value,就像您对其他位所做的那样。但它是一个输出参数,因此您需要一些东西来放入值。如果不查看您正在运行的脚本中还有什么,我无法判断您是否已经处理过它,但是使用这种模式您可以可能只是向匿名 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;
/

关于oracle - PLS-00103 : Encountered the symbol ";" when expecting one of the following:,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16308701/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com