Get ORA-00600 when using ExecuteXmlQuery and NCLOB column

I am using ODP.NET, I got the following exception:
at Oracle.DataAccess.Client.OracleCommand.XmlHandleException(OracleException
e)
at Oracle.DataAccess.Client.OracleCommand.XmlHandleException(OracleException
e)
at Oracle.DataAccess.Client.OracleCommand.ExecuteXmlQuery(Boolean wantResult)
at Oracle.DataAccess.Client.OracleCommand.ExecuteXmlQuery(Boolean wantResult)
at Oracle.DataAccess.Client.OracleCommand.ExecuteXmlReader()
at Oracle.DataAccess.Client.OracleCommand.ExecuteXmlReader()
at Wikipedia.WikipediaDumpXml.Run() in c:\documents and settings\atali\my doc
uments\visual studio projects\datacentersolution\wikipedia\wikipediadumpxml.cs:l
ine 98
ORA-00600: internal error code, arguments: [kole_t2u], [34], [], [], [], [], [],
This is my code for retrieving data from database and save it into xml file.
The "TEXT" column in my select statement is NCLOB. When I leave TEXT column, my query works fine but with it I got exception.
please, I need help for resolving this issue.
// Open the connection
oraConn.Open();
OracleCommand selectCmd= new OracleCommand( String.Empty, oraConn);
selectCmd.XmlQueryProperties.RootTag = "Newspaper";
selectCmd.XmlQueryProperties.RowTag = "Article";
selectCmd.CommandText= "SELECT ID, TITLE, LANG, TEXT FROM NEWSPAPER_DATA WHERE LANG='en' AND ID=1";
selectCmd.XmlCommandType=OracleXmlCommandType.Query;
// execute xml request
XmlReader newsReader= selectCmd.ExecuteXmlReader();
// Read
while(newsReader.Read())
     string xmlfilename = row["TITLE"].ToString();
     using(TextWriter xmlWriter = new StreamWriter( this.DumpDirectory + xmlfilename + ".xml"))
          xmlWriter.Write( newsReader.ReadOuterXml());
// Close the newsReader
newsReader.Close();
oraConn.Close();
oraConn.Dispose();
Atali DAOUD

Mark is correct, you will need to contact support. ORA-600 errors usually require you to patch the database or at least use a workaround to avoid the error.

