ORA-6512

I wrote below small function in pl/sql
==========================
CREATE OR REPLACE FUNCTION rec_id_chk (record_id IN NUMBER) RETURN CHAR IS
dummy NUMBER;
l_mesg_data VARCHAR2(1000);
BEGIN
SELECT NVL(INSTR (record_id, '-'),0) INTO dummy FROM DUAL;
IF dummy > 0 THEN
l_mesg_data := 'Error Type :'||'{'||record_id||'}'||sysdate||' Record Invalid';
RAISE_APPLICATION_ERROR(-20002,l_mesg_data);
END IF;
RETURN 'T';
END rec_id_chk;
===================
When I run it ; it gives ORA-6512;; any suggestions ?
SQL> select rec_id_chk(-11) from dual;
select rec_id_chk(-11) from dual
ERROR at line 1:
ORA-20002: Error Type :{-11}29-OCT-07 Record number format is invalid
ORA-06512: at "APPS.REC_ID_CHK", line 13

Hi Amar
I don't understand why r u checking "-" sign in a number datatype. If u need to check whether the number is +ve or -ve go for a condition like (number<0). By the way error ORA-06512 comes due to error stack unwinding which is the result of  unhandles exceptions.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • Setproperties on new ORDDOC gives ORA-6512?

    Hello,
    I am attempting to convert the CLOBs in an existing table into ORDDOCs in a new table.
    I seemed to be almost there. I allocated a new ORDDOC using INIT(), and used writeToSource() on the doc pointer to transfer the text (which I first converted to RAW). The application that accepts this now lists the new document, and displays the text contents.
    I now need to set the size (and MIME type, even though the app seems to understand that it's a text document). I called setproperties after writeToSource, and get a set of ORA-6510/ORA-6512 errors. (Included below)
    I'd really appreciate any advice!
    Thanx and regards,
    Arn.
    DEV1> l
    1 DECLARE
    2
    3 srcRec arn5%ROWTYPE;
    4 doc ORDSYS.ORDDOC;
    5 ctx RAW(4000) :=NULL;
    6 userArg RAW(4000);
    7 len INTEGER;
    8 comtxt VARCHAR2(32767);
    9 comraw RAW(32767);
    10 res integer;
    11 doc2 ORDSYS.ORDDOC;
    12
    13 BEGIN
    14
    15 DELETE FROM assessment_document
    16 WHERE DOC_NO = 0;
    17
    18 DELETE FROM media_document
    19 WHERE DOC_NO = 0;
    20
    21 INSERT INTO assessment_document VALUES( 1, 0 );
    22
    23 INSERT INTO media_document VALUES(
    24 0, 'comment3.txt', 758197915, SYSDATE, 758197915, SYSDATE,
    25 ORDSYS.ORDDOC.INIT()
    26 ) RETURNING DOC_OBJ INTO doc;
    27
    28 SELECT *
    29 INTO srcRec
    30 FROM arn5
    31 WHERE a=0;
    32
    33 len := LENGTH( srcRec.b );
    34 --res:= doc.openSource(userArg, ctx);
    35
    36 comtxt := dbms_lob.substr(srcRec.b);
    37 doc.writeToSource(ctx, 1, len, utl_raw.cast_to_raw(comtxt));
    38 doc.setProperties(ctx,true);
    39
    40 COMMIT;
    41* END;
    DEV1> /
    DECLARE
    ERROR at line 1:
    ORA-06510: PL/SQL: unhandled user-defined exception
    ORA-06512: at "ORDSYS.ORDDOC", line 337
    ORA-06510: PL/SQL: unhandled user-defined exception
    ORA-06512: at line 38

    Lawrence, thanx for your prompt reply.
    I'll try restating my requirements and problems, and hopefully that will help.
    We have an existing table containing text comments in CLOBs. I need to convert the contents of each CLOB into a separate new ORDDOC object in a new table. After this, I will also create a JSP screen that will allow new comments to be submitted, which will also be saved in the DB as ORDDOC objects.
    The script I provided was my attempt at the conversion, using doc.writeToSource(). My first question is, is this the right way to go about converting CLOBs to ORDDOCs?
    I have a screen that lists documents in the DB. This list includes the document size, which I determine using getContentLength(). For "real" documents - that is, sourced from external files and uploaded using the browser, such metadata is automatically captured. For my new document that is sourced from the CLOB, this information (content length, MIME type) is not automatically captured. I therefore need to set it somehow. I attempted to use setproperties, as althought setMimeType works, there is no setContentLength function.
    After your reply, we looked into writing our own plugin, but could not glean from the documentation how to go about this - eg, where and how content length is set.
    I hope you can provide further advice on this problem.
    Thanx again, and regards,
    Arn.

  • ORA-6512: at "SYS.OWM_DDL_PKG" line 3228

    I am using Oracle Workspace Manager Version 9.2.0.7, as my process
    attempts to perform DBMS_WM.BeginDDL on a versioned table, i am getting the following error:
    ORA-6512: at "SYS.OWM_DDL_PKG" line 3228
    ORA-6512: at "SYS.LT", line 11831
    ORA-6512: at line 1
    Any suggestions on what might be the cause of this problem?
    Thanks!!

    No, I would need a lot more information to be able to determine what the cause of the problem is. Are you able to create a testcase that easily reproduces the problem ? If so, feel free to post it here, or create a TAR with the necessary information.
    Regards,
    Ben

  • Ora-6502,ora-6512

    ora-6502,0ra-6512
    report program ( PL/SQL) Throws following error.
    PL/SQL Numeric or value error host behind array too small.
    what is the possible solution.

    http://www.orafaq.com/wiki/ORA-06502
    Nicolas.

  • Upgrade 11.1.0.7 to 11.2.0.3  gives ora-1403,ora-6512

    We are upgrading the databse from 11.1.0.7 to 11.2.0.3 on hpux ia 64 using manual upgrade.
    We ran catupgrade.sql and after that utu112.sql.
    However the utu112.sql gives the following status->
    @utlu112s.sql
    .Oracle Database 11.2 Post-Upgrade Status Tool 03-30-2013 01:53:44
    Component Current Version Elapsed Time
    Name Status Number HH:MM:SS
    Oracle Server
    . ORA-01403: no data found
    . ORA-06512: at line 5
    . ORA-06512: at line 5
    . ORA-01403: no data found
    . VALID 11.2.0.3.0 00:35:25
    JServer JAVA Virtual Machine
    . VALID 11.2.0.3.0 00:04:23
    Oracle XML Database
    . VALID 11.2.0.3.0 00:04:56
    Oracle Database Java Packages
    . VALID 11.2.0.3.0 00:00:18
    Gathering Statistics
    . 00:12:34
    Total Upgrade Time: 00:57:39
    PL/SQL procedure successfully completed.
    Also, when we did select from dba_registry it gave all components as valid
    Oracle Database Catalog Views VALID 11.2.0.3.0
    Oracle Database Packages and Types VALID 11.2.0.3.0
    JServer JAVA Virtual Machine VALID 11.2.0.3.0
    Oracle Database Java Packages VALID 11.2.0.3.0
    Oracle XML Database VALID 11.2.0.3.0
    I want to know, should i consider the database upgrade as sucess ot what to do next.
    The upgrade log also shows same error- grep "^ORA-" upgrade11gR2.log
    ORA-01403: no data found
    ORA-06512: at line 5
    ORA-01403: no data found
    ORA-06512: at line 5
    Thanks in advance!!

    Pl post a link to the instructions you followed, along with all of the errors from the actual upgrade log file. Is there a reason for not using DBUA ? Have you opened an SR for this issue ?
    HTH
    Srini

  • ORA-6512 when using Analyze in 9.2.0.7

    Good Day! Kindly Help
    I'm using 9.2.0.7 on Windows server 2003 SP1.
    Whenever I use the Analyze Wizard located on Oracle EM Console, just to compute statistics for a certain table, the ff is the query that is executed:
    begin dbms_stats.gather_table_stats(ownername=>'ECI'.tabname=>'AGGREGATEENTITY',partname=>NULL);
    it produces the ff error:
    ORA-20000:Unable to analyze TABLE "ECI"."AGGREGATEENTITY", insufficient priviledges or does not exist
    ORA-06512: at"SYS.DBMS_STATS", LINE 10292
    ORA-06512: at"SYS.DBMS_STATS", LINE 10315
    ORA-06512: at line 2
    It produces the same error for only one of my schema. Oh by the way I'm using user SYS as sysdba to do this.

    You doesn't seem to have privileges to analyze the table. You would either be needing ANALYZE ANY privilege (or others....can't remember).
    HTH
    Thanks
    Chandra Pabba
    Message was edited by:
    ChandraP
    Message was edited by:
    ChandraP

  • Internal Oracle Error in SYS.UTL_HTTP.READ_TEXT - ORA-6512 @ line 1336

    I have a PLSQL program that performs an HTTP POST to fetch data from an external website. The website is returning the contents of a file in the HTTP response. This program has been working for years and just started giving us trouble recently at a particular client. The issue cannot be reproduced locally, only on a specific client machine when trying to download a particular set of XML files through this HTTP interface.
    The stack trace is:
    ORA-29273: HTTP request failed
    ORA-06512: at "SYS.UTL_HTTP", line 1336
    ORA-06502: PL/SQL: numeric or value error
    ORA-06512: at "SYS.UTL_HTTP", line 1336The code in question is:
    PROCEDURE SEND_REQUEST
        p_REQUEST      IN CLOB,
        p_RESPONSE     OUT CLOB,
        p_HEADERNAMES  OUT STRING_COLLECTION,
        p_HEADERVALUES OUT STRING_COLLECTION,
        p_ERRORMESSAGE OUT VARCHAR2
    ) IS
        v_HTTP_REQ    UTL_HTTP.REQ;
        v_HTTP_RESP   UTL_HTTP.RESP;
        v_REQUEST_LEN NUMBER;
        v_POS         NUMBER;
        v_COUNT       NUMBER;
        v_TEXT        VARCHAR2(8192);
        v_LEN         NUMBER;
    BEGIN
        -- raise Request_Failed error if an HTTP error occurs
        UTL_HTTP.SET_RESPONSE_ERROR_CHECK(TRUE);
        UTL_HTTP.SET_DETAILED_EXCP_SUPPORT(FALSE);
        -- extend timeout to 10 minutes
        UTL_HTTP.SET_TRANSFER_TIMEOUT(60 * 10);
        v_HTTP_REQ := UTL_HTTP.BEGIN_REQUEST(G_URL, 'POST');
        -- disable cookies for this request
        UTL_HTTP.SET_COOKIE_SUPPORT(v_HTTP_REQ, FALSE);
        -- authentication
        IF g_USERNAME IS NOT NULL THEN
            UTL_HTTP.SET_AUTHENTICATION(v_HTTP_REQ, g_USERNAME, g_PASSWORD);
        END IF;
        -- upload request body
        v_REQUEST_LEN := DBMS_LOB.GETLENGTH(p_REQUEST);
        UTL_HTTP.SET_HEADER(v_HTTP_REQ, 'Content-Type', 'application/x-www-form-urlencoded');
        UTL_HTTP.SET_HEADER(v_HTTP_REQ, 'Content-Length', v_REQUEST_LEN);
        -- write the CLOB request data
        v_POS := 1;
        WHILE v_POS <= v_REQUEST_LEN LOOP
            v_LEN := 8192;
            DBMS_LOB.READ(p_REQUEST, v_LEN, v_POS, v_TEXT);
            UTL_HTTP.WRITE_TEXT(v_HTTP_REQ, v_TEXT);
            v_POS := v_POS + v_LEN;
        END LOOP;
        -- get the response
        v_HTTP_RESP := UTL_HTTP.GET_RESPONSE(v_HTTP_REQ);
        -- read it into CLOB
        DBMS_LOB.CREATETEMPORARY(p_RESPONSE, TRUE);
        DBMS_LOB.OPEN(p_RESPONSE, DBMS_LOB.LOB_READWRITE);
        LOOP
            BEGIN           
                UTL_HTTP.READ_TEXT(v_HTTP_RESP, v_TEXT, 8192);       
            EXCEPTION
                WHEN UTL_HTTP.END_OF_BODY THEN
                    ERRS.LOG_AND_CONTINUE('Send_Request: Exeception occurred reading text from the http response.',
                                          p_LOG_LEVEL => LOGS.C_LEVEL_INFO_MORE_DETAIL);
                    v_TEXT := '';
            END;
            EXIT WHEN NVL(LENGTH(v_TEXT), 0) = 0;   
            DBMS_LOB.WRITEAPPEND(p_RESPONSE, LENGTH(v_TEXT), v_TEXT);
        END LOOP;
        DBMS_LOB.CLOSE(p_RESPONSE);
        -- gather response headers
        p_HEADERNAMES := STRING_COLLECTION();
        p_HEADERVALUES := STRING_COLLECTION();
        v_COUNT := UTL_HTTP.GET_HEADER_COUNT(v_HTTP_RESP);
        v_POS := 1;
        WHILE v_POS <= v_COUNT LOOP
            p_HEADERNAMES.EXTEND();
            p_HEADERVALUES.EXTEND();   
            UTL_HTTP.GET_HEADER(v_HTTP_RESP, v_POS, p_HEADERNAMES(p_HEADERNAMES.LAST), p_HEADERVALUES(p_HEADERVALUES.LAST));
            v_POS := v_POS + 1;   
        END LOOP;
        UTL_HTTP.END_RESPONSE(v_HTTP_RESP);
        -- success!
        p_ERRORMESSAGE := NULL;
    EXCEPTION
        WHEN UTL_HTTP.REQUEST_FAILED THEN
            ERRS.LOG_AND_CONTINUE('Send_Request: Exeception Request Failed caught.', p_LOG_LEVEL => LOGS.C_LEVEL_INFO_MORE_DETAIL);   
        WHEN OTHERS THEN
            ERRS.LOG_AND_CONTINUE('Send_Request: Exeception Others caught.', p_LOG_LEVEL => LOGS.C_LEVEL_INFO_MORE_DETAIL);   
    END SEND_REQUEST;It fails specifically at the section that is reading text from the response:
    UTL_HTTP.READ_TEXT(v_HTTP_RESP, v_TEXT, 8192);
    ...Any thoughts?
    I have used a packet sniffer, Wireshark, to monitor the HTTP traffic between the website and database during the issue. There is nothing malformed with the Response content. No special chars that I can find. Etc.
    The machine in question that is failing is running 10gR2.
    I have done some searching and I found this forum post:
    utl_http.read_text and multi-byte support
    and this Oracle bug:
    https://support.oracle.com/CSP/main/article?cmd=show&type=BUG&id=4015165&productFamily=Oracle
    Not really much help.
    Any help would be appreciated.
    Thanks,
    GatorPaul
    Edited by: 939368 on Jun 7, 2012 2:27 PM

    In this case, and most cases, the NLS_LENGTH_SEMANTICS is set to 'BYTE'. Realize that this is an Oracle application that we deploy into an external customer environment and we do not always have the ability to control NLS Settings.
    So, based on your explanation, I would expect that an approach like this would fix it:
    v_TEXT VARCHAR2(32766);
    UTL_HTTP.READ_TEXT(v_HTTP_RESP, v_TEXT, 8192);
    Here we are saying, get the next 8192 characters, but put that into a buffer that allows up to 32K bytes. This should allow for the enough room for up to 4 bytes per character. Am I understanding you correctly?
    But here is my question:
    I put a fix in place today, where I increased both the v_TEXT byte size and the GET_TEXT 'len' parameter to 32766 and it fixed the issue. By doing that, I am telling it: Give me the next 32766 characters and put it into a VARCHAR2(32766). Given your explanation, I would expect this to overflow the v_TEXT variable as well, or at least have the potential to do so.
    We were processing 5 different XML responses. They were all failing originally. After the change, they all passed. Their sizes were 47K, 21K, 14K, 48K, and 21K. If the XML file was small, < 32K then maybe is slipped under the radar given the new buffer size of 32766. But what about the 2 files that were over 32K. Very curious on your thoughts. I did not have a loop counter in there to see how many times it was looping to parse the 48K file. With a new buffer size of 32K I would expect it to loop 2x. But, I know in this case, the file was streamed over the network using 14 smaller TCP packets, none of which were more than 9000 bytes. Maybe the PLSQL looped 14 times as well.
    When the process was failing for all 5 files, I do know at that time it was always failing on the first loop (first 8192 characters).
    Anyway, Thanks for the advice. I will let you guys know if I uncover anymore info.
    G8torPaul
    Edited by: G8torPaul on Jun 12, 2012 2:04 PM
    Edited by: G8torPaul on Jun 12, 2012 2:04 PM
    Edited by: G8torPaul on Jun 12, 2012 2:05 PM

  • Ora-6512 error in string appending , plz guide to soleve this.

    declare
    x varchar2(4000);
    y varchar2(10000);
    cursor c is select ename||'----'||to_char(empno) from emp; /*( to_char or no to_char it did not matter)*/
    begin
    open c;
    loop
    fetch c into y ;
    exit when(sql%notfound);
    --if c%rowcount = 1 then
    -- x:=y;
    -- else
    x:=x||y; -- end if;
    end loop;
    close c;
    dbms_output.put(x);
    --exception
    -- when others then
    -- dbms_output.put_line(sqlerrm);
    -- dbms_output.put_line(sqlcode);
    end;
    above code gives error as
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error
    ORA-06512: at line 13
    it seems string appending has problem. pls suggest a work around.
    regards

    thanks,
    yes it should have been. c%notfound
    declare
    x varchar2(4000);
    y varchar2(100);
    cursor c is select ename||'----'||empno||chr(10) from emp;
    begin
    open c;
    loop
    fetch c into y ;
    exit when c%notfound;
    if c%rowcount = 1 then
    x:=y;
    else
    x:=x||y;
    end if;
    end loop;
    close c;
    dbms_output.put_line(x);
    --exception
    -- when others then
    -- dbms_output.put_line(sqlerrm);
    -- dbms_output.put_line(sqlcode);
    end;
    Now the error i find is
    ERROR at line 1:
    ORA-20000: ORU-10028: line length overflow, limit of 255 chars per line
    ORA-06512: at "SYS.DBMS_OUTPUT", line 35
    ORA-06512: at "SYS.DBMS_OUTPUT", line 133
    ORA-06512: at line 17
    what i am trying is :- to store multiple records in single variable as multiline not single line. that's why i am using chr(10) (new line). Now i am facing the above error.
    regards ravi

  • How to solve error  : ORA-6512 at APPS.EAM_WORKORDER_PKG

    In new EAM installation process, the next error occurs during the creations of new operations to WO and attachments of new activities, which have several operations.
    ERROR:ORA-06502: PL/SQL :numeric or value error: character string buffer too small
    ORA-06512: at ''APPS.EAM_WORKORDER_PKG'', line 1529
    ORA-06512: at ''APPS.EAM_WORKORDER_PKG'', line 1966
    The implementation is in 12.0.4 version.
    Some one know how to solve this issue en EAM EBS.
    Thanks.

    Thanks for your help,
    I have reviewed all information sent for you. The issue finally was solve with the action plan descibed in the next :
    WICDOL - Autocreate Final Assembly Orders Completing With Warning - "ORA-01400: cannot insert NULL into ("WIP"."WIP_OPERATIONS"."WSM_BONUS_QUANTITY") " [ID 734605.1]
    This particular issue afects the operations creation, assigment of activities with predefined operations and state change.

  • Datapump export fails with ora-39014 ora-39029 ora-31671 ora-24795 ora-6512

    Hi All,
    I am having this problem with data pump export job in my database.
    OS - Windows Server 2003 R2
    Oracle Version - 10.2.0.4.0
    Export Command - SYSTEM/********@testcp FULL=Y DUMPFILE=testcp_dp.dmp LOGFILE=expdp_testcp.log
    Error Messages:-
    ORA-39014: One or more workers have prematurely exited.
    ORA-39029: worker 1 with process name "DW01" prematurely terminated
    ORA-31671: Worker process DW01 had an unhandled exception.
    ORA-24795: Illegal ROLLBACK attempt made
    ORA-06512: at "SYS.KUPW$WORKER", line 1352
    ORA-24795: Illegal ROLLBACK attempt made
    ORA-06512: at "SYS.KUPW$WORKER", line 7073
    ORA-24795: Illegal ROLLBACK attempt made
    ORA-06512: at "SYS.KUPW$WORKER", line 2829
    ORA-24795: Illegal ROLLBACK attempt made
    ORA-24795: Illegal ROLLBACK attempt made
    ORA-06512: at "SYS.KUPW$WORKER", line 10915
    ORA-02354: error in exporting/importing data
    ORA-01891: Datetime/Interval internal error
    Job "SYSTEM"."SYS_EXPORT_FULL_12" stopped due to fatal error at 16:02:04
    ORA-39014: One or more workers have prematurely exited.
    I have been trying to resolve this issue from months, but have not got any solution yet.
    Please help me out.
    Thanks All in advance.

    Have you opened an SR with Support ? Issue seems to be
    >
    ORA-01891: Datetime/Interval internal error
    >
    which is an internal error that only Support can troubleshoot.
    Possibly a bug in 10.2.0.4
    Bug 6211421 - ORA-1891 from addition / subtraction of TIMESTAMP data [ID 6211421.8]
    HTH
    Srini

  • Need help in resolving ORA-06502: PL/SQL: related to WF objects

    Hi,
    We are getting the following error "Oracle error -6502: ORA-06502: PL/SQL: numeric or value error: character string buffer too small has been detected in FND_USER_RESP_GROUPS_API.UPDATE_ASSIGNMENT" when we add a new user or make changes to the existing user or anything associated with Workflow process. We have an SR open for over a week, but no resolution yet...!
    We ran autoconfig few times, complied Invalid objects etc ...but no luck!
    This is ERP 11.5.10.2 on Red Hat Linux 4.0 on a 2-node RAC cluster and 2-node Apps Cluster (PCP) ---; thanks in advance..!
    Subroto

    Did this work successfully before ? If so, what has changed ? Can this error be reproduced consistently on all instances ? Can you pl provide the navigation path to reproduce the error ?
    Are you using the Internal Controls Manager module ? If so, MOS Doc 456950.1 (Preventive Segregation of Duties Constraints On Users Form Fails With Ora-6512, Ora-4088) may help.
    HTH
    Srini

  • DBMS_LDAP call fails with ORA-06512 Error Mapping function

    Hi,
    I am facing a problem with workflow integration with LDAP.
    I receive
    ORA-6512 Error Mapping Function on one particular line within the WF_LDAP.get_cfg_val procedure.
    WHILE my_entry IS NOT NULL
    LOOP
    my_vals := DBMS_LDAP.get_values (p_session,
    my_entry,
    p_name);
    The documentation says:
    ORA-06521 PL/SQL: Error mapping function
    Cause: An error was detected by PL/SQL trying to map the mentioned
    function dynamically.
    Action: Check the stacked error (if any) for more details.
    This is the trace of the error:
    ORA-06521 PL/SQL Error mapping Function
    ORA-06512 at SYS.DBMS_LDAP_API_FFI line 0
    ORA-06512 at SYS.DBMS_LDAP line 1332
    ORA-06512 at SYS.DBMS_LDAP line 1302
    ORA-06512 at SYS.DBMS_LDAP line 582
    This is the header of the catldap.sql file
    Rem
    Rem $Header: catldap.sql 07-jan-2000.19:15:20 akolli Exp $
    Rem
    Rem catldap.sql
    Rem
    Rem $Header: dbmsldap.sql 14-dec-2001.23:25:22 rbollu Exp $
    Rem
    Rem dbmsldap.sql
    Rem
    This is the output while running it (No errors):
    Library created.
    Package created.
    Package created.
    Package created.
    Package body created.
    Package body created.
    Package body created.
    Synonym created.
    Grant succeeded.
    Synonym created.
    Grant succeeded.
    Database is :
    compatible 9.2.0.0.0
    Am I missing something?
    I have searched all the forums and although there are many references to "Error Mapping Function", noone has reported it in the context of WF - LDAP Integration. So I am not sure how to proceed.
    Please help.
    thanks in advance,
    Libin

    Hi Libin,
    Can you please explain to me the parameters that you put in the Global Preferences, the LDAP_port,LDAP_user,and the others, because I don�t know where I need to search in the server this parameters and I don�t understand su much of OID.
    if you can give to me and little description of that parameters,this would thank for much.
    anticipated thanks
    Arlet

  • Geting ORA 936 -while building dynamic query in for loop.

    HI,
    I hav written a SP and its compiled and giving me the results for the data I am quering but giving ORA936 - missing expressin and giving ORA 6512 at 2 lines. Please help me me out where I am going wrong.
    CREATE OR REPLACE TYPE LIST as VARRAY(5000) of NUMBER;
    CREATE OR REPLACE PROCEDURE test( V_id IN LIST,
    v-fdate IN DATE,
    v-tdate IN DATE,
    v_flg IN CHAR)
    AS
    TYPE opfld IS RECORD (
    FID TAB.ID%TYPE,
    FCURR TAB.CURR %TYPE,
    FCNT TAB.CNT%TYPE,
    FTOT TAB.TOT%TYPE );
    TYPE OPLIST IS REF CURSOR;
    Rc oplist;
    Edtab opfld;
    Selstr VACHAR2(200);
    Whstr1 VACHAR2(200);
    Whstr2 VACHAR2(200);
    Whstr3 VACHAR2(200);
    Whstr VACHAR2(200);
    Grpstr VACHAR2(200);
    Andstr VACHAR2(200);
    Fullstr VACHAR2(200);
    BEGIN
    Selstr := ‘SELECT col1,col2,sum(col3),sum(col4) from tab1 ’;
    Whstr1 := ‘ WHERE tdate BETWEEN TO_DATE(‘||’’’’||vfdate||’’’’||’)’;
    Whstr2: = ‘ AND TO_DATE(‘||’’’’||vtdate||’’’’||’)’;
    Whstr := whstr1||whstr2;
    Grpstr := ‘GROUP BY col1,col2’;
    IF v_flg IS NOT NULL THEN
    Whstr3 := whstr||’AND FLAG = ‘||v_flg;
    else
    Whstr3 := whstr ;
    END IF;
    FOR I IN 1..id.COUNT LOOP
    BEGIN
    Andstr := ‘ AND id =’|| v_id(i);
    Whstr := whstr3 || andstr ;
    Fullstr := selstr||whstr||grpstr;
    OPEN rc for fullstr;
    LOOP
    FETCH rc into edtab
    EXIT when rc%NOTFOUND;
    END LOOP;
    Andstr := ‘’;
    Whstr :=’’;
    END; ---BEGIN of FOR loop
    END LOOP; -- for end
    CLOSE rc;
    END; -- proc end
    Created above SP and its compiled. When I try to execute the SP with below code I am getting--
    DECLARE
    V_t LIST;
    BEGIN
    V_t:= LIST();
    V_t.EXTEND(10);
    V_t(1) := 10;
    V_t(2) := 20;
    Test(v_t,’25-APR-2012’,’30-APR-2012’,’Y’);
    END;
    The SP is building correct dynamic querry and its getting executed for id = 10 and 20, giving the correct results but though I defined only 2 ids while executing and written FOR lOOP upto ID.COUNT its building query for third time and that time its not getting id, so for the third time the last part of where clause is built like
    SELECT.....
    WHERE....
    AND id = (its taking blank here)
    GROUP BY ...;
    and thus its giving me ORA 936 missing expression and ORA 06152 at line of RECORD TYPE declaration and line of OPEN rc for fullstr;
    ERROR at line 1
    ORA 00936 misssing expresiion
    ORA 006152 at line 9
    ORA 006512 at line 87
    I hav put DBMS_OUTPUT statements @ every build of dynamic wuery and its correct. here I have not copid the code I hav typed hereso not wriiten DBMS_OUTPUT.
    I tried lot of ways redefining Andstr := ‘’;
    Whstr :=’’; after for endloop but its giving the same error. is this because I am using varray? If am providing 2 ids in anonymous block then how its building query for third blank ID value.
    Please help me out here..
    Thanks a lot..

    >
    I hav written a SP and its compiled and giving me the results for the data I am quering
    >
    Then you should have posted the one that compiles and gives you results.
    The code you posted will not compile without errors. Edit your original post and provide the corrected code.
    When you do please add \ tags on the line before and after the code to preserve formatting. See the FAQ for details.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Urgent help needed ora-19206

    HI All
    getting the following error on full db export 9.2.0.8.0
    ORA-19206: Invalid value for query or REF CURSOR parameter
    ORA-6512: at "SYS.DBMS_XMLGEN", line 83
    ORA-6512: at "SYS.DBMS_METADATA", line 345
    ORA-6512: at "SYS.DBMS_METADATA", line 410
    ORA-6512: at "SYS.DBMS_METADATA", line 449
    ORA-6512: at "SYS.DBMS_METADATA", line 615
    ORA-6512: at "SYS.DBMS_METADATA", line 1221
    ORA-6512: at line 1
    i have read metalink note Note:206313.1 and ran catmeta.sql
    but still getting same errors
    we have first ran initjvm.sql
    then created XDB user
    ran catqm xdb xdb temp
    this is urgent
    thank
    kedar

    Urgent help required on the 31st of December on the forum based on volunteers... out of luck.
    Since you have access to metalink, maybe better for you to raise a SR in high priority.
    You could at least tell us about OS, export command used.
    Nicolas.

  • How to delete a project in Oracle apps R12

    Hi
    OS RHEL 5.5
    Database 11.1.0.7
    Applications R12
    Initially I have created a project in oracle apps from wrong template and modified the template then created a project with the same modified template.
    Now the wrong project needs to be deleted so how to delete the project which had been created from wrong template in oracle apps R12 and integrated project with MSP.
    Both the wrong and correct projects are referring to the same template.
    Please help me to delete the project as it is done in production database.
    Rgrd
    Edited by: 955685 on Feb 4, 2013 8:10 AM

    955685 wrote:
    Hi
    OS RHEL 5.5
    Database 11.1.0.7
    Applications R12
    Initially I have created a project in oracle apps from wrong template and modified the template then created a project with the same modified template.
    Now the wrong project needs to be deleted so how to delete the project which had been created from wrong template in oracle apps R12 and integrated project with MSP.
    Both the wrong and correct projects are referring to the same template.
    Please help me to delete the project as it is done in production database.
    Rgrd
    Edited by: 955685 on Feb 4, 2013 8:10 AMPlease see these docs/links.
    Delete Project Functionality not Working [ID 1060648.1]
    PRC: Delete Project Performance Reporting Data Completes With Error ORA-12838 ORA-6512 [ID 748674.1]
    How Can the PA Period Type Be Changed if It Has Been Entered Incorrectly? [ID 881424.1]
    PAXPREPR Unable To Delete Project [ID 874642.1]
    http://www.oracle.com/pls/ebs121/search?word=Delete+AND+Project&format=ranked&remark=quick_search
    Thanks,
    Hussein

Maybe you are looking for

  • Latest update creates some issues

    I just got the new update and now I notice a couple new features which is causing both the 4G and wireless indicators to be on at once.  Why am I using both services at once? Is there a fix?

  • Reset e3000 now can't connect to internet

    i was having issues with one of my devices after a power outage.  all my other devices worked (laptops, xbox, iphones, etc) i thought doing a reset on the router would get the odd device working again but all it did was mess up my internet.  i don't

  • Airport connect upon startup

    I have a Belkin FSD7010 wireless card in the PC slot. It is recognized as an airport extreme card. Running Tiger 10.4 TiBook 1 GHz, Airport Express wireless Everything works great except - whether I set the TiBook to join a preferred network, or auto

  • RMAN backup shell script

    Hi, I am trying to setup incremental backup shell script to run anutomatic every night. I am getting below errors when I run script. What am I missing here? oradev]/home/oradev ./RMAN_DEV_incr1.sh RMAN> exit ./RMAN_DEV_incr1.sh[13]: CONFIGURE: not fo

  • Hi. Can anyone tell me how to update my ipod touch software from 4.2 to ios 5.0.

    I want to install IPlayer, but when I do it as for an updated version.  I have run all of the updates in I Tunes and taken Ipod back to factory settings to see if that works, but it doesn't. Is anyone able to tell me if it is possible or not? Thanks