Problem with execute procedure in PL/SQL Developer(PL/SQL Developer 中执行过程的问题)
问题描述
这是我第一次尝试创建过程并执行它.首先我创建简单的表.表的数据库方案在这里:
表名:Ziaci
列:
- ZiakId - 主键、数字
- 姓氏,varchar2
- 名字,varchar2
- TriedaId - 伪造密钥、号码
存储过程只在表中插入数据,我用这个 SQL cmd 创建了存储过程:
create procedure ziaci_proc(surname_in in varchar2,varchar2 中的 firstname_in,数字中的 tryaid_in)是开始插入 ziaci (surname, firstname,triedaid) 值 (surname_in,firstname_in,triedaid_in);结尾;
我试着把这个程序称为:
执行ziaci_proc('X','Y',1)
我收到此错误:
ORA-00900 无效的 SQL 语句
PL/SQL Developer IDE 中的一个带有红色下划线的执行字.
我测试了这个程序,效果很好.
我只能用这个 SQL 命令来执行这个过程:
开始ziaci_proc('A','B',2);结尾;
有什么不好的,谢谢帮助.
解决方案使用上述
<前>SQL> 执行 some_proc()开始 some_proc();结尾;*第 1 行的错误:ORA-06550:第 1 行,第 7 列:PLS-00201:必须声明标识符SOME_PROC"ORA-06550:第 1 行,第 7 列:PL/SQL:语句被忽略execute
调用存储过程是特定于 SQL*Plus 的.实际上,SQL*Plus 将execute some_proc()
转换为BEGIN some_proc();END;
,你可以通过尝试调用一个不存在的过程来亲眼看到这一点:
I this is my first attempt to create procedure and execute it. First I create simple table. DB scheme of table is here:
Table name: Ziaci
Columns:
- ZiakId - primary key, number
- Surname, varchar2
- FirstName, varchar2
- TriedaId - forgein key, number
Store procedure only insert data in table, I created store procudure with this SQL cmd:
create procedure ziaci_proc(surname_in in varchar2,
firstname_in in varchar2, triedaid_in in number)
is
begin
insert into ziaci (surname, firstname,triedaid) values (surname_in,firstname_in,triedaid_in);
end;
And I try call this procudure as:
execute ziaci_proc('X','Y',1)
I get this error:
ORA-00900 invalid SQL statement
An in PL/SQL Developer IDE is with red color underlined execute word.
I test this procedure and it works good.
I can only execute this procedure with this SQL command:
begin
ziaci_proc('A','B',2);
end;
What is bad, thank for help.
Calling stored procedures using execute
as above is specific to SQL*Plus. In fact, SQL*Plus converts execute some_proc()
into BEGIN some_proc(); END;
, You can see this for yourself by attempting to call a procedure that doesn't exist:
SQL> execute some_proc() BEGIN some_proc(); END; * ERROR at line 1: ORA-06550: line 1, column 7: PLS-00201: identifier 'SOME_PROC' must be declared ORA-06550: line 1, column 7: PL/SQL: Statement ignored
这篇关于PL/SQL Developer 中执行过程的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:PL/SQL Developer 中执行过程的问题


基础教程推荐
- 如何在 SQL Server 的嵌套过程中处理事务? 2021-01-01
- SQL Server 2016更改对象所有者 2022-01-01
- ERROR 2006 (HY000): MySQL 服务器已经消失 2021-01-01
- 将数据从 MS SQL 迁移到 PostgreSQL? 2022-01-01
- Sql Server 字符串到日期的转换 2021-01-01
- SQL Server 中单行 MERGE/upsert 的语法 2021-01-01
- 在 VB.NET 中更新 SQL Server DateTime 列 2021-01-01
- SQL Server:只有 GROUP BY 中的最后一个条目 2021-01-01
- 使用pyodbc“不安全"的Python多处理和数据库访问? 2022-01-01
- 无法在 ubuntu 中启动 mysql 服务器 2021-01-01