ORA-14551 Problem

Hello
I have written a function at database. The function have 3 nested cursors. It was working fine till I made a small change, having a select statement and an addition of new column in already written insert statement. Now it have started giving me error ora-14551. The problem remains after changes have reversed.
Please help me to solve my problem..
Thanks
Rashid Masood Ashraf
mail: [email protected]

Hi
My function was doing fine before the change that i had told.
In my sitution the same function is working fine at form level.
and I have gone through such functions a number of times..
But what is the solution now..
I can't go with out this as on form level it is slow.
Thanks

Similar Messages

  • Workaround for ORA-14551 WHILE CALLING FUNCTION IN SQL OVER DBLINK

    Hi,
    any idea how to workaround such issue in 9.2.0.8 (I know this is working with 11.2).
    create table mylog(id number, data date , mess clob);
    create or replace function myfunc(id in number, data in date ,mess in varchar2)
    return number is
    pragma autonomous_transaction;
    retval number;
    begin
       insert into mylog values (id , data ,mess);
    commit;
    retval := id;
    return retval;
    end;
    SQL> select schema.myfunc@dblink(2,sysdate,'bbbbbbb') from dual;
    ERROR at line 1:
    ORA-14551: cannot perform a DML operation inside a query
    ORA-06512: at "SCHEMA.MYFUNC", line 6
    ORA-06512: at line 1Regards
    GregG

    DBMS_SQL is documented in what I think 9i calls "Supplied Oracle Packages and Types" manual.
    The basic concept behind this is that it allows you to manually create a cursor and execute it (via an OCI like interface). For example, it can be used to issue remote DDLs via a database link as described in {message:id=10323373}.
    DBMS_SQL provides flexibility and power that is beyond the standard cursor constructs in PL/SQL. The system package version even enables you to execute SQL and PL/SQL code as any other schema in the database.
    You will have however to play around with DBMS_SQL (locally and remotely) to determine how to hide the fact that a local select (which Oracle assumes, correctly, does not change database state), actually changes the state of a remote database.
    Personally I would not bother with such a hack. I would use the problem to enforce an upgrade to the latest Oracle version, or kick out the crappy app that needs to use a SQL select to make database changes.

  • Getting error SQL Error : ORA-14551: cannot perform a DML operation inside a query

    Hi gurus ,
    Your help is greatly appreciated ..
    I am doing some changes in the fucntion for an existing package .Introducing the new below check , am updating one of the tables based on a if condition ..
           IF  numALLOWED_COUNT >= numLAST_COUNT_ADDED+1  THEN
                     blnGDS_Allowed :=True;
                      varSTMT := 'UPDATE PROD.TMS_PROCESS_COUNTER ';
                      varSTMT := varSTMT ||' SET last_count_added = last_count_added+1';
                      varSTMT := varSTMT ||' WHERE process_name = ''DAILY_GDS_COUNT''';
                      varSTMT := varSTMT ||' AND COUNTER_IND = ''750FD130''';
                     PROC_LOG('Update Tms_Process_counter varSTMT --' || varSTMT);
                     IF INSERT_BATCH(99,varSTMT) > 0 THEN
                        NULL;
                     END IF;
    Function for insert_batch :
    UNCTION INSERT_BATCH(numTABLE_ID IN NUMBER, varSQL_STATEMENT IN VARCHAR2) RETURN NUMBER IS
    varINSERT_BATCH_STMT  VARCHAR2(32767)     := NULL;
    varADD_REC_TYPE       BATCH_TABLES.ADD_REC_TYPE%TYPE;
    BEGIN
        PROC_LOG( 'INSIDE INSERT_BATCH IRC : ' || varSQL_STATEMENT );  --IRC 9/20 UC
        INSERT INTO BATCH_STATEMENT(QUEUE_ID,TABLE_ID,STATEMENT,QUEUE_SEQUENCE_ID)
        VALUES (numQUEUE_ID,numTABLE_ID,varSQL_STATEMENT,1);
    RETURN 1;
    EXCEPTION WHEN OTHERS THEN
        PROC_LOG('Failed in INSERT_BATCH');
        PROC_LOG('SQL Error : ' || SUBSTR(SQLERRM,1,1000));
        RETURN -1;
    END INSERT_BATCH;
    desc PROD.BATCH_STATEMENT
      QUEUE_ID           NUMBER(15)                 NOT NULL
      TABLE_ID           NUMBER(2)                  NOT NULL
      STATEMENT          VARCHAR2(4000 BYTE)        NOT NULL
      QUEUE_SEQUENCE_ID  NUMBER(5)                  NOT NULL
    Some how when its calling the insert_batch , its giving me the error in the logs as below:
    04:01:41 - Update Tms_Process_counter varSTMT --UPDATE PROD.TMS_PROCESS_COUNTER  SET last_count_added = last_count_added+1 WHERE process_name = 'DAILY_GDS_COUNT' AND COUNTER_IND = '750FD130'
    04:01:41 - INSIDE INSERT_BATCH IRC : UPDATE PROD.TMS_PROCESS_COUNTER  SET last_count_added = last_count_added+1 WHERE process_name = 'DAILY_GDS_COUNT' AND COUNTER_IND = '750FD130'
    04:01:41 - Failed in INSERT_BATCH
    04:01:41 - SQL Error : ORA-14551: cannot perform a DML operation inside a query

    Some how when its calling the insert_batch , its giving me the error in the logs as below:
    04:01:41 - SQL Error : ORA-14551: cannot perform a DML operation inside a query
    Yes - and the exception is telling you EXACTLY what the problem is. You have a query
    IF INSERT_BATCH(99,varSTMT) > 0 THEN
    And you are performing a DML operation inside that query:
    INSERT INTO BATCH_STATEMENT(QUEUE_ID,TABLE_ID,STATEMENT,QUEUE_SEQUENCE_ID)
        VALUES (numQUEUE_ID,numTABLE_ID,varSQL_STATEMENT,1);
    Like the exception says: you can't do that.
    You need to call the function using PL/SQL and capture the return value into a variable. Then test that variable:
    myVar := INSERT_BATCH(99,varSTMT);
    if myVar > 0 THEN

  • Ora-00600 problem with the kodpunp1 and kope2upic954 arguments

    hi everybody,
    i have a problem with ora-00600 error on a oracle 8.1.7.0.0 database on winxp.
    i've read about many ora-00600 problems but only few were with kodpunp1 and kope2upic954 arguments.
    In my trc files i found something like this:
    *** SESSION ID:(29.2808) 2006-02-08 11:05:33.177
    *** 2006-02-08 11:05:33.177
    ksedmp: internal or fatal error
    ORA-00600: internal error code, arguments: [kope2upic954], [], [], [], [], [], [], []
    Current SQL statement for this session:
    call p$insert_rules_details(:1 , :2 , :3, :4)
    *** 2006-02-08 11:06:48.400
    ksedmp: internal or fatal error
    ORA-00600: internal error code, arguments: [kodpunp1], [], [], [], [], [], [], []
    ORA-00600: internal error code, arguments: [kope2upic954], [], [], [], [], [], [], []
    Current SQL statement for this session:
    call p$insert_rules_details(:1 , :2 , :3, :4)
    " so this is happenning when calling this procedure (p$insert_rules_details ...this is my procedure, not some procedure owned by sys).
    if anyone can help me, pls reply. i've heard replies like: call oracle support, put a tar on metalink ..... i don't have metalink support so i appreciate real help ;)
    what to do for avoiding/fixing this error?
    tx

    in addtion, this procedure p$insert_rules_details does some inserts into 3 tables from my schema. The problem might be from the usage of an num_array in this procedure declared as table of number. When number of elements from this num_array excels 4096, then the procedure generates errors.....i believe, not very sure about that. Can that be true?
    by

  • Ora-01000 problem not resolve with other posts

    I've the ora-01000 problem which has been argued in other posts but it persist on me.
    I'm using JDK 1.3 and Oracle 8i with classes12_01.zip file.
    I've been looking at v$open_cursor to see how many cursors where open and even if I put
    rs.close(); rs=null;
    stmt.close(); stmt=null;
    it still doesn't work.
    Any ideas?
    Thanks.

    Sorry. It do work. It was my fault.
    null

  • ORA-14551: cannot perform a DML operation inside a query

    I have a Java method which is deployed as a Oracle function.
    This Java method parses a huge XML & populates this data
    into a set of database tables.
    I have to call this Oracle function in a unix shell script using sqlplus.
    Value returned by this function will be used by the shell script to decide
    what to do next.
    I am calling the Oracle Java function as follows in the shell script:
    echo "SELECT XML_TABLES.RUN_XML_LOADER('$P1','$P2','$P3','$P4') FROM DUAL;\n" | sqlplus $DB_USER > $LOG
    This gives error - "ORA-14551: cannot perform a DML operation inside a query".
    If I have to add a AUTONOMOUS_TRANSACTION pragma to this Java function,
    where to I add it considering, that the definition of the function is in a Java class.
    Can we do it in call spec?
    create or replace package XML_TABLES is
    function RUN_XML_LOADER(xmlFile IN VARCHAR2,
    xmlType IN VARCHAR2,
    outputDir IN VARCHAR2,
    logFileDir IN VARCHAR2) RETURN VARCHAR2 AS
    LANGUAGE JAVA NAME 'XmlLoader.run
    (java.lang.String, java.lang.String, java.lang.String, java.lang.String)
    return java.lang.String';
    end XML_TABLES;
    If not is there any other way to acheive this?
    Thanks in advance.
    Sunitha.

    If I have to add a AUTONOMOUS_TRANSACTION pragma to this Java function,You'd have to write a PL/SQL function that calls the JSP. But I would caution you about using that pragma. It does introduce tremendous complexity into processing.
    As I see it you only need a function to return the result code so why not use a procedure with an OUT parameter?
    Cheers, APC
    Of course Yoann's suggestion of using an anonymous block would work too.
    Message was edited by:
    APC

  • DBMS_SPACE.OBJECT_GROWTH_TREND returns ORA-14551

    Hi,
    When I used DBMS_SPACE.OBJECT_GROWTH_TREND, it ran successfully but ended with an error.
    SQL> SELECT * FROM V$VERSION ;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
    PL/SQL Release 11.1.0.6.0 - Production
    CORE    11.1.0.6.0      Production
    TNS for 32-bit Windows: Version 11.1.0.6.0 - Production
    NLSRTL Version 11.1.0.6.0 - Production
    SQL> SHOW USER
    USER is "SYS"
    SQL> SELECT *
      2  FROM
      3  table(
      4   DBMS_SPACE.OBJECT_GROWTH_TREND (
      5    object_owner =>'HR',
      6    object_name  =>'NAMES',
      7    object_type  =>'TABLE',
      8    partition_name =>NULL,
      9    start_time =>NULL,
    10    end_time   =>NULL,
    11    interval   =>to_dsinterval('0 00:10:00')  ,
    12    skip_interpolated => 'FALSE',
    13    timeout_seconds =>NULL,
    14    single_datapoint_flag =>'TRUE')
    15  )
    16  /
    TIMEPOINT                      SPACE_USAGE SPACE_ALLOC QUALITY
    04-OCT-09 03.58.47.421000 PM      10443367    11534336 INTERPOLATED
    04-OCT-09 04.08.47.421000 PM      10443367    11534336 INTERPOLATED
    04-OCT-09 04.18.47.421000 PM      10443367    11534336 INTERPOLATED
    04-OCT-09 04.28.47.421000 PM      10443367    11534336 INTERPOLATED
    04-OCT-09 04.38.47.421000 PM      10443367    11534336 INTERPOLATED
    04-OCT-09 04.48.47.421000 PM      10443367    11534336 INTERPOLATED
    04-OCT-09 04.58.47.421000 PM      10443367    11534336 INTERPOLATED
    04-OCT-09 05.08.47.421000 PM      10443367    11534336 INTERPOLATED
    04-OCT-09 05.18.47.421000 PM      10443367    11534336 INTERPOLATED
    04-OCT-09 05.28.47.421000 PM      10443367    11534336 INTERPOLATED
    04-OCT-09 05.38.47.421000 PM      10443367    11534336 INTERPOLATED
    TIMEPOINT                      SPACE_USAGE SPACE_ALLOC QUALITY
    04-OCT-09 05.48.47.421000 PM      10443367    11534336 INTERPOLATED
    04-OCT-09 05.58.47.421000 PM      10443367    11534336 INTERPOLATED
    04-OCT-09 06.08.47.421000 PM      10443367    11534336 INTERPOLATED
    04-OCT-09 06.18.47.421000 PM      10443367    11534336 INTERPOLATED
    04-OCT-09 06.28.47.421000 PM      10443367    11534336 INTERPOLATED
    04-OCT-09 06.38.47.421000 PM      10443367    11534336 INTERPOLATED
    04-OCT-09 06.48.47.421000 PM      10443367    11534336 INTERPOLATED
    04-OCT-09 06.58.47.421000 PM      10443367    11534336 INTERPOLATED
    04-OCT-09 07.08.47.421000 PM      10443367    11534336 INTERPOLATED
    04-OCT-09 07.18.47.421000 PM      10443367    11534336 INTERPOLATED
    04-OCT-09 07.28.47.421000 PM      10443367    11534336 INTERPOLATED
    TIMEPOINT                      SPACE_USAGE SPACE_ALLOC QUALITY
    04-OCT-09 07.38.47.421000 PM      10443367    11534336 INTERPOLATED
    04-OCT-09 07.48.47.421000 PM      10443367    11534336 INTERPOLATED
    04-OCT-09 07.58.47.421000 PM      10443367    11534336 INTERPOLATED
    04-OCT-09 08.08.47.421000 PM      10443367    11534336 INTERPOLATED
    04-OCT-09 08.18.47.421000 PM      10443367    11534336 INTERPOLATED
    04-OCT-09 08.28.47.421000 PM      10443367    11534336 INTERPOLATED
    04-OCT-09 08.38.47.421000 PM      10443367    11534336 INTERPOLATED
    04-OCT-09 08.48.47.421000 PM      10443367    11534336 INTERPOLATED
    04-OCT-09 08.58.47.421000 PM      10443367    11534336 INTERPOLATED
    04-OCT-09 09.08.47.421000 PM      10443367    11534336 PROJECTED
    04-OCT-09 09.18.47.421000 PM      10443367    11534336 PROJECTED
    TIMEPOINT                      SPACE_USAGE SPACE_ALLOC QUALITY
    04-OCT-09 09.28.47.421000 PM      10443367    11534336 PROJECTED
    04-OCT-09 09.38.47.421000 PM      10443367    11534336 PROJECTED
    04-OCT-09 09.48.47.421000 PM      10443367    11534336 PROJECTED
    36 rows selected.
    EXCEPTION in chrow processing -  code: -14551  msg: ORA-14551: cannot perform a
    DML operation inside a query*
    -- changed to another table for testing
    SQL> ED
    Wrote file afiedt.buf
      1  SELECT *
      2  FROM
      3  table(
      4   DBMS_SPACE.OBJECT_GROWTH_TREND (
      5    object_owner =>'HR',
      6    object_name  =>'EMPLOYEES',
      7    object_type  =>'TABLE',
      8    partition_name =>NULL,
      9    start_time =>NULL,
    10    end_time   =>NULL,
    11    interval   =>to_dsinterval('0 00:10:00')  ,
    12    skip_interpolated => 'FALSE',
    13    timeout_seconds =>NULL,
    14    single_datapoint_flag =>'TRUE')
    15* )
    SQL> /
    TIMEPOINT                      SPACE_USAGE SPACE_ALLOC QUALITY
    04-OCT-09 04.09.20.343000 PM         12614       65536 GOOD
    EXCEPTION in chrow processing -  code: -14551  msg: ORA-14551: cannot perform a
    DML operation inside a query

    DECLARE
    v_object_owner VARCHAR2 (30):='ME';
    v_object_name VARCHAR2 (30):='ACCOUNTS';
    v_object_type VARCHAR2 (30):='TABLE PARTITION';
    v_partition_name VARCHAR2 (30):='PAF19960501';
    v_objrefcursor sys_refcursor;
    r_obj_trend DBMS_SPACE.object_growth_trend_row;
    CURSOR c_parts (p_owner IN VARCHAR2, p_table IN VARCHAR2)
    IS
    SELECT table_owner, table_name, partition_name
    FROM dba_tab_partitions
    WHERE table_owner = p_owner AND table_name = p_table
    order by partition_name;
    BEGIN
    FOR r IN c_parts ('ME', 'ACCOUNTS')
    LOOP
    v_objrefcursor :=
    DBMS_SPACE.object_growth_trend_cur (
    object_owner => v_object_owner,
    object_name => v_object_name,
    object_type => v_object_type,
    partition_name => v_partition_name,
    start_time => sysdate - 120,
    end_time => sysdate + 30,
    interval =>null,
    skip_interpolated => 'FALSE',
    timeout_seconds => 360
    loop
    FETCH v_objrefcursor INTO r_obj_trend;
    exit when v_objrefcursor%notfound;
    -- if r_obj_trend.SPACE_USAGE * 1.5 <= r_obj_trend.SPACE_ALLOC THEN
    DBMS_OUTPUT.PUT_LINE( v_object_name ||' '||v_partition_name
    || ' '
    || r_obj_trend.timepoint
    || ' '
    || r_obj_trend.SPACE_USAGE
    || ' '
    || r_obj_trend.SPACE_ALLOC
    || ' '
    || r_obj_trend.quality);
    -- end if;
    END LOOP;
    end loop;
    CLOSE v_objrefcursor;
    END;
    EXCEPTION in chrow processing - code: -1031 msg: ORA-01031: insufficient privileges
    ACCOUNTS PAF19960501 18-DEC-09 06.49.07.857150 PM 32768 196608 INTERPOLATED
    ACCOUNTS PAF19960501 23-DEC-09 01.40.33.571436 AM 32768 196608 INTERPOLATED
    ACCOUNTS PAF19960501 27-DEC-09 08.31.59.285722 AM 32768 196608 INTERPOLATED
    ACCOUNTS PAF19960501 31-DEC-09 03.23.25.000008 PM 32768 196608 GOOD
    ACCOUNTS PAF19960501 04-JAN-10 10.14.50.714294 PM 32768 196608 PROJECTED
    ACCOUNTS PAF19960501 09-JAN-10 05.06.16.428580 AM 32768 196608 PROJECTED
    ACCOUNTS PAF19960501 13-JAN-10 11.57.42.142866 AM 32768 196608 PROJECTED
    EXCEPTION in chrow processing - code: -1031 msg: ORA-01031: insufficient privileges
    ACCOUNTS PAF19960501 02-SEP-09 03.23.25.000000 PM 32768 196608 INTERPOLATED
    ACCOUNTS PAF19960501 06-SEP-09 10.14.50.714286 PM 32768 196608 INTERPOLATED
    ACCOUNTS PAF19960501 11-SEP-09 05.06.16.428572 AM 32768 196608 INTERPOLATED
    ACCOUNTS PAF19960501 31-DEC-09 03.23.25.000008 PM 32768 196608 GOOD
    ACCOUNTS PAF19960501 04-JAN-10 10.14.50.714294 PM 32768 196608 PROJECTED
    ACCOUNTS PAF19960501 09-JAN-10 05.06.16.428580 AM 32768 196608 PROJECTED
    ACCOUNTS PAF19960501 13-JAN-10 11.57.42.142866 AM 32768 196608 PROJECTED
    EXCEPTION in chrow processing - code: -1031 msg: ORA-01031: insufficient privileges
    ACCOUNTS PAF19960501 02-SEP-09 03.23.25.000000 PM 32768 196608 INTERPOLATED
    ACCOUNTS PAF19960501 06-SEP-09 10.14.50.714286 PM 32768 196608 INTERPOLATED
    ACCOUNTS PAF19960501 11-SEP-09 05.06.16.428572 AM 32768 196608 INTERPOLATED
    ACCOUNTS PAF19960501 31-DEC-09 03.23.25.000008 PM 32768 196608 GOOD
    ACCOUNTS PAF19960501 04-JAN-10 10.14.50.714294 PM 32768 196608 PROJECTED
    ACCOUNTS PAF19960501 09-JAN-10 05.06.16.428580 AM 32768 196608 PROJECTED
    ACCOUNTS PAF19960501 13-JAN-10 11.57.42.142866 AM 32768 196608 PROJECTED
    EXCEPTION in chrow processing - code: -1031 msg: ORA-01031: insufficient privileges
    ACCOUNTS PAF19960501 02-SEP-09 03.23.25.000000 PM 32768 196608 INTERPOLATED
    ACCOUNTS PAF19960501 06-SEP-09 10.14.50.714286 PM 32768 196608 INTERPOLATED
    ACCOUNTS PAF19960501 11-SEP-09 05.06.16.428572 AM 32768 196608 INTERPOLATED
    ACCOUNTS PAF19960501 31-DEC-09 03.23.25.000008 PM 32768 196608 GOOD
    ACCOUNTS PAF19960501 17-JAN-10 06.49.07.857152 PM 32768 196608 PROJECTED
    ACCOUNTS PAF19960501 22-JAN-10 01.40.33.571438 AM 32768 196608 PROJECTED
    ACCOUNTS PAF19960501 26-JAN-10 08.31.59.285724 AM 32768 196608 PROJECTED
    EXCEPTION in chrow processing - code: -1031 msg: ORA-01031: insufficient privileges
    ACCOUNTS PAF19960501 02-SEP-09 03.23.25.000000 PM 32768 196608 INTERPOLATED
    Maybe not the best example but as you can see,
    for every switch to a different partition I get this EXCEPTION msg.
    The output seems correct otherwise.
    I can create the message several different ways!
    Row#     BANNER
    1     Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    2     PL/SQL Release 10.2.0.4.0 - Production
    3     CORE     10.2.0.4.0     Production
    4     TNS for IBM/AIX RISC System/6000: Version 10.2.0.4.0 - Productio
    5     NLSRTL Version 10.2.0.4.0 - Production

  • ORA-14551 when using rules manager inside a SELECT * FROM TABLE(myFunction)

    Hello
    I want to return rows from a pipelined function, and map this to a view, or a BC4J an query this in my application.
    I want to populate the rows based on many evaluations, to achieve this, I want to include the rules manager functionality.
    I have defined my event, rule class and result view successfully, but... when I run my query, I have the following error:
    ORA-14551: cannot perform a DML operation inside a query
    We believe this is caused when the engine tries to populate the results view with the matching rules.
    Is there a workaround for this?
    Please help
    Thnks in advance.
    Alex.

    Alex,
    I cannot think of any workaround that would allow you to evaluate the rules and return the results with a single query. A Rules Manager application with composite events modifies the state of the database (for maintaining incremental state as well as the results view) when some events are processed. So, you will not be able to pipeline the results to a SQL query. If you can at least separate the ADD_EVENTS call from the rest of the logic this may be possible.
    Hope this helps,
    -Aravind.

  • Ora-01843 problem

    My code is giving me ora-01843 problem. When i put startdate as 01-jan-05 and
    enddate as 31-jan-05, it gives me error. Please help me guys.
    --declare
    --ntwk_var varchar2(100);
    SELECT PHY.PHYNAM,
    decode (NETWORKPROTOCOL.LCC, 'Y', '<Lombardi Cancer Center>', '') ||
    decode (NETWORKPROTOCOL.UMH, 'Y', ' <Union Memorial Hospital>', '') ||
    decode (NETWORKPROTOCOL.GSH, 'Y', '<Good Somaritan Hospital>', '') ||
    decode (NETWORKPROTOCOL.FSH, 'Y', '<Franklin Square Hospital>', '') ||
    decode (NETWORKPROTOCOL.WHC, 'Y', '<Washington Hospital Center>', '') ||
    decode (NETWORKPROTOCOL.HH, 'Y', '<Harbor Hospital>', '') as NETWORKID,
    PRTCRC.FULLNAME,
    CRCMTG.CRMTGDT, CRCMTG.CRCSTAT, PRTCRC.SUBMITTEDTOIRB,
    PRTCRC.RECEIVEDIRBRESULTDATE,
    PRTCRC.PRT, prtcrc.crcid,
    PRTCRC.REVIEWSTATUS,
    CRCMTG.CRCOUTCOME,
    PRTCRC.REVIEWTYPE,
    PRTCRC.MODIFICATIONDATE, PRTCRC.FINALIRBAPPROVALDATE,
    PRTCRC.ACTIVATIONDATE, RECENTREAPPROVALDATE.RECENTREAPPROVAL,
    recentamendmentdate.amenddate,
    PRTCRC.CLOSURETOPATIENTACCRUAL, PRTCRC.TERMINATIONDATE,
    prttype.descrip
    FROM CRCMTG, PRTCRC, NETWORKPROTOCOL, RECENTREAPPROVALDATE, PHY, prttype, recentamendmentdate
    WHERE
    ((CRCMTG.PRTCRCID(+)=PRTCRC.ID) AND
    (NETWORKPROTOCOL.PRTCRCID(+)=PRTCRC.ID) AND
    (PRTCRC.PRINCIPALINVESTIGATOR=PHY.PHY(+))
    AND (PRTCRC.ID=RECENTREAPPROVALDATE.PRTCRCID(+))
    AND (PRTCRC.ID=recentamendmentdate.PRTCRCID(+))
    ) and
    TO_DATE('01'||SUBSTR(LTRIM( NVL(PRTCRC.CRCID, TO_CHAR(sysdate, 'MMYYYY'))) , 1, 6), 'DDMMYYYY') >= :startdate
    and
    TO_DATE('01'||SUBSTR(LTRIM( NVL(PRTCRC.CRCID, TO_CHAR(sysdate, 'MMYYYY'))) , 1, 6), 'DDMMYYYY') <= :enddate
    ) and
    prtcrc.type=prttype.id(+) and
    fullname is not null
    order by &SORT

    as Andrew had mentioned you are trying to convert a numeric into date that might not be in date format. for example you had a value of 482334
    SQL> select substr(ltrim('482334'),1,6)
      2    from dual;
    SUBSTR
    482334then you tried to convert it into date format
    SQL> select to_date(substr(ltrim('482334'),1,6),'ddmmyyyy')
      2    from dual;
    select to_date(substr(ltrim('482334'),1,6),'ddmmyyyy')
    ERROR at line 1:
    ORA-01847: day of month must be between 1 and last day of month
    SQL> it will give you an error. what is the datatype for your column PRTCRC.CRCID?

  • VERY weird ora-12705 problem

    I have on a database running on Unix True64 a database link to another database. Also a True64 machine. The Oracle version is 8.1.7.0.0.
    What happens is that I get a ora-12705 problem. Yes I know this has to do with NLS environment setting. But I doubt this is the case with this one. Look at the example:
    unix> sqlplus /
    SQL> select count(*) from zfindau;
    select count(*) from zfindau
    ERROR at line 1:
    ORA-12705: invalid or unknown NLS parameter value specified
    ORA-02063: preceding line from HUBD
    SQL> connect system/<password>
    SQL> connect /
    SQL> select count(*) from zfindau;
    COUNT(*)
    74991
    So under Unix I connect to an ops$ account. The zfindau is a synonym to the remote database table. First I do the select statement and get the ORA-12705 error. After I connect to a different user (system, or any other user available), do nothing and directly connect to the ops$account the same sql statement does work.
    Does anyone of you know what's going on here.
    Andre Seesink

    anyone??

  • ORA-14551 Call to a proc that performs INSERT from within a FUNCTION

    Anyone,
    I have written a number of functions that serve to convert an old_value to a new_value. But there are some times when the conversion fails. I wish to log those exceptions into a table and move on. I undertand FUNCTIONS are not to insert data but that is why I created a PROC and want to be able to call it from within the FUNCTIONs.
    Is there any way to get around the ORA-14551 error?
    Here is what I have:
    CREATE OR REPLACE FUNCTION MAXIMO.fcn_get_worktype
      ( worktype_IN IN varchar2,
        siteid_IN IN varchar2)
      RETURN  varchar2 IS
      var_worktype varchar2(5);
    BEGIN
         IF siteid_IN IN ('ML','OK','BE') THEN
            BEGIN
                 SELECT NVL(NEW_WTYPE,NULL)
                INTO var_worktype
                 FROM MAXIMO.MAX411_WBK_WORKTYPE$
                 WHERE OLD_WTYPE = worktype_IN;
            EXCEPTION
                WHEN NO_DATA_FOUND THEN
                    MAXIMO.SP_CONVERSION_EXCEPTION('WORKTYPE', 'WORKTYPE', worktype_IN, siteid_IN);
                    var_worktype := 'XX';
                     RETURN var_worktype;
            END;
        END IF;
        RETURN var_worktype ;
    END;And here is my PROC:
    CREATE OR REPLACE PROCEDURE MAXIMO.sp_conversion_exception (table_IN IN VARCHAR2, column_IN IN VARCHAR2, value_IN IN VARCHAR2, tab_ID IN VARCHAR2)
    IS
    BEGIN
        INSERT INTO MAXIMO.MAX411_CONVERSION_EXCEPTIONS
             ( TABLE_NAME,
             COLUMN_NAME,
             VALUE ,
              TAB_ID)
        VALUES
             ( table_IN,
             column_IN,
             value_IN,
              tab_ID );
        EXCEPTION
            /* If value was already recorded then do not record again, Key is on all three columns */
            WHEN DUP_VAL_ON_INDEX
                THEN
                    NULL;
        COMMIT;
    END;Can anyone shed any light on how I can stop getting:
    ERROR at line 1:
    ORA-14551: cannot perform a DML operation inside a query
    ORA-06512: at "MAXIMO.SP_CONVERSION_EXCEPTION", line 5
    ORA-06512: at "MAXIMO.FCN_GET_WORKTYPE", line 16
    ORA-01403: no data found
    ORA-06512: at "MAXIMO.LOAD_PM", line 181
    ORA-06512: at line 1
    Thanks in advance for any help I can get...
    Miller

    You need a PRAGMA AUTONOMOUS_TRANSACTION in your exception procedure, eg:
    CREATE OR REPLACE PROCEDURE MAXIMO.sp_conversion_exception (table_IN IN VARCHAR2, column_IN IN VARCHAR2, value_IN IN VARCHAR2, tab_ID IN VARCHAR2)
    IS
      PRAGMA AUTONOMOUS_TRANSACTION
    BEGIN
      ...

  • ORA-01552 problem, plz help it's urgent

    Actually, before one week I made (run Norton QuikScan) & this ended by the ORA-01033 problem, I realized that the file (E:\ORACLE\PRODUCT\10.2.\ORADATA\ORCL\UNDOTBS01.DBF)
    was corrupted, so I dropped it from the (Dos command Prompt), then the system generated it again and then everything was excellent.
    After that I couldn't create any new tables.
    NB. I've more than 30 large table.
    then i got the ORA-01552 problem,
    cannot use system rollback segment for non-system tablespace...
    i did this:(
    & i got this error:
    SQL> alter system set undo_management=manual scope=spfile;
    System altered.
    SQL> shutdown immediate;
    ORA-00376:file 2 cannot be read at this time
    ORA-01110:data file 2:
    'E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\UNDOTBS01.DBF'
    SQL> select name, status, BLOCK_SIZE from v$datafile;
    NAME
    STATUS BLOCK_SIZE
    E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSTEM01.DBF
    SYSTEM 8192
    E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\UNDOTBS01.DBF
    RECOVER 8192
    E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSAUX01.DBF
    ONLINE 8192
    NAME
    STATUS BLOCK_SIZE
    E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\USERS01.DBF
    ONLINE 8192
    E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\EXAMPLE01.DBF
    ONLINE 8192
    E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\UNDO01.DBF
    ONLINE 8192
    i need to solve it...:(
    is it correct to uninstall the ORACLE & install it again.
    thanks in advance.

    ORA-01033 ORACLE initialization or shutdown in progress
    Cause: An attempt was made to log on while Oracle is being started or shut down.
    Action: Wait a few minutes. Then retry the operation.
    Does not mean your datafile was corrupted!! You meed to recover the undo dbf. It does not have anything to do with reinstalling Oracle. You can restore from hot backup and recover the db, or drop and recreate the undo ts at mount.

  • Character set Conversion (US7ASCII to AL32UTF8) -- ORA-31011 problem

    Hello,
    We've run into some problems as part of our character set conversion from US7ASCII to AL32UTF8. The latest problem is that we have a query that works in US7ASCII, but after converting to AL32UTF8 it no longer works and generates an ORA-31011 error. This is very concerning to us as this error indicates an XML parsing problem and we are doing no XML whatsoever in our DB. We do not have XML columns (nor even CLOBs or BLOBs) nor XML tables and it's not XMLDB.
    For reference, we're running 11.2.0.2.0 over Solaris.
    Has anyone seen this kind of problem before?
    If need be, I'll find a way to post table definitions. However, it's safe to assume that we are only using DATE, VARCHAR2 and NUMBER column types in these tables. All of the tables are local to the DB.
    Thanks

    We converted using the database using scripts I developed. I'm not quite sure how we converted is relevant, other than saying that we did not use the Oracle conversion utility (not csscan, but the GUI Java tool).
    A summary:
    1) We replaced the lossy characters by parsing a csscan output file
    2) After re-scanning with csscan and coming up clean, our DBA converted the database to AL32UTF8 (changed the parameter file, changing the character set, switched the semantics to char, etc).
    3) Final step was changing existing tables to use char semantics by changing the table schema for VARCHAR2 columns
    Any specific steps I cannot easily answer, I worked with a DBA at our company to do this work. I handled the character replacement / DDL changes and the DBA ran csscan & performed the database config changes.
    Our actual error message:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00210: expected '<' instead of '�Error at line 1
    31011. 00000 - "XML parsing failed"
    *Cause:    XML parser returned an error while trying to parse the document.
    *Action:   Check if the document to be parsed is valid.
    Error at Line: 24 Column: 15
    This seems to match the the document ID referenced below. I will ask our DBA to pull it up and review it.
    Please advise if more information is needed from my end.

  • ORA-29855 problem with creation of a index

    Hi to all,
    I'm trying to create an index but I have this problem:
    SQL>CREATE INDEX ITALIA_NODE_IDX ON ITALIA_NODE$(GEOMETRY) INDEXTYPE IS MDSYS.SPATIAL_INDEX;
    CREATE INDEX ITALIA_NODE_IDX ON ITALIA_NODE$(GEOMETRY) INDEXTYPE IS MDSYS.SPATIAL_INDEX
    ERROR at line 1:
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-13249: internal error in Spatial index: [mdidxrbd]
    ORA-13249: Error in Spatial index: index build failed
    ORA-13249: Error in spatial index: [mdrcrtxfergm]
    ORA-13249: Error in spatial index: [mdpridxtxfergm]
    ORA-29400: data cartridge error
    ORA-01653: unable to extend table M2_10A70$$.1024 by SPATIAL in tablespace USERS
    ORA-06512: a "MDSYS.SDO_INDEX_METHOD_10I", line 10
    What do you think about this problem?
    thank you in advance.
    Crystal
    Edited by: crystal13 on 18-giu-2010 2.03

    Hi,
    it looks like your tablespace USERS is to small. You have no space left. So extend the size of the tablespace by enlarging the file underneath or putting a second one to it, or put the tablespace in AUTOEXTEND mode. See the administrators guide: http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/tspaces.htm#i1010516

  • ORA-00313 problem, thank you very much!!

    Hi, there,
    when I use OEM standalone to login the database, I found there is an error:
    ORA-00313:open failed for members of log group1 of thred 1
    ORA-00312:online log 1 thread 1 "c:\oracle-database-server\oradata\redo01.log"
    then I can't open the database and only can mount it.
    and then I found all the other databases on my local machine have the exact same problem. at the same time, I found the service of OracleOracle9iDB_serveManagementServer can't startup. whenever I want to start it, it warn me "start and stop, becuase there is no work connect to it". so I doublt it seems there is something wrong with my operation system, but not the database's problem. my os is WIN XP PRO.
    does there anyone who knows the reason and how can I solve it? besides, can I backup the database in mount status and how?
    thank you very much for any hint!
    I do need you help, thank you so much!!

    Does c:\oracle-database-server\oradata\redo01.log exist? Once I met a guy, who, as he said, deleted unnecessary log files :-)

