PL/SQL Functions becoming 'invalid'

We have created a set of functions which are used by
applications and triggers within our system. Everything ran over
the weekend and all triggers were operating and functions were
performing as expected. Yesterday the it was noticed that one of
the functions had become 'Invalid' which stopped the processing
of the system. The function is invoked by a trigger on insert
into a table.
Does anyone know what would cause a function to go 'Invalid'
like this?
Thanks
Jeff M.

Hi,
If you alter or modify the objects(DDL Operations), then the
procedures, functions, views..etc will be invalid. And also it
applies recursively,i.e,if these procedures and functions are
referred in some other procedure and functions, they also will
become invalid. So before applying a DDL operation on any object
better find the it's references from DBA_dependencies and
recompile them after the DDL operation.
Regards,
G. Rajakumar.

Similar Messages

  • Pl/sql function replying invalid number error

    Hi,
    I don't know if it's the late hour or I'm just missing something...
    I wrote a very simple function which is compiling, but returning ORA error 017222 - nvalid number, every time it's executed...
    Please let me know what am I missing...
    Thanks!
    create or replace
    FUNCTION GAMES(
    MINUTE_PLAYED IN NUMBER,
    HOME_GOALS IN NUMBER,
    AWAY_GOALS IN NUMBER)
    RETURN NUMBER IS
    HOME VARCHAR2(100);
    AWAY VARCHAR2(100);
    RELEVANT_GAMES NUMBER;
    BEGIN
    HOME := 'MIN' || MINUTE_PLAYED || 'HOME';
    AWAY := 'MIN' || MINUTE_PLAYED || 'AWAY';
    SELECT COUNT(*) INTO RELEVANT_GAMES
    FROM FINISHED_GAMES
    WHERE HOME = HOME_GOALS AND AWAY = AWAY_GOALS;
    RETURN RELEVANT_GAMES;
    EXCEPTION
    WHEN OTHERS THEN
    raise_application_error(-20001,'An error was encountered - '||SQLCODE||' -ERROR- '||SQLERRM);
    END GAMES;

    869206 wrote:
    Hi,
    I don't know if it's the late hour or I'm just missing something...
    I wrote a very simple function which is compiling, but returning ORA error 017222 - nvalid number, every time it's executed...
    Please let me know what am I missing...
    Thanks!
    create or replace
    FUNCTION GAMES(
    MINUTE_PLAYED IN NUMBER,
    HOME_GOALS IN NUMBER,
    AWAY_GOALS IN NUMBER)
    RETURN NUMBER IS
    HOME VARCHAR2(100);
    AWAY VARCHAR2(100);
    RELEVANT_GAMES NUMBER;
    BEGIN
    HOME := 'MIN' || MINUTE_PLAYED || 'HOME';
    AWAY := 'MIN' || MINUTE_PLAYED || 'AWAY';
    SELECT COUNT(*) INTO RELEVANT_GAMES
    FROM FINISHED_GAMES
    WHERE HOME = HOME_GOALS AND AWAY = AWAY_GOALS;
    RETURN RELEVANT_GAMES;
    EXCEPTION
    WHEN OTHERS THEN
    raise_application_error(-20001,'An error was encountered - '||SQLCODE||' -ERROR- '||SQLERRM);
    END GAMES;eliminate EXCEPTION handler!
    do NOT rely on implicit datatype conversion
    use TO_CHAR or TO_NUMBER as needed.
    HOME & HOME_GOALS are different datatype

  • PL/SQL packages containing DB Links suddenly becomes invalid

    Hi all --
    I was wondering in anyone has come accross the issue my data warehouse team has been experiencing with PL/SQL packages utilizing DB Links. We currently use db links to load some of the data from our transactional databases into the data warehouse tables. The packages once compiled remain valid for a short period of time and then suddenly become invalid. When attempting to recompile the package we receive ORA-00904 errors even though running the statement through SQL Plus works fine. We've tried dropping the database link and re-creating it, but the package still will not recompile. The only way to correct the issue is to shutdown and restart the database. The db links in question are from a 10G Release 2 database to a 8.1.7.4 database. Any insight would be helpful.

    We often had similar issues over dblinks between two 8.1.7.2 databases. The result was ORA 600 errors which could only be corrected by shutdown/re-start. Our DBAs eventually came up with flushing the shared pool, instead of the shutdown/re-start.
    ALTER SYSTEM FLUSH SHARED_POOL;

  • Problem: Objects become invalid so easily

    Hi All,
    We are running Oracle 9i Standard Edition, which was downgraded from the Enterprise Edition, because they want to save $50K/year.
    I have noticed even in the enterprise edition that some objects (sprocs, functions, triggers, packages) could become invalid for no reason (no schema changes and no changes in some sprocs/functions called by some others). I have googled this problem and found a few tips on the the internet and at least one seasoned DBA said Oracle objects can become invalid for no obvious reasons. After the downgrade, things got worse. The DBA runs a script to compile all packages, sprocs, functions, triggers once every hour. Then things got even worse. But I think the DBA script did not run more than once in a row to resolve some dependency issues. So now the DBA runs his script every two minutes. The problem is gone, but is there any better way to do this? Or should it happen in the first place? I figure that if Oracle runs like this, it should be out of business soon, because the MS SQL guys say they never have to explicitly re-compile invalid obejcts. At first the DBA thought that when PowerBuilder calls the sprocs, the sprocs do not re-compile because Sybase does not know how to program against Oracle. Then one day I was using SQL*Plus to run the sprocs and got the explicit error message for invalid objects and then the DBA was convinced otherwise.
    Thanks.
    Ben

    Thanks a lot. Yes you are right. The re-complie did cause other objects to be invalid. that's why I asked to dba to run his script more than once in a row. Now the problem seems to be gone. But here is what I found at http://www.dbazine.com/oracle/or-articles/hordila2. It is true when a package or sproc becomes invalid, they often times do not auto re-compile. See his comments on that.
    Application Malfunctions and Data InconsistenciesPart of maintaining quick response times for the database is making sure that as many objects as possible have a valid status. At least frequently used objects should not be invalid. Some objects (views, triggers, procedures, functions, packages, package bodies) can become invalid under certain circumstances: after massive data loads, imports, batches, even without explicit schema changes, after schema restructuring (drop, re-name, alter of objects). Very often, developers leave behind on purpose lots of invalid objects, to serve as a library of source code for future needs, or as a source code backup for the production objects. Some of these events are thought of as normal, or maybe bad style, while others are treated as bugs.
    Anyway, if this happens, applications may stop working at all or may start working slower, incorrectly or incompletely. Mal-functioning triggers calling invalid procedures, etc., for example, can lead to data inconsistencies, missed data propagation, etc. In a complex system, this is a serious situation and may go undetected for some length of time.
    Failed RecompilingFor some objects (views, triggers), the Oracle system may attempt automatically to recompile and validate them at the first run. This will slow the first runs of the application, but the system will function correctly, and be faster on the next runs. For stored programs, most of the time, this auto-recompile does not happen. The DBA needs to detect and recompile them as soon as possible.
    Some objects need to be re-developed/edited for references to be successfully recompiled and to become valid again. And other objects may
    Ben

  • Objects using dblinks become invalid

    I am using numerous functions / procedures / synonyms which point to other databases via dblinks. All was well when the dbLinks / synonyms were public. Last week I was asked to put up a test schema on the same database so I duly made all the public dblinks & synonyms private. All seemed well, everything compiled so I made it live.
    Now we get intermittent problems whereby the procedures using the synonyms & dblinks suddenly become invalid. They refuse to automatically compile, causing errors in the applications using the database. SOmetimes they automatically recompile after a time, sometimes they refuse to compile until I do them manually in SQL developer.
    anybody have any idea why this should be happening?
    Main database is Oracle Enterprise 11.1.0.7 64 bit, connecting to one of same version, one of 10.2.0.4 64 bit. All running on AIX 6.1.

    Hi,
    Same thing is happening here.
    DB A with PROC_SP (Strore procedure)
    DB B with 2 users; user TEST1 referencing PROC_SP@A and user TEST2 referencing also PROC_SP@A.
    When compiling code on user TEST1 that uses PROC_SP@A, the code on TEST2 becames invalid, and vice-versa.
    Did you solve your problem ?
    My Database version is 11.2.0.2.0, both DB (A and B) use the same version (Exadata with 11R2)
    Thanks in advance.

  • Passing Multiple Values from a worksheet to PL/SQL function.

    Hi All,
    Is there any way to pass multiple values selected in a worksheet to a PL/SQL function ?
    I will try to explain the scenario:
    We have a crosstab report that showing all the customer details, deposit sum of a customer in each date in a date range selected. With the customer details we are showing the Rank of a customer based on the deposit in the latest date selected. Filtering is based on the rank, ie Top50 or Top60 etc.( As I said rank is calculating based on the deposit in the latest date).This is working fine.
    Now the new requirement is to : For example, in Top50 report, list all the customers, who were in the Top50 list, in any of the dates selected. We are able to display the daywise rank, but when giving a condition like daywiserank <= 50, the result becomes uncertain. Some blank lines, wrong amounts etc..
    As a work around we tried to find out the rank in a PL/SQL function. But the issue there is : we have some multiple value parameters used in the worksheet.
    Is there any way to pass multiple values selected in a worksheet to a PL/SQL function ?
    Or any other work arounds for the scenario explained?
    Reagrds,
    Jeneesh

    Hi Russ,
    Thanks for the response.
    Russ Proudman wrote:
    1. I thought there was an analytical function similar to rank - or maybe an option of rank - that if there are duplicate records to have them all considered the same rank. So if you had 3 records all the same as rank=2 then a condition saying where rank=2 would return the 3 records. You could check into this.
    We are already using DENSE_RANK. But the issue is the output contains incorrect null values nd repeated rows.
    We got it solved as I explained in the previous post. But will that AGGREGATION MODE setting ( Which discoverer says - not recommended) have any issue? I mean side effects?
    Russ Proudman wrote:
    2. Another thought is that you can create a PL/SQL routine - that's called from a SQL function registered in Discoverer - where a table is created that does the first part of your query. Then a worksheet is created to use the data from that table. So, in essence, the table would have your top50 ranked customers. Then you can write any kind of worksheet against that table. However, DBAs are loath to allow tables - that they didn't create! - many times in a PROD environment.
    Here also the same problem will occur: as the top 50 will depend upon the parameters. I cannot pass those parameters to PL/SQL Function.And storing the top50 ( itmay be top100 or to 150 also) for all combinations of the parameters is impossible
    Russ Proudman wrote:
    3. Finally, are you sure you're rank function is correct in that if you're getting blank lines, maybe the 'over' part is not considering all columns needed to determine the rank?
    Yes the query we are using is correct. The output QUERY of discoverer gives correct results in Sqlplus.
    Regards,
    Jeneesh

  • When do VI and queue references become invalid?

    Hi all,
    I have a fairly complicated problem, so please bear with me.
    1)  I have a reentrant SubVI (let's call it VI "Assign") that has an input cluster of (VI ref, queue ref) (let's call the cluster type "Refs").  If the VI ref is invalid (first execution), the VI ref and queue ref are assigned values and are passed on as an output cluster of same type.  (The VI does other things too, but for simplicity only this is important.)
    2)  The VI that calls VI "Assign" (let's call it VI "Store") is not reentrant and has a local variable of type "Refs" that is wired to the input and output of VI "Assign".  This VI effectively stores the references.  The references returned by VI "Assign" are always valid right after the call, but after the problem condition described below, they are invalid at the start of all calls before they are passed to VI "Assign".
    3)  VI "Store" is called by multiple non-reentrant VIs, so the local variables of VI "Assign" retain their values (Has been tested and verified to retain their values).  The VI causing the problem in this case is a template VI of which multiple copies are launched (let's call it VI "Template").
    The problem is that the moment an instance of VI "Template" is closed, the queue reference becomes invalid, although the actual variant value of the reference remains the same.  The VI ref can become invalid or not, depending on small changes, but is always reproducible.  I assume there must be some similarity between VI and queue refs.  After spending some time researching, the Labview help states for the Open VI Ref component "If you do not close this reference, it closes automatically after the top-level VI associated with this function executes."  In this case I assumed it means that the moment the reentrant VI "Assign" finishes, the references will get cleared ??  So I made a non-reentrant VI (let's call it VI "NR Assign") that only assigns values to the references and VI "Assign" now calls this VI (It effectively does what I described VI "Assign" does).  I keep this VI alive by using it in a VI which never terminates and since it never terminates, the references should never become invalid.  Anyone still following?  This didn't solve the problem though.  If I reproduce the same scenario using only one instance of the template VI, it works just fine.  Furthermore, the VI and queue references are never closed, to aid analysis of the problem.  Can anyone shine some light on what happens when a template VI terminates?  Could this be the problem?
    Unfortunately I cannot include the code.
    Thank you whoever is able to make sense of this.
    Christie

    Christie wrote:
    Hi all,
    I have a fairly complicated problem, so please bear with me.
    1)  I have a reentrant SubVI (let's call it VI "Assign") that has an input cluster of (VI ref, queue ref) (let's call the cluster type "Refs").  If the VI ref is invalid (first execution), the VI ref and queue ref are assigned values and are passed on as an output cluster of same type.  (The VI does other things too, but for simplicity only this is important.)
    2)  The VI that calls VI "Assign" (let's call it VI "Store") is not reentrant and has a local variable of type "Refs" that is wired to the input and output of VI "Assign".  This VI effectively stores the references.  The references returned by VI "Assign" are always valid right after the call, but after the problem condition described below, they are invalid at the start of all calls before they are passed to VI "Assign".
    3)  VI "Store" is called by multiple non-reentrant VIs, so the local variables of VI "Assign" retain their values (Has been tested and verified to retain their values).  The VI causing the problem in this case is a template VI of which multiple copies are launched (let's call it VI "Template").
    The problem is that the moment an instance of VI "Template" is closed, the queue reference becomes invalid, although the actual variant value of the reference remains the same.  The VI ref can become invalid or not, depending on small changes, but is always reproducible.  I assume there must be some similarity between VI and queue refs.  After spending some time researching, the Labview help states for the Open VI Ref component "If you do not close this reference, it closes automatically after the top-level VI associated with this function executes."  In this case I assumed it means that the moment the reentrant VI "Assign" finishes, the references will get cleared ??  So I made a non-reentrant VI (let's call it VI "NR Assign") that only assigns values to the references and VI "Assign" now calls this VI (It effectively does what I described VI "Assign" does).  I keep this VI alive by using it in a VI which never terminates and since it never terminates, the references should never become invalid.  Anyone still following?  This didn't solve the problem though.  If I reproduce the same scenario using only one instance of the template VI, it works just fine.  Furthermore, the VI and queue references are never closed, to aid analysis of the problem.  Can anyone shine some light on what happens when a template VI terminates?  Could this be the problem?
    Unfortunately I cannot include the code.
    Thank you whoever is able to make sense of this.
    Christie
    All LabVIEW refnums do get deallocated automatically when the top-level VI in whose hierarchy the refnum was created goes idle (stops executing). You will have to make sure that the creation of a refnum is done inside a VI hierarchy that stays running for the entire time you want to use that refnum.
    Rolf Kalbermatter
    Message Edited by rolfk on 06-27-2007 11:52 AM
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • PL/SQL Function to check user name and password

    Hi,
    I am new to PL/SQL. I have a table that stores user name and password. I want to write a PL/SQL function that checks if the entered user name and password is correct, by validation against the values in the table... Can someone help me with the code? Both user name and password is varchar2

    First of all, I believe you mean a procedure that would check the application username and password. Fot, if you mean a PL/SQL procedure, that runs in the database, and that means it has to be executed after the client application is connected to the database.
    Maybe you need a procedure like this:
    procedure check_pass(p_user varchar2, p_pass varchar2) is
    pragma autonomous_transaction;
    v_passwd varchar2(200);
    begin
    select passwd into v_passwd
    from password_table
    where user_name=p_user;
    if v_passwd!=p_pass then
    update password_table set
    last_unsucc_logon=sysdate
    ,unsucc_logon_n=nvl(unsucc_logon_n,0)+1
    where user_name=p_user;
    commit;
    raise_application_error(-20101,'Invalid username/password!');
    end if;
    exception
    when no_data_found then
    raise_application_error(-20101,'Invalid username/password!');
    end;
    Study this piece of code and see if this will do.

  • Calling PL/SQL functions in SQL

    Hi,
    I had a question on the behaviour of PL/SQL function when they are embedded in SQL queries.
    I have simple PL/SQl function:
    function get_city_id
    (vCUSTOMER_GROUP_ID IN NUMBER)
    RETURN VARCHAR2 AS
    vIDs VARCHAR2(1000);
    begin
    vIDs := '2,3';
    RETURN vIDs;
    end;
    I use an SQL query call this PL SQL function;
    select equipment_id from equipment where equipment_type_id in (get_city_id(0));
    When I run this query I get this error:
    ERROR at line 1:
    ORA-01722: invalid number
    I understand that the SQL compiler is complaining that get_city_id() function is not returning a number. but isn't the PL/SQL suppose to be replace with whatever string is returned from the function.
    This brings me to the second question: How can we return multiple values from a function to the SQL query, when the function is called in a SQL query. In my above explame, can the get_city_id() function return more than one city id and if yes, the how?
    Thanks for the help in advance
    regards
    Alankar

    How can we return multiple values from a function to the SQL query,Have it return a collection, e.g.
    CREATE OR REPLACE TYPE VARCHAR2_TT AS TABLE OF VARCHAR2(4000)
    CREATE OR REPLACE FUNCTION test_collection
        RETURN VARCHAR2_TT
    AS
    BEGIN
        RETURN VARCHAR2_TT(1,2,3);
    END;
    SELECT *
    FROM   employees
    WHERE  emp_id IN
           ( SELECT column_value
             FROM   TABLE(test_collection) );

  • Calling pl/sql function in controller

    HI all
    i have a problem in calling a pl/sql function in a controller..
    the question is can we call a pl/sql function in a controller if so
    will the code below works???
    String invoice_id=getInvoiceId().toString();
    Number Invoice_amount=getAmount();
    DBTransaction txn = getDBTransaction();
    String Filesql="BEGIN SELECT sum(AMOUNT_REMAINING) into :1 FROM ap_payment_schedules_all where invoice_id=:2;END;";
    OracleCallableStatement Filecs=(OracleCallableStatement)txn.createCallableStatement(Filesql,1);
    String AmountRemaining = "";
    try{
    Filecs.registerOutParameter(1, OracleTypes.VARCHAR, 0, 100);
    Filecs.setString(2,invoice_id);
    Filecs.execute();
    AmountRemaining=Filecs.getString(1);
    Filecs.close();
    catch(SQLException sqle){
    try { Filecs.close(); } catch (Exception e) {;}
    throw OAException.wrapperException(sqle);
    when i write the above code in a controller ..it is saying getDBTransaction not defined....
    can u help me out in this...

    String RuleName=pageContext.getParameter("CashRule");
    String OrgId=pageContext.getParameter("OrgId");
    String TransType=pageContext.getParameter("TransactionType");
    OAApplicationModule am = (OAApplicationModule)pageContext.getApplicationModule(webBean);
    OADBTransaction txn = am.getOADBTransaction();
    String Filesql="BEGIN select cle_f246_return_anal_mod_pkg.ret_anal_module(:2,:3,:4) into :1 from dual;END;";
    OracleCallableStatement Filecs=(OracleCallableStatement)txn.createCallableStatement(Filesql,1);
    String AnalyticalModule = "";
    try{
    Filecs.registerOutParameter(1, OracleTypes.VARCHAR, 0, 100);
    Filecs.setString(2,TransType);
    Filecs.setString(3,RuleName);
    Filecs.setString(4,OrgId);
    Filecs.execute();
    AnalyticalModule=Filecs.getString(1);
    Filecs.close();
    catch(SQLException sqle){
    try { Filecs.close(); } catch (Exception e) {;}
    throw OAException.wrapperException(sqle);
    this is the code i wrote in controller processformRequest...all the parameters are showiing correct values...but i am getting following error at Filecs.close();
    org_id is of type Number but i am passing that as a string as setString accepts only strings...will that cause ne problem???
    the error is:
    oracle.apps.fnd.framework.OAException: java.sql.SQLException: ORA-01722: invalid number ORA-06512: at line 1 at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:896) at oracle.apps.cle.f246.webui.CashReportDetailsCO.processFormRequest(CashReportDetailsCO.java:88) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:813) at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:382) at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:1178) at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1579) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1025) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:991) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:846) at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:382) at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:395) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1025) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:991) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:846) at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:382) at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:363) at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2840) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1834) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:532) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:420) at OA.jspService(_OA.java:75) at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59) at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:453) at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:591) at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:515) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:711) at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:368) at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:866) at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:448) at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:216) at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:117) at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:110) at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260) at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239) at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34) at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880) at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303) at java.lang.Thread.run(Thread.java:595) ## Detail 0 ## java.sql.SQLException: ORA-01722: invalid number ORA-06512: at line 1 at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288) at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743) at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:215) at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:967) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1168) at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3327) at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3433) at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4394) at oracle.apps.cle.f246.webui.CashReportDetailsCO.processFormRequest(CashReportDetailsCO.java:82) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:813) at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:382) at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:1178) at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1579) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1025) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:991) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:846) at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:382) at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:395) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1025) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:991) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:846) at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:382) at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:363) at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2840) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1834) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:532) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:420) at OA.jspService(_OA.java:75) at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59) at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:453) at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:591) at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:515) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:711) at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:368) at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:866) at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:448) at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:216) at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:117) at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:110) at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260) at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239) at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34) at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880) at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303) at java.lang.Thread.run(Thread.java:595) java.sql.SQLException: ORA-01722: invalid number ORA-06512: at line 1 at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288) at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743) at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:215) at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:967) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1168) at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3327) at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3433) at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4394) at oracle.apps.cle.f246.webui.CashReportDetailsCO.processFormRequest(CashReportDetailsCO.java:82) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:813) at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:382) at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:1178) at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1579) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1025) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:991) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:846) at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:382) at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:395) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1025) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:991) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:846) at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:382) at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:363) at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2840) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1834) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:532) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:420) at OA.jspService(_OA.java:75) at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59) at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:453) at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:591) at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:515) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:711) at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:368) at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:866) at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:448) at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:216) at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:117) at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:110) at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260) at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239) at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34) at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880) at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303) at java.lang.Thread.run(Thread.java:595)

  • In Ref cursor, user defined functions give "invalid column" error in EJB.

    Hello,
    I have written PL/SQL stored procedures/functions in Oracle 8i. They return the result set as a ref cursor.
    These procedures are accessed by EJB (weblogic) using Type 4 (100% Java) JDBC Driver.
    My problem is - if I use a user defined function to fetch a value in the select statement of the reference cursor, the EJB gives an error msg - invalid column name.
    If instead of using the function I get the value directly from the table, it works fine. Refer the code below :
    //In the PL/SQL function -
    //instead of writing :
    Open rc for
    Select empcode, empname
    from emp ;
    //If I write :
    Open rc for
    Select empcode, mypack.getempname(empcode)
    from emp ;
    //getempname(empcode) is a function in
    //in a package named 'mypack'
    //and returns name for empcode.
    //The java code gives error
    //error : invalid column name
    //While both are working fine and
    //returning currect result in SQL Navigator.
    Help me solve this mystery ?
    Thanks in advance.
    Swati.
    null

    Hi:
    When use inline Function to simplify the SQL statements, there is one thing that one should conside--Purity Level.
    if you create standalone stored pl/sql function. Oracle implicitly determines the PURITY level during compilation of the stored objects or at execution of an anonymous pl/sql block.
    if you implement Package inline Function( in your case),unlike standalone stored pl/sql functions, the PL?SQL Engine does not determine the purity level of package functions. Therefore, you must explicity assign the correct purity levels for the function to be called inline.
    the code like:
    create or replace package mypack is
    function getempname(empcode emp%empid%type)
    return varchar2;
    PRAGMA RESTRICT_REFERENCES(getempname,WNDS,WNPS,RNPS);
    end mypack;
    I think it can solve your problem if you use enough "pure"to be called inline function. Or you can create the standalone function to do it.
    good luck!
    Yali
    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Swati Agrawal ([email protected]):
    Hello,
    I have written PL/SQL stored procedures/functions in Oracle 8i. They return the result set as a ref cursor.
    These procedures are accessed by EJB (weblogic) using Type 4 (100% Java) JDBC Driver.
    My problem is - if I use a user defined function to fetch a value in the select statement of the reference cursor, the EJB gives an error msg - invalid column name.
    If instead of using the function I get the value directly from the table, it works fine. Refer the code below :
    //In the PL/SQL function -
    //instead of writing :
    Open rc for
    Select empcode, empname
    from emp ;
    //If I write :
    Open rc for
    Select empcode, mypack.getempname(empcode)
    from emp ;
    //getempname(empcode) is a function in
    //in a package named 'mypack'
    //and returns name for empcode.
    //The java code gives error
    //error : invalid column name
    //While both are working fine and
    //returning currect result in SQL Navigator.
    Help me solve this mystery ?
    Thanks in advance.
    Swati.
    <HR></BLOCKQUOTE>
    null

  • Subquery not allowed - PL/SQL Function Body returning bolean

    Is subquery is not allowed in PL/SQL Expresion.????
    I am using the following query in one of my derived report column but I am getting the error.
    BEGIN
    if :COL1<>'abc' and :COL2 in (select deptno from dept1) then
    return 1;
    elsif :COL1<>'abc' and :COL2 in (select deptno from dept2) then
    return 0;
    elsif :COL1<>'abc' and :COL2 in (select deptno from dept3) then
    return 1;
    else
    return 0;
    end if;
    END;
    secondly CAN I use return value such as 'ABC' or 'XYZ' other than 0,1.
    Error-
    Invalid function body condition: ORA-06550: line 4, column 8: PLS-00405: subquery not allowed in this context ORA-06550: line 2, column 3: PL/SQL: Statement ignored
    -----------------

    Hi Deepak,
    There are at least methods.
    1 - You could create a SQL function that returned 0 or 1 and use that in your statement
    2 - You could use a CASE clause in the SQL statement
    As I don't have your dept1/2/3 tables, I've tried the following on the sample EMP/DEPT tables:
    SELECT EMPNO,
    ENAME,
    SAL,
    COMM,
    DEPTNO,
    CASE WHEN DEPTNO IN (SELECT DEPTNO FROM DEPT) THEN
      CASE WHEN ENAME LIKE '%A%' THEN NVL(SAL,0) + NVL(COMM,0) ELSE 456 END
    ELSE
       CASE WHEN DEPTNO NOT IN (SELECT DEPTNO FROM DEPT) THEN
         CASE WHEN ENAME LIKE '%A%' THEN NVL(SAL,0) + NVL(COMM,0) ELSE 123 END
       ELSE
         789
       END
    END "TOTAL"
    FROM EMPThis returns the values I expect:
    EMPNO     ENAME     SAL     COMM     DEPTNO     TOTAL
    7936     ATD     3000     -      40     3000
    7958     dino4     -      -      -      789
    7839     KINGS     5000     -      40     456
    7698     BLAKES     2850     -      30     2850
    7782     CLARK     2450     -      10     2450
    7566     JONES     2975     -      30     456
    7788     SCOTT     3000     -      20     456
    7902     FORD     3000     -      40     456
    7369     SMITH     800     -      20     456
    7499     ALLEN     1600     300     30     1900Obviously, you may have to experiment with the various CASE statements, but it will work using just a sql select statement.
    Andy

  • Sql query(PL/SQL function body return SQL query) with in(x,y,z) condition

    Hello,
    I've set up a region definition of type "SQL Query(PL/SQL function body return SQL query). In my query I make use of an "in" condition. When I populate :P755_INC_BARG_UNIT with a value of 0F (no quotes), I get the correct count. However, when I set :P755_INC_BARG_UNIT to 0F, 0E I get an invalid count. What do I have to set the page item to?
    When running the query in TOAD, and setting :P755_INC_BARG_UNIT to the string inside the brackets (0F, 0E) I get the proper count.
    The code I use is shown below. Any help would be appreciated,
    Alex.
    DECLARE
    v_sql VARCHAR2(32767);
    BEGIN
    SELECT count(*) "cnts",
    ''Faculty data file IDs missing in appt table'' "err_type"
    FROM hradmin.et_faculty_salary fs left outer join
    hradmin.appointments appt
    ON trim(fs.empl_id) = appt.emp_emp
    and appt.ear_activ <> ''Z''
    and appt.ear_type = ''F''
    and (appt.ear_class in (''A'',''B'',''C'',''D''))
    and appt.ear_bargunit in ( :P755_INC_BARG_UNIT )
    WHERE appt.emp_emp is null
    RETURN v_sql;
    END;

    Alex,
    try something like:
    DECLARE
    v_sql VARCHAR2(32767);
    BEGIN
    v_sql := <YOUR_SQL_STATEMENT_WITH_P755_INC_BARG_UNIT_IN_IT>;
    v_sql :=  REPLACE(v_sql, ':P755_INC_BARG_UNIT',:P755_INC_BARG_UNIT);
    RETURN v_sql;
    END; But before doing it read this:
    http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:210612357425
    After reading you will be able to find the best solution yourself.
    Lev

  • The troubles with creating SQL function in Java

    Hi!
    I use Oracle 10g and connect to it from Java application. I need in creating SQL functions from Java code.
    In Java I have:
    Statement stm = null; try{     stm = dbConnection.createStatement();     stm.executeUpdate( query ); }catch(SQLException ex){     throw ex; }finally{     try{ stm.close(); }catch(Exception ex){ stm.close(); } }
    And I'm passing the next SQL function:
    create or replace function get_me return number is
    result number;
    begin
    select 5 into result from dual;
    return result;
    end;
    This code is run successful, but I can't call this funtion, because it has status Invalid
    I'm looked the next error: PLS-00103: Encountered the symbol "" when expecting one of the following: . @ % ; is authid as cluster order using external character deterministic parallel_enable pipelined aggregate
    But I don't understand, What the matter? From Oracle Enterprise Manager I can create this function without problems. So, I wrote the wong Java code. Also, I can't find my error :(
    May be, do u have the some ideas?
    Thank you very much!

    Post the whole pl/sql code please.
    To run PL/SQL from within java you'll need callablestatement.
    [here |http://www.idevelopment.info/data/Programming/java/jdbc/PLSQL_and_JDBC/CallPLSQLFunc.java] an example : http://www.idevelopment.info/data/Programming/java/jdbc/PLSQL_and_JDBC/CallPLSQLFunc.java

  • Need to obtain updateable ResultSet via call to PL/SQL function

    I'm using JDBC and the Oracle JDBC driver to call a PL/SQL function that returns a SYS_REFCURSOR. I do this via a CallableStatement object and then cast the output parameter to a ResultSet object. However, I want this ResultSet object I end up with to be updateable. The following code throws an exception stating "Invalid operation for read only resultset: updateString ":
    cstmt2 = con.prepareCall("{? = call get_upload_entry_for_update(?)}",
                             ResultSet.TYPE_FORWARD_ONLY,
                             ResultSet.CONCUR_UPDATABLE);
    cstmt2.registerOutParameter(1, OracleTypes.CURSOR);
    cstmt2.setInt(2, newUploadId);
    cstmt2.execute();
    rs = (ResultSet) cstmt2.getObject(1);
    rs.next();
    rs.updateString("UPLOAD_FILENAME", fileName);
    // . . .So even though, I create the CallableStatement such that ResultSets should be updateable, it's not allowing me to do any updates. Also, in case you're wondering, inside the PL/SQL function, the query on which the cursor is based is a select statement which does specify "for update" at the end.
    I can get it to work as follows using a Statement object that executes the SELECT statement directly instead of a CallableStatement that executes a PL/SQL function:
    Statement stmt = con.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE);
    rs = stmt.executeQuery("select UPLOAD_FILENAME, UPLOAD_FILE from rf_upload where upload_id = "+newUploadId+" for update");
    rs.next();
    rs.updateString("UPLOAD_FILENAME", fileName);
    //. . . Although this works, the project I'm working has a goal to encapsulate all SQL into Functions and Stored Procedures so I'd like to get it working that way instead.
    So the bottom-line question is: Using the Oracle JDBC driver, how can I call a PL/SQL function in such a way that I can obtain an updateable ResultSet object?
    Thanks for any suggestions. I'd be happy to clarify anything that's unclear.

    Hmmm...
    I'm still scratching my head about this one, just not sure it's doable, but I'll point out something, maybe it will give you a clue...
    In your code, you have:
    cstmt2 = con.prepareCall("{? = call get_upload_entry_for_update(?)}",
                             ResultSet.TYPE_FORWARD_ONLY,
                             ResultSet.CONCUR_UPDATABLE);I don't think the ResultSet parameters do anything towards your goal of getting an updatable result set via the returned cursor, those parameters affect the result set produced if you were to call:
    ResultSet rs2 = cstmt2.executeQuery();and not the result set generated by:
    rs = (ResultSet) cstmt2.getObject(1);Futhermore, while the "FOR UPDATE" is almost certainly something you want to do, it also doesn't affect the cursor (I think) but merely locks the affected rows in the DB.
    You might try calling rs.getType() and rs.getConcurrency() on the ResultSet you get from getObject, though I suspect they'll merely confirm the bad news that the cursor your getting back isn't right...
    You also might try the Oracle-specific getCursor call:
    rs = ((OracleCallableStatement)cstmt2).getCursor (1)instead of getObject, though I don't think it will help...
    I've been curious enough to dig around through most of my handy references and Oracle's docs and MetaLink and come up mostly empty, although almost 5 years ago Oracle Support said:
    " Reference Cursors from a pl/sql stored procedure are not updateable in any language."

Maybe you are looking for

  • Can't Boot My Mac Pro

    Hi All I installed the latest set of apple updates on Monday night, and allow my computer to restart to finish the install. But now when it try's to restart, it makes the chime noise, the white screen appears followed 30 odd seconds later by the Appl

  • Query on adding custom fields of the BP Screen

    Hi Group, I have a requirement to add a couple of new fields to <b>BP</b> screen. I came to know that, <b>EEWB</b> is not a recommended way of doing this, as if some error occurs it is difficult to revert back. And also, <b>BDT tool</b> also cannot b

  • How to setup 2nd itunes librarary on same computer ?

    I have a ipod with itunes library already set up . my wife got a ipodnano & wants her seperate library. I am running windows 7

  • Loading images using Microsoft Paint

    Is there a way to make a servlet load an image using Microsoft Paint (on Windows) ? I have a huge image that does not fit in the browser window and the client would like to see it without scrolling. .. and prefers to have this opened in Microsoft Pai

  • Sap SD 4.7

    HI ALL, We are moving onto a SAP RETAIL system version 4.7, what must I check and make sure all is ok? What retail aspects must be checked? We are moving from R/3 4.6c to 4.7 retail, but i need to know whether we need to do all the retail bits and bo