Similar Messages

  • Getting ORA-00600 when using table functions

    Hello,
    I am trying to use simple table function:
    create or replace type StatCall AS OBJECT (
    dial_number varchar2(255),
    start_date date,
    duration number(20)
    create or replace type StatCallSet AS TABLE OF StatCall;
    create or replace package ref IS
    type refcall_t IS REF CURSOR RETURN calls%ROWTYPE;
    end ref;
    create or replace function GetStats(p ref.refcall_t) return StatCallSet pipelined is
    out_rec StatCall;
    in_rec p%ROWTYPE;
    BEGIN
    LOOP
    FETCH p INTO in_rec;
    EXIT WHEN p%NOTFOUND;
    out_rec.dial_number := in_rec.dial_number;
    out_rec.start_date := in_rec.start_date;
    out_rec.duration := in_rec.duration;
    PIPE ROW(out_rec);
    END LOOP;
    CLOSE p;
    RETURN;
    END;
    select * from TABLE(GetStats(CURSOR(select * from call)));
    And I get:
    ORA-00600: internal error code, arguments: [17285], [0xFFFFFFFF7C4900A8], [1], [0x3943BA5E0], [], [], [], []
    Oracle 9.2.0.2
    Are there any ideas about how to fix this?

    What version of the database?
    Which flavor of Disco (Plus, Desktop, Viewer)?
    Standars EUL or Apps EUL?
    Can you post the code for the calculation?
    ORA-600 errors, as you mentioned, are internal, and may require opening a dialog with Oracle support. Then again, it could be something else in the calculation that is causing the sky to fall.

  • I get Ora-00600 when I try to fetch large data via Xml

    Hi all
    I user Oracle8i ver 8.1.6, when I execute the following
    procedure:
    PROCEDURE TTG_EXEC_SQL (SELECT_STATMENT in VarChar2, Result Out
    Clob, err_no Out Number) IS
    -- This Procedure excutes SELECT command and return the result
    data throw Xml CLOB parameter.
    QueryCtx DBMS_XMLquery.CtxType;
    ErrorNum NUMBER;
    ErrorMsg VARCHAR2(200);
    RES1 CLOB;
    Begin
    QueryCtx := DBMS_XMLQuery.NewContext( Select_Statment );
    DBMS_XMLQuery.setRaiseException(QueryCtx, true);
    DBMS_XMLQuery.setRaiseNoRowsException(QueryCtx, true);
    DBMS_XMLQuery.propagateOriginalException(QueryCtx,true);
    ResULT := DBMS_XMLQuery.getXML(QueryCtx);
    DBMS_XMLQuery.CloseContext(QueryCtx);
    Exception
    when others then
    DBMS_XMLQuery.getExceptionContent (QueryCtx,ErrorNum,
    ErrorMsg);
    ERR_NO := NVL(ErrorNum,0);
    END;
    I get Ora-00600 error when the retrived data is more than 800
    records.
    can any one help me Pls ASAP.
    THNX
    Husam

    Can you get the query result with SQL command alone?

  • Oracle error ORA-00600 when using Oracle 10g and Sun One Web Server 6.1

    I have a java application that was running under Solaris 8 and Oracle 9i. I am trying to get it up and running on a new server that is configured with Solaris 9 and Oracle 10g. Whenever the application tries to connect to the database it receives the following error: ORA-00600 [ttcgcshnd-1][0]. My research indicates that this is an internal Oracle error that represents a low level unexpected condition. I have looked through my configuration for the Web Server and I have not been able to determine the cause of this problem. My DBA tells me that we have the latest patch installed for Oracle! Has anyone encountered this problem before? Any help would be greatly appreciated!

    If the problem is also present in a SWING app, i.e. outside the web server, then it is porbably something external to the webserver.
    I think you should ensure that the driver and database are compatible with each other. It is very likely that you need a new jdbc driver for the new database.
    download from here http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc101020.html
    try the ojdbc14.jar

  • ORA-00600 when using sample1

    Starting sample1 from the proc demo and entering an employee number shows up:
    ORA-00600: internal error code, arguments: [ktsircinfo_num1], [0], [1], [17585], [], [], [], []
    which doesn't look like employee data
    Same result when trying a select to one of scotts tables with sqlplus.
    Uwe

    What version of the database?
    Which flavor of Disco (Plus, Desktop, Viewer)?
    Standars EUL or Apps EUL?
    Can you post the code for the calculation?
    ORA-600 errors, as you mentioned, are internal, and may require opening a dialog with Oracle support. Then again, it could be something else in the calculation that is causing the sky to fall.

  • Ora 02290 when using qms_transaction_mgt and autonomous transactions

    Hi all,
    I'm using the qms procedures:
    qms_transaction_mgt for openeing and closing transactions.
    Somewhere in my procedure when the transaction is opened i call another procedure which contains a autonomous transaction.
    The next time qms_transaction_mgt.close_transaction is called i get an ORA-02290: check constraint (HST65.QMS_NEED_TO_CLOSE_TRANSACTION) violated
    When i debug the qms_transaction_mgt.close transaction the g_current_trans_id variable is empty, which indicates the transaction is allready closed.
    When i remove the pragma autonomous_transaction statement and the commit statement from the procedure i call, the problem is resolved.
    Version information:
    Designer 9.0.2 with a with a Oracle 9i 9.2 database and Headstart 9i.
    Does anybody know how i can resolve this or if this is a bug and how to fix it?
    Thanks,
    Yvon

    Ian, Yvon,
    It is unfortunately a know restriction that the CDM RuleFrame component of both Headstart for Designer 6i and Headstart for Designer 9i doesn't work in combination with autonomous transactions.
    The reason is that the RuleFrame administration relies on information stored in 1. pl/sql package variables and 2. database tables. Using autonomous transactions (that involve CDM RuleFramed DML) causes this information to dissynchronize.
    A year ago I investigated the possibilities to make autonomous transactions possible with RuleFrame but unfortunately this is fundamental problem: RuleFrame wants to combine multiple DML-actions into one logical transaction (gards this with the "need_to_close_transaction" constraint), while autonomous transactions intend to to the opposite: commit a part of a transaction while the rest of the transaction still is posted/not committed.
    There is one exception: if you call an atonomous procedure that does DML on a non-ruleframe-enabled table (no TAPI triggers that intend to open/close the transaction, no CAPI etc), everything functions.
    Problem explanation:
    ====================
    1. Outer transaction is opened (by front end or TAPI triggers of first DML)
    2. DML takes place
    3. Autonomous transaction-procedure is called
    4. Auto-transaction again tries (and succeeds!) to open the transaction, it doesn't see that the transaction is opened (db table qms_transactions is empty for the autonomous transaction on query)
    5. DML within auto-transaction is posted
    6. Auto-transaction closes transaction
    7. Auto-transaction is committed
    8. Outer transaction thinks the transaction is already closed, because the auto-transaction cleaned out the package variables when it closed the transaction.
    9. Commit of the outer transaction fails as the deferred check constraint need_to_close_transaction avoids this to happen (rollback takes place because of this violation).
    Hope this helps
    Kind Regards
    Marc Vahsen
    Headstart Team Oracle NL

  • Getting wrong values when using sum() and last() functions in aggregations.

    Hi..
    I created a request in presentation servicews it includes " employ id,name,organization.cost center,annul salary,haouly salary, head count". for employ 13 cost centers available so 13 annul salaries for 13 organizations.each has annul saari 10400,hourly salary 10.previously when i run the request with headcount not including salaries headcount is 1 for 13 rows. when head count is not included in the requst and ran request it gives for 13 rows salaries are 10,400,10 respectively. when i add the head count to the previous request the salaries become 135200,130 respectively. actual head for each organization is 1.in the requst it show as 13. the headcount field in business layes uses 'other sum(headcount),date last(headcount). i need it to same values for salaries after addition of
    headcount also.
    Thank you.
    Edited by: user10797474 on May 20, 2009 8:08 AM

    Did you already have a look in the log file to see the SQL which is sent to the DB?
    This might be a modeling issue in your RPD. Check if you have set the correct dimensionlevels for your facts.
    Regards
    John
    http://obiee101.blogspot.com/

  • My New iphone 5s gets hot quickly when using GPS and downloading apps/movies. Is this normal? My Iphone 5 never did that!

    I Have had my IPhone 5s for less than a month and have noticed that it gets very hot while downloading apps/movies and while using GPS.  (not at the same time) Battery life is also disappointing!  Normal?? My 5 never had this problem!

    Hi anthonym73,
    If you are having an issue with your iPhone getting hot you may want to read this article for some guidance -
    Keeping iPhone, iPad, and iPod touch within acceptable operating temperatures
    Thanks for using Apple Support Communities.
    Best,
    Brett L 

  • How can we get ADFSecurity work when used in OC4J, OID and OAM?

    I am getting error in http server log "mod_oc4j: Response status=499 and reason=Oracle SSO, but failed to get mod_osso global context."
    But I am not using Oracle SSO and my client doesn't want to use it either, I am using OAM SSO(CoreIDSSO) in my configuration. Please read the details below.
    I am using ADFSecurity in an app that is protected by OAM. To migrate ADFSecurity permissions from
    system-jazn-data.xml to OID, I used JAZNMigrationTool to populate OID with Grantees and Permissions. OAM gives login page, and authentication works fine.
    But ADFSecurity is not working. ADFComponent Delete button is enabled even for roles that dont have permissions for the iterator delete.
    - The app works fine when I use without OAM. ADF Security permissions work fine.
    - The app works fine when used with OAM, but with ADFSecurity disabled (enforce=false).
    - When I enforce ADFSecurity alongwith OAM, ADFSecurity is not working.
    In the doc "Oracle Containers for J2EE Security Guide b28957", there is a mention of use of CoreIDPrincipal for permissions. Our OID Permissions entries show
    LDAPRealmRole for attribute orcljaznprincipal. I am not sure if this could be the reason.
    We have configured AccessServerSDK for the SOA instance and have policy for the urls in the policy manager. We have entries in orion-application.xml, orion-web.xml and system-jazn-data.xml as per the documentations.
    How can we get ADFSecurity work when used with OID and OAM?

    Have you been able to successfully integrate OAS with OAM & OID? We have similar requriement and so far we have not been able to get it working.
    We have application specific roles which we map to OID roles using orion-application.xml.
    Any pointers to achieve this would be greatly appreciated.
    thanks,
    Dipal

  • I would like to buy my boyfriend the iphone 5. He has an upgrade - but can I purchase it for Christmas now and get money back when he activates and uses his upgrade?

    I would like to buy my boyfriend the iphone 5. He has an upgrade - but can I purchase it for Christmas now and get money back when he activates and uses his upgrade?

    Or purchase an Apple Gift Card for him to use to get a phone at Apple after Christmas. He gets the card as the Christmas gift and can go get the phone himself. It would cost you the same amount of money.

  • While trying to change password getting ora-00600 [4842] - Plz help

    while trying to change password getting ora-00600 [4842] - Plz help
    database : 9.2.0.4
    o/s : Linux

    Hi,
    when getting an ORA-600 you always should contact Oracle support please ;-)
    To diagnose an ORA-600 the stack trace will be necessary - see the trace file mentioned in the alert.log when the ORA-600 did happen.
    But FIRST OF ALL you should definitely apply patch set 9.2.0.8 and see if this error happens again (metalink.oracle.com ==> PATCHES ==> Quick Links ==> <your platform>). Support will ask you to do the same before they start diagnosing anything in this case.
    And please keep in mind that 9.2.0 has reached end of Premier Support more than 1 year ago.
    Kind regards
    Mike

  • URGENT : ORA 302000 when using TEXT_IO.fopen

    Hi,
    I get this error ORA 302000 when using TEXT_IO package, the code I use is
    new_file:=text_io.fopen('c:\text.txt','r')
    i don't have the description of this ORA 302000 , pls does anyone have it?

    Hi,
    I know it's been 2 years but it's still up to date for me.
    I tried the suggested piece of code to trace the error but it did not bring anything more
    EXCEPTION
    When Others then
    srw.Message( 2, 'EXCEPTION ' || SQLCODE || ' in common package. Can not open the file ');
    IF SQLCODE = -302000 then
    LOOP
    EXIT WHEN TOOL_ERR.NERRORS = 0;
    SRW.MESSAGE( 667, TO_CHAR(TOOL_ERR.CODE) || ': ' || TOOL_ERR.MESSAGE);
    TOOL_ERR.POP;
    END LOOP;
    END IF;
    srw.Message( 3, 'EXCEPTION ' || SQLCODE || ' in com package. Can not open the file ' || I_Desname || ' : ' || SQLERRM );
    Only Message 2 and 3 are displayed in the trace file
    Any other suggestion?
    Manu

  • Getting ORA-1013 when attempting to expand tables within connections

    Getting ORA-1013 when attempting to expand tables within connections on new install of Oracle SQL developer 3.1.06.
    Any ideas?

    Hi Steve,
    The ORA-01013 usually means a timeout or, more typically on this forum, an intentional user cancellation. Searching the forum, I do not see any prior references to your exact situation. Some recommendations:
    1. SQL Developer 3.1.0.6 was an early adopter release. Upgrade to the latest and greatest: 3.2.10.09.57
    2. Review this: Re: [SQL Developer 3.0.04] Cannot Drill Down
    3. If it is a true timeout, your privileges might make a difference. If you have access to the DBA views, SQL Developer does look-ups using those and performance is better.
    So for [3], having the SELECT_CATALOG_ROLE privilege may help. I even read of one case in this forum where the poster finally discovered his database's recycle bin had an issue and the DBA needed to do some clean-up to correct the performance issue.
    Hope this helps,
    Gary
    SQL Developer Team

  • Getting ORA-01403:, when it shouldn't

    Greetings, i apologize beforehand for my spelling, name(takes 6 hours to change) and the headache you migth get, however,
    i bring you the following code, and test results:
    ------Procedure wich throws the error-------
    create or replace
    procedure P_COLEGAS(x in number) as
    ctipo varchar2(20);
    asd varchar2(20);
    cursor curnombre is
    select nombre from unidad,elemento where (elemento.id_elem=unidad.id_elem and unidad.tipo=ctipo and elemento.ciudad=asd);
    begin
    select unidad.tipo, elemento.ciudad into ctipo,asd from unidad,elemento where unidad.id_elem=x and elemento.id_elem=x;
    for blah in curnombre loop
    DBMS_OUTPUT.PUT_LINE('nombre unidad: '||blah.nombre||' ');
    end loop;
    end;
    -what i get when executing the procedure-
    Error que empieza en la línea 1 del comando:
    exec p_colegas(19)
    Informe de error:
    ORA-01403: no data found
    ORA-06512: at "BD00.P_COLEGAS", line 9
    ORA-06512: at line 1
    01403. 00000 - "no data found"
    *Cause:
    *Action:-----------------------------------------------------------
    -----------------the real problem--------------------
    if in that procedure i were to write
    (1)
    select unidad.tipo into ctipo from unidad where unidad.id_elem=x;(2)
    select elemento.ciudad into asd from elemento where elemento.id_elem=x;instead the single query i wrote, we get the following:
    (1) works wonderfull, only gets the error when there are no matches for x.
    (2) throws the error i showed before.
    however when i do the following query in the worksheet and execute it:
    (3)
    select elemento.ciudad from elemento where elemento.id_elem=x;i get what i expected to get 1 row 1 column.(yes it has data)
    note: in (3) the only difference is that i remove the into clause, and x is the same number i used when i execute the procedure.
    --------------------the question------------------------
    why in the procedure, the query (2) fail to fetch the data, the same data wich the query(3) does not fail to fetch?
    i'm getting ORA-01403, when i shouldn't?
    is there a work around to this problem?
    --------------------what i try------------------------------
    nested the query with it's own error handle exception, getting the same results, just catches the error with a different handling.
    tool used: sql developer
    -Example data--
    tested the procedure with the following example data in a brand new workspace getting the same error.
    --  DDL for Table ELEMENTO
      CREATE TABLE "ELEMENTO"
       (     "ID_ELEM" NUMBER,
         "CIUDAD" VARCHAR2(20),
         "TIPO" CHAR(1),
         "X" NUMBER,
         "Y" NUMBER,
         "FECHAHORA_CREACION" TIMESTAMP (6)
    --  DDL for Table UNIDAD
      CREATE TABLE "UNIDAD"
       (     "ID_ELEM" NUMBER,
         "PORCENTAJE_SALUD" NUMBER,
         "NOMBRE" VARCHAR2(20),
         "TIPO" VARCHAR2(20)
    REM INSERTING into ELEMENTO
    SET DEFINE OFF;
    Insert into ELEMENTO (ID_ELEM,CIUDAD,TIPO,X,Y,FECHAHORA_CREACION) values (12,'Infernalia','U',10,10,to_timestamp('12-NOV-20 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into ELEMENTO (ID_ELEM,CIUDAD,TIPO,X,Y,FECHAHORA_CREACION) values (15,'Infernalia','U',10,7,to_timestamp('12-NOV-20 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into ELEMENTO (ID_ELEM,CIUDAD,TIPO,X,Y,FECHAHORA_CREACION) values (19,'Infernalia','U',15,9,to_timestamp('12-NOV-20 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into ELEMENTO (ID_ELEM,CIUDAD,TIPO,X,Y,FECHAHORA_CREACION) values (23,'Infernalia','U',16,8,to_timestamp('12-NOV-20 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into ELEMENTO (ID_ELEM,CIUDAD,TIPO,X,Y,FECHAHORA_CREACION) values (27,'Infernalia','C',15,10,to_timestamp('12-NOV-20 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into ELEMENTO (ID_ELEM,CIUDAD,TIPO,X,Y,FECHAHORA_CREACION) values (52,'Humania','U',26,10,to_timestamp('22-NOV-20 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into ELEMENTO (ID_ELEM,CIUDAD,TIPO,X,Y,FECHAHORA_CREACION) values (58,'Humania','U',24,9,to_timestamp('22-NOV-20 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into ELEMENTO (ID_ELEM,CIUDAD,TIPO,X,Y,FECHAHORA_CREACION) values (62,'Humania','U',27,11,to_timestamp('22-NOV-20 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into ELEMENTO (ID_ELEM,CIUDAD,TIPO,X,Y,FECHAHORA_CREACION) values (64,'Humania','C',25,8,to_timestamp('22-NOV-20 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into ELEMENTO (ID_ELEM,CIUDAD,TIPO,X,Y,FECHAHORA_CREACION) values (78,'GruntVille','U',47,32,to_timestamp('29-NOV-20 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into ELEMENTO (ID_ELEM,CIUDAD,TIPO,X,Y,FECHAHORA_CREACION) values (84,'GruntVille','U',42,28,to_timestamp('29-NOV-20 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into ELEMENTO (ID_ELEM,CIUDAD,TIPO,X,Y,FECHAHORA_CREACION) values (89,'GruntVille','U',43,29,to_timestamp('29-NOV-20 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into ELEMENTO (ID_ELEM,CIUDAD,TIPO,X,Y,FECHAHORA_CREACION) values (91,'GruntVille','C',44,37,to_timestamp('29-NOV-20 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into ELEMENTO (ID_ELEM,CIUDAD,TIPO,X,Y,FECHAHORA_CREACION) values (29,'Infernalia','C',16,7,to_timestamp('12-NOV-20 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into ELEMENTO (ID_ELEM,CIUDAD,TIPO,X,Y,FECHAHORA_CREACION) values (90,'GruntVille','U',49,36,to_timestamp('29-NOV-20 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    REM INSERTING into UNIDAD
    SET DEFINE OFF;
    Insert into UNIDAD (ID_ELEM,PORCENTAJE_SALUD,NOMBRE,TIPO) values (12,100,'Grang','Soldado');
    Insert into UNIDAD (ID_ELEM,PORCENTAJE_SALUD,NOMBRE,TIPO) values (15,100,'Krout','Médico');
    Insert into UNIDAD (ID_ELEM,PORCENTAJE_SALUD,NOMBRE,TIPO) values (19,100,'Warf','Obrero');
    Insert into UNIDAD (ID_ELEM,PORCENTAJE_SALUD,NOMBRE,TIPO) values (23,100,'Puaj','Obrero');
    Insert into UNIDAD (ID_ELEM,PORCENTAJE_SALUD,NOMBRE,TIPO) values (52,100,'Marcelus','Soldado');
    Insert into UNIDAD (ID_ELEM,PORCENTAJE_SALUD,NOMBRE,TIPO) values (58,100,'Claudius','Soldado');
    Insert into UNIDAD (ID_ELEM,PORCENTAJE_SALUD,NOMBRE,TIPO) values (62,100,'Arturius','Obrero');
    Insert into UNIDAD (ID_ELEM,PORCENTAJE_SALUD,NOMBRE,TIPO) values (78,100,'Klaknot','Médico');
    Insert into UNIDAD (ID_ELEM,PORCENTAJE_SALUD,NOMBRE,TIPO) values (84,100,'Staisht','Médico');
    Insert into UNIDAD (ID_ELEM,PORCENTAJE_SALUD,NOMBRE,TIPO) values (89,100,'Bjorkson','Soldado');
    Insert into UNIDAD (ID_ELEM,PORCENTAJE_SALUD,NOMBRE,TIPO) values (90,100,'Sknot','Médico');
    --  Constraints for Table ELEMENTO
      ALTER TABLE "ELEMENTO" ADD CONSTRAINT "ELEMENTO_CHK1_TIPO" CHECK (TIPO IN ('U', 'C')) ENABLE;
      ALTER TABLE "ELEMENTO" ADD CONSTRAINT "ELEMENTO_PK" PRIMARY KEY ("ID_ELEM") ENABLE;
      ALTER TABLE "ELEMENTO" MODIFY ("ID_ELEM" NOT NULL ENABLE);
      ALTER TABLE "ELEMENTO" MODIFY ("CIUDAD" NOT NULL ENABLE);
      ALTER TABLE "ELEMENTO" MODIFY ("TIPO" NOT NULL ENABLE);
      ALTER TABLE "ELEMENTO" MODIFY ("X" NOT NULL ENABLE);
      ALTER TABLE "ELEMENTO" MODIFY ("Y" NOT NULL ENABLE);
      ALTER TABLE "ELEMENTO" MODIFY ("FECHAHORA_CREACION" NOT NULL ENABLE);
    --  Constraints for Table UNIDAD
      ALTER TABLE "UNIDAD" MODIFY ("ID_ELEM" NOT NULL ENABLE);
      ALTER TABLE "UNIDAD" MODIFY ("PORCENTAJE_SALUD" NOT NULL ENABLE);
      ALTER TABLE "UNIDAD" MODIFY ("NOMBRE" NOT NULL ENABLE);
      ALTER TABLE "UNIDAD" MODIFY ("TIPO" NOT NULL ENABLE);
      ALTER TABLE "UNIDAD" ADD CONSTRAINT "UNIDAD_PK" PRIMARY KEY ("ID_ELEM") ENABLE;
    --  Ref Constraints for Table ELEMENTO
    --  Ref Constraints for Table UNIDAD
      ALTER TABLE "UNIDAD" ADD CONSTRAINT "UNIDAD_ELEMENTO_FK1" FOREIGN KEY ("ID_ELEM")
           REFERENCES "ELEMENTO" ("ID_ELEM") ENABLE;
    /Edited by: 975362 on 06-12-2012 04:47 AM
    Edited by: BluShadow on 06-Dec-2012 12:51
    added {noformat}{noformat} tags for readability of code/data.  Please read {message:id=9360002} and learn to do this yourself in future.
    Edited by: 975362 on 06-12-2012 05:44 AM
    added example data.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Oops, I mi9ssed table ELEMENTO has column X. When you use:
    where unidad.id_elem=x and elemento.id_elem=x;column names take precedence over PL/SQL variables wnd X is resolved as table ELEMENTO column X. not as PL/SQL procedure parameter X. Change PL/SQL procedure parameter name:
    SQL> create or replace
      2  procedure P_COLEGAS(x in number) as
      3  ctipo varchar2(20);
      4  asd varchar2(20);
      5  
      6  cursor curnombre is
      7  select nombre from unidad,elemento where (elemento.id_elem=unidad.id_elem and unidad.tipo=ctipo
    and elemento.ciudad=asd);
      8  
      9  begin
    10  select unidad.tipo, elemento.ciudad into ctipo,asd from unidad,elemento where unidad.id_elem=x
    and elemento.id_elem=x;
    11  for blah in curnombre loop
    12  DBMS_OUTPUT.PUT_LINE('nombre unidad: '||blah.nombre||' ');
    13  end loop;
    14  end;
    15  /
    Procedure created.
    SQL> exec p_colegas(19)
    BEGIN p_colegas(19); END;
    ERROR at line 1:
    ORA-01403: no data found
    ORA-06512: at "SCOTT.P_COLEGAS", line 9
    ORA-06512: at line 1
    SQL> create or replace
      2  procedure P_COLEGAS(p_x in number) as
      3  ctipo varchar2(20);
      4  asd varchar2(20);
      5  
      6  cursor curnombre is
      7  select nombre from unidad,elemento where (elemento.id_elem=unidad.id_elem and unidad.tipo=ctipo
    and elemento.ciudad=asd);
      8  
      9  begin
    10  select unidad.tipo, elemento.ciudad into ctipo,asd from unidad,elemento where unidad.id_elem=p_
    x and elemento.id_elem=p_x;
    11  for blah in curnombre loop
    12  DBMS_OUTPUT.PUT_LINE('nombre unidad: '||blah.nombre||' ');
    13  end loop;
    14  end;
    15  /
    Procedure created.
    SQL> exec p_colegas(19)
    PL/SQL procedure successfully completed.
    SQL> SY.

  • Error ORA-06502 When using function REPLACE in PL/SQL

    Hi,
    I have a PL/SQL procedure which gives error 'Error ORA-06502 When using function REPLACE in PL/SQL' when the string value is quite long (I noticed this with a string 9K in length)
    variable var_a is of type CLOB
    and the assignment statement where it gives the error is
    var_a := REPLACE(var_a, '^', ''',''');
    Can anyone please help!
    Thanks

    Even then that shouldn't do so:
    SQL> select overload, position, argument_name, data_type, in_out
      2  from all_arguments
      3  where package_name = 'STANDARD'
      4  and object_name = 'LPAD'
      5  order by 1,2
      6  /
    OVERLOAD   POSITION ARGUMENT_NAME                  DATA_TYPE                      IN_OUT
    1                 0                                VARCHAR2                       OUT
    1                 1 STR1                           VARCHAR2                       IN
    1                 2 LEN                            BINARY_INTEGER                 IN
    1                 3 PAD                            VARCHAR2                       IN
    2                 0                                VARCHAR2                       OUT
    2                 1 STR1                           VARCHAR2                       IN
    2                 2 LEN                            BINARY_INTEGER                 IN
    3                 0                                CLOB                           OUT
    3                 1 STR1                           CLOB                           IN
    3                 2 LEN                            NUMBER                         IN
    3                 3 PAD                            CLOB                           IN
    4                 0                                CLOB                           OUT
    4                 1 STR1                           CLOB                           IN
    4                 2 LEN                            NUMBER                         INI wonder what happened?

Maybe you are looking for