Home IT Linux Windows Database Network Programming Server Mobile  
           
  Home \ Database \ Oracle PLS-00231 error analysis     - Java polymorphism and exception handling (Programming)

- tcpdump Linux system security tools (Linux)

- Android View event delivery (Programming)

- Ubuntu 14.04 LTS to compile the source code Android4.4.2 (Linux)

- To help you easily protect the Linux System (Linux)

- Laravel cache paged results (Server)

- Ubuntu 15.10 15.04 14.10 14.04 Install Ubuntu Tweak (Linux)

- Android using SVG vector graphics to create cool animation effects (Programming)

- Memcached installation, configuration and monitoring (Server)

- Linux User Rights Study Notes (Linux)

- Linux server security - the web server configuration (Linux)

- Linux Bash share tips for getting started (Linux)

- Build ftp server under CentOS 6.5 (Server)

- 64-bit Oracle Linux recompiled Hadoop-2.2.0 (Server)

- Java synchronization mechanism used in locking Thought (Programming)

- Fedora 20 Installation and Configuration (Linux)

- Linux kernel panic (because glibc result) Repair (Linux)

- Use JMS listener Oracle AQ, trigger the execution of Java programs in the database changes (Database)

- Wine 1.7 is installed on a system based on RedHat or Debian (Linux)

- Ubuntu 12.04 kernel configuration automatically restart and crash dump (Linux)

 
         
  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
      is
      begin
        return 2;
      end Two;
 create or replace procedure PrintTwo
      is
        myNum Number;
      begin
      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
    PIPELINED;
 
str_split a custom collection type:
 
 TYPE "STR_SPLIT" IS TABLE OF VARCHAR2 (4000);
 
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.
     
         
       
         
  More:      
 
- ActiveMQ5.11.1 and JDK version matching relation (Linux)
- sqlplus connect to Oracle (Database)
- command-line tool for send e-mail (Linux)
- Linux System Getting Started Learning: The Linux logrotate (Linux)
- Oracle 11g upgrade PSU detailed steps (Database)
- How comprehensive resist attacks from the network (Linux)
- CentOS RedHat YUM Source Extensions Supplement (including 32-bit, 64-bit) (Linux)
- To share Internet access through NAT mode under Virtual Linux VMware Workstation (Linux)
- Get and Post requests Comments (Linux)
- Depth understanding of C language (Programming)
- Fast Learning Clojure (Programming)
- Use MD5 transform algorithm to prevent exhaustive decipher passwords (Linux)
- Linux system security infrastructure Highlights (Linux)
- Using Oracle for Oracle GoldenGate to achieve a one-way data synchronization (Database)
- Linux, Google Test (GTest) test environment to build step (Linux)
- Oracle Database routine inspection (Database)
- LAN Deployment Docker-- from scratch to create your own private warehouse Docker (Linux)
- Win7 + Ubuntu Kylin + CentOS 6.5 installed three systems (Linux)
- Gitblit adopted Ticket collaborative development model (Linux)
- Cooling solutions Ubuntu system (Linux)
     
           
     
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.