Home IT Linux Windows Database Network Programming Server Mobile  
  Home \ Database \ Oracle PLS-00231 error analysis     - Oracle 10g in the unique and index problems (Database)

- Docker commonly used commands Description (Linux)

- CentOS install expect (Linux)

- DataGuard add temporary data files bug (Database)

- Linux server Php injection prevention (Linux)

- Linux detection command (vmstat) (Linux)

- Raspberry Pi configuration wireless hotspot (Linux)

- Hands to teach you to solve Ubuntu error message (Linux)

- Nginx logging client ip (Server)

- Use the command line MySQL database backup and recovery (Database)

- TypeScript basic grammar (Programming)

- To restore the last time applications running when Ubuntu user log in again (Linux)

- Linux security concerns again (Linux)

- SQL MySQL query table duplicate data (Database)

- PostgreSQL-XL installation and deployment (Database)

- Lua regex (string function) (Programming)

- Linux file permissions and access modes (Linux)

- Linux file and directory permissions settings (Linux)

- PostgreSQL query lock and kill the process (Database)

- Oracle RAC node on the expulsion of the inspection process on OEL6.3 (Database)

  Oracle PLS-00231 error analysis
  Add Date : 2018-11-21      
  Oracle's PLS-00231 error analysis, this error is usually caused by access to the function, declared in the header for the total function of the unanimous vote, then place in enclaves declared dying function causes an error.
create or replace function Two
      return Number
        return 2;
      end Two;
 create or replace procedure PrintTwo
        myNum Number;
      select Two ()
      into myNum
      from dual;
      dbms_output.put_line (myNum);
    end PrintTwo;
 The above functions and procedures, on the functions and procedures declared, call normal. Note that two functions are printtwo procedure call in the form of sql statement.
Error If this second program segments into a package, the function of private way, then compile the package body, reported pls-00231 error, function can not use it in class sql statement.
For what reason?
pl sql and sql for oracel, it is two different engines, engines, and thus for sql, plsql package of two private function, can not be found.
So the package use two functions in two ways:
1 declared in the function header declaration in two upcoming two functions make public declaration, then you can select two into mynum from dual; formal calls, of course, this can not hide the two functions.
2 to mynum: = two; invoked, since in this way to pl sql parsing engine, so it can be used normally in a private manner declared two functions.
Visible need a suitable manner to expose the two functions sql or plsql engine before use. So if the two make public statements, but with the package name .two invoked, not the same can be positioned to the two functions? Oh, of course not, you do not forget the two public statements in the package it is not visible outside anyway haha.

So a set of functions for the package type of return, such as: FUNCTION strsplit (p_list IN VARCHAR2, p_sep IN VARCHAR2 DEFAULT '|')
    RETURN str_split
str_split a custom collection type:
In this case, regardless of the type str_split statement in the package to public or private way, they were unable to properly use sql invoked, since the return of the collection, nor can plsql the kkk: = str_split invoked. In this case, it can only str_split defined as a custom data type oracle of:
create or replace TYPE "STR_SPLIT" IS TABLE OF VARCHAR2 (4000)
Then removed within the public or private packet type str_split defined, you can use sql calls the function.
- Let VMware ESXi virtual switch support VLAN (Linux)
- Scala REPL Shell call (Programming)
- BGP routers want to play it by CentOS (Linux)
- 20 open source / commercial Linux server management control panel (Server)
- Oriented C ++ test-driven development (Programming)
- Detailed LVM2 (Linux)
- Linux system security reinforcement (Linux)
- User and user group management Linux Command (Linux)
- To compile and install Clang 3.5.0 in Linux CentOS (Linux)
- Django1.8 return json json string and the string contents of the received post (Programming)
- Binary tree traversal recursive and non-recursive (cyclic) traversal achieve (Programming)
- Java gets the current system time System.currentTimeMillis () (Programming)
- Ubuntu system safe and caution sudo su command (Linux)
- How LUKS encrypted disk / partition to perform remote incremental backup (Linux)
- 256 with rich colors decorate your terminal (Linux)
- Four levels to deal with Linux server attacks (Linux)
- Hadoop + Zookeeper NameNode achieve high availability (Server)
- Installation and deployment of MariaDB under CentOS (Database)
- MongoDB data replication and data slices (Database)
- Hadoop1.2.1 plug compilation (Server)
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.