Maybe you are looking for

  • Unable to create temporary backing file

    My program is throwing out the error: temporary open: /var/tmp/BDB20825: Too many open files unable to create temporary backing file This happens after my program has been running for about 4 hours. The program appears to run out of file descriptors.

  • Installer states it has been installed but all I get is a black screen. What can I do?

    I have an iMac and I installed the Adobe reader to open messages and information.  The installer stated I was finished but all I get is a black screen when i open a page that need the Adobe reader.  What can I do to fix this?

  • Wireless Help Please!!!!

    Hello, I have a iBook g4 and and imac g5 (not intel) anyways i havae a westell modem and havea linksys wireless router and the router itsnt working anymore. so i called westell and they got my internet back but i has to have the ethernet cable straig

  • Can't believe the 10gb of data increased

    when will data costs go down.  Verizon recently lowered costs in the lower gb plans but raised 10gb by $20.  As cell carriers get more competitive, like AT&T data rollover, you would think Verizon would try to hold on to long time customers.  I know

  • Can't install Photoshop Extended on Mac 10.5.4 components failed

    One of our professors has a brand new iMac running 10.5.4 The machine has 4 GB of ram and Photoshop has never been installed on this system before. The only Adobe product on the machine is Acrobat 8. (Not the reader - the actual program.) I tried to