Solved

Error: ORA-00604: error produced at level 1 of recursivo - SQL ORA-01400: an insertion NULL cannot be made in ("SYS"."obj$"."name")

Posted on 2007-04-02
3
2,949 Views
Last Modified: 2013-12-07
I have this pl/sql function:
------------------
CREATE OR REPLACE
FUNCTION GET_ISSUER (CpyCode VARCHAR2, ItemId VARCHAR2, TitleType VARCHAR2, InvEntity VARCHAR2)
 RETURN VARCHAR2
IS

 type issuer_type is ref cursor;
 c_issuer  issuer_type;
 
 v_issuer  ISSUER_CFG%ROWTYPE;
 type issuer_rec is record
   (num_errors ISSUER_CFG.ACEPTED%TYPE,
    issuer_id  ISSUER_CFG.ISSUER_ID%TYPE);
 type v_issuers is table of issuer_rec
   index by binary_integer;  
 v_iss v_issuers;
 
 i binary_integer := 0;

 aux1 varchar2(12);
 aux2 number(1);
 sSQL varchar2(2000);
 
BEGIN
 
   sSQL :=
      'SELECT CPY_CODE, ISSUER_ID, TITLE_TYPE, INV_ENTITY, NAME, ACEPTED ' ||
      'FROM ISSUER_CFG ' ||
      'WHERE ' ||
      ' CPY_CODE = "' || CpyCode || '" AND TITLE_TYPE = "' || TitleType || '"';
         
   IF InvEntity != null AND trim(InvEntity) != "" THEN
      sSQL := sSQL || ' AND INV_ENTITY = "' || InvEntity || '"';
   END IF;

   OPEN c_issuer FOR sSQL;
       
   -- get cursor      
   LOOP    
     FETCH cur_issuer INTO v_issuer;
     EXIT WHEN cur_issuer%NOTFOUND;
     i := i + 1;
     v_iss(i).issuer_id  := v_issuer.ISSUER_ID;       
     -- get errors number
     v_iss(i).num_errors := GET_COINCIDENCES(ItemId, v_iss(i).issuer_id);          
   END LOOP;    

   -- order issuers by less number errors      
   FOR j IN 1 .. v_iss.COUNT-1 LOOP    
     IF  v_iss(j).num_errors >  v_iss(j+1).num_errors THEN
        aux1 := v_iss(j).num_errors;
        aux2 := v_iss(j).issuer_id;

        v_iss(j).num_errors := v_iss(j+1).num_errors;
        v_iss(j).issuer_id  := v_iss(j+1).issuer_id;

        v_iss(j+1).num_errors := aux1;
        v_iss(j+1).issuer_id  := aux2;
     END IF;          
   END LOOP;

   IF v_iss.COUNT = 0  OR v_iss(1).num_errors = length(ItemId) THEN
      RETURN '0';
   ELSE  
      RETURN v_iss(1).issuer_id;
   END IF;  
END;

------------------

When I compile it gives me this error:

Error: ORA-00604: error produced at level 1 of recursive SQL
ORA-01400: an insertion NULL cannot be made in ("SYS"."obj$"."name")


What can I do?
Help me plase
0
Comment
Question by:jorgeani
  • 2
3 Comments
 
LVL 27

Accepted Solution

by:
sujith80 earned 500 total points
ID: 18835171
You have used the same name for two types, that is the reson for the conflict.
change the declarations as:
CREATE OR REPLACE
FUNCTION GET_ISSUER (CpyCode VARCHAR2, ItemId VARCHAR2, TitleType VARCHAR2, InvEntity VARCHAR2)
 RETURN VARCHAR2
IS

 type issuer_type is ref cursor;
 c_issuer  issuer_type;
 
 v_issuer  ISSUER_CFG%ROWTYPE;
 type issuer_type_rec is record
   (num_errors ISSUER_CFG.ACEPTED%TYPE,
    issuer_id  ISSUER_CFG.ISSUER_ID%TYPE);
 type v_issuers is table of issuer_type_rec
   index by binary_integer;  
 v_iss v_issuers;
 
.
.
.
.
Regarding the second error, seems to be nothing to do with this function, may be something in another function being called here.
0
 

Author Comment

by:jorgeani
ID: 18835190
Ok I changed the duplicated definition, but I still get this error:

Error: ORA-00604: error produced at level 1 of recursive SQL
ORA-01400: an insertion NULL cannot be made in ("SYS"."obj$"."name")

What does it mean? What can I do?
0
 

Author Comment

by:jorgeani
ID: 18835197
Ok, my error was in this line...
 IF InvEntity != null AND trim(InvEntity) != "" THEN

I replaced by:

IF InvEntity is not null and trim(InvEntity) != '' THEN

thanks.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now