参考:

http://blog.csdn.net/haiross/article/details/20612135

Oracle/PLSQL: ORA-06550

Learn the cause and how to resolve the ORA-06550 error message in Oracle.

Description

When you encounter an ORA-06550 error, the following error message will appear:

ORA-06550: line num, column num: str

Cause of Error

You tried to execute an invalid block of PLSQL code (like a stored procedure or function), but a compilation error occurred.

How to Resolve the Error

The option(s) to resolve this Oracle error are:

Option #1

Refer to the line and column numbers (in the error message) to find the compilation error and correct it. Then try recompiling your code.

Let's look at an example of how to resolve an ORA-06550 error. For example, if you created a procedure calledTestProc as follows:

SQL> CREATE OR REPLACE PROCEDURE TestProc

2 AS

3 vnum number;

4 BEGIN

5 vnum := vAnotherNum;

6 END;

7 /

Warning: Procedure created with compilation errors.

This procedure was created with compilation errors. So if we try to execute this procedure, we will get an ORA-06550 error as follows:

SQL> execute TestProc();

BEGIN TestProc(); END;

ERROR at line 1:

ORA-06550: line 1, column 7:

PLS-00905: object EXAMPLE.TESTPROC is invalid

ORA-06550: line 1, column 7:

PL/SQL: Statement ignored

You can run the SHOW ERROR command to view the errors as follows:

SQL> show error procedure TestProc;

Errors for PROCEDURE TESTPROC:

LINE/COL ERROR


5/1 PL/SQL: Statement ignored

5/9 PLS-00201: identifier 'VANOTHERNUM' must be declared

As you can see, the error is caused by the variable called VANOTHERNUM not being declared. To resolve this error, we can modify ourTestProc procedure to declare the variable as follows:

SQL> CREATE OR REPLACE PROCEDURE TestProc

2 AS

3 vnum number;

4 vAnotherNumber number;

5 BEGIN

6 vAnotherNum := 999;

7 vnum := vAnotherNum;

8 END;

9 /

Procedure created.

And now when we execute our TestProc procedure, the ORA-06550 error has been resolved.

SQL> execute TestProc();

PL/SQL procedure successfully completed.

Oracle/PLSQL: ORA-06550的更多相关文章

  1. oracle tnsnames.ora文件用法说明

      oracle tnsnames.ora文件用法说明 CreationTime--2018年8月10日08点32分 Author:Marydon 1.用途 oracle客户端所需要的一个文件,通过该 ...

  2. Oracle sqlnet.ora配置

    Oracle sqlnet.ora配置 sqlnet.ora的作用(官网指出的)   www.2cto.com 1.限制客户端访问(如指定客户端域为不允许访问) 2.指定命名方法(local nami ...

  3. Oracle PLSQL读取(解析)Excel文档

    http://www.itpub.net/thread-1921612-1-1.html !!!https://code.google.com/p/plsql-utils/ Introduction介 ...

  4. MyEclipse+Weblogic+Oracle+PLSQL配置注意事项

    Weblogic配置详情:<Weblogic安装与配置图文详解>Oracle+PLSQL配置详情:<PL/SQL访问远程Oracle服务器(多种方式)>MyEclipse配置: ...

  5. oracle Plsql 运行update或者delete时卡死问题解决的方法

    oracle Plsql 运行update或者delete时 遇到过Plsql卡死问题或者导致代码运行sql的时候就卡死. 在开发中遇到此问题的时候,本来把sql复制出来,在plsql中运行,Sql本 ...

  6. oracle plsql基本语法

    oracle plsql 基本语法 --plsql默认规则:plsql赋值用":=" plsql判断用"=" plsql输入用"&" ...

  7. Oracle/PLSQL存储过程详解

    原文链接:https://blog.csdn.net/zezezuiaiya/article/details/79557621 Oracle/PLSQL存储过程详解 2018-03-14 17:31: ...

  8. 本地不安装Oracle,plsql远程连接数据库

    由于Oracle的庞大,有时候我们需要在只安装Oracle客户端如plsql.toad等的情况下去连接远程数据库,可是没有安装Oracle就没有一切的配置文件去支持.最后终于发现一个很有效的方法,Or ...

  9. plsql连接oralce数据的配置 PLSQL配置怎么连ORACLE plsql连接多个数据库设置 Oracle 服务命名(别名)的配置及原理,plsql连接用

    Oracle 服务命名(别名)的配置及原理,plsql连接用 Oracle 服务命名(别名)的配置及原理 连接数据库必须配置服务命名(别名,用于plsql的连接),不管是本地还是远程,服务命名即简单命 ...

随机推荐

  1. MongoDB CRUD 操作手册

    基本操作 增加 在MongoDB中通过db.collection.insert()来增加新的数据. db.users.insert({username:"Jack",age:30} ...

  2. ABP(现代ASP.NET样板开发框架)系列之20、ABP展现层——动态生成WebApi

    点这里进入ABP系列文章总目录 ABP(现代ASP.NET样板开发框架)系列之20.ABP展现层——动态生成WebApi ABP是“ASP.NET Boilerplate Project (ASP.N ...

  3. C#中,双屏/两屏/三屏/多屏跳转判断

    之前伤脑筋写过一次在Web中,JS,ActiveXObject去读取显示器数量.分辨率去判断单双屏跳转. 那么在客户端中,用C#去读取硬件信息,更方便更容易! 思路参考代码: ) { //此显示器是否 ...

  4. Centos6.5中安装和配置vsftp详细总结

    一.vsftp安装篇 #查看是否安装:rpm -qa|grep vsftpd#卸载vsftpdrpm -e vsftpd-2.2.2-11.el6_3.1x86_64 --nodeps# 安装vsft ...

  5. 【Win 10应用开发】分阶段进行数据绑定

    使用x:Bind扩展标记进行数据绑定,是在编译阶段完成,至于说性能优化方面,大概主要是优化CPU资源的使用,因为免去了运行阶段进行绑定的过程.当然,使用这个标记仅仅是绑定上的优化,并不包括数据源.数据 ...

  6. Javascript之自定义事件

    Javascript自定义事件,其本质就是观察者模式(又称订阅/发布模式),它的好处就是将绑定事件和触发事件相互隔离开,并且可以动态的添加.删除事件. 下面通过实例,一步一步构建一个具体的Javasc ...

  7. 你真的会玩SQL吗?表表达式,排名函数

    你真的会玩SQL吗?系列目录 你真的会玩SQL吗?之逻辑查询处理阶段 你真的会玩SQL吗?和平大使 内连接.外连接 你真的会玩SQL吗?三范式.数据完整性 你真的会玩SQL吗?查询指定节点及其所有父节 ...

  8. 代码的坏味道(9)——异曲同工的类(Alternative Classes with Different Interfaces)

    坏味道--异曲同工的类(Alternative Classes with Different Interfaces) 特征 两个类中有着不同的函数,却在做着同一件事. 问题原因 这种情况往往是因为:创 ...

  9. Basic Tutorials of Redis(8) -Transaction

    Data play an important part in our project,how can we ensure correctness of the data and prevent the ...

  10. mongo DB for C#

    (1)Download the MongoDB C#驱动. http://www.nuget.org/packages/mongocsharpdriver/. (2) Add Reference to ...