Compiling stored procedure

Hi,I am facing problem in compilation of stored procedure.If i alter some table or column which is getting used by some stored procedure,i have to recomplie that stored procedure.
Also is there any way when i compile some stored procedure,it should not give error regardless it is calling another stored procedure which is not compiled.
Lets say i m compiling stored Procedure 'ABC' which is calling stored procedure 'DEF' and 'DEF' is not complied yet.So is there any way that 'ABC' get complied ithout errors regardless 'DEF' is compiled or not.

I don't think this is possible according to the way Oracle handles object dependencies.

Similar Messages

  • How to extract compiled stored procedure without line break for long statement

    After I compiled stored procedure which contains long statement, the statement would cut into 2 rows into dba_source.
    However, when I extract the codes from dba_source table, the source couldn't be compiled successfully because of
    the broken lines.
    For example, the following statement would be broken into 2 rows like this:
    (line 1) gv_Message := 'Interface Description: Interface with Training '|| 'and Development Intran
    (line 2) et (Evaluation Statistic Details)';

    That's very strange. What did you originally compile it with (sql*plus, toad, etc...)? I was able to compile a procedure with the maximum line length (2499 characters see error SP2-0027) and there is no split. Is the procedure in a VALID state with that line break? Honestly, this seems very odd, possibly even a bug here somewhere.
    Richard

  • Compile Stored Procedure using JDBC ?

    I am using JDBC thin driver and able to create stored procedure without any problem.
    But if the stored procedure is invalid, it
    won't throw SQLException during creation.
    Is there any way that I can compile the
    stored procedure and catch the semantic exception during creation ?
    Please help, thanks.
    null

    The only thing that springs to mind is the user_errors view. If the procedure fails to compile, then there will be rows in this view indicating the error ..... so maybe you could use
    select count(*) from user_errors
    and check from Java that 0 is returned.

  • Need to compile stored procedures from ODI

    Hi,
    I have a .sql file and it contains around 40 stored procedure (create or replace)...now my requirement is that I need to execute this .sql file from ODI so it can compile these 40 stored procedures...Please help.
    Thanks,
    Jigar

    Hi,
    you could create a package and execute an OS Command, which would import your scripts into the database.
    Either you create an script, which would be executed, or you write it direct in the command line.
    In Windows eg. cmd.exe /c echo exec dbms_output.put_line( 'Hello' ); | sqlplus user/pass@db01
    You would need your import command here of course.
    br
    fari

  • Comping stored procedure

    Hi,I am facing problem in compilation of stored procedure.If i alter some table or column which is getting used by some stored procedure,i have to recomplie that stored procedure.
    Also is there any way when i compile some stored procedure,it should not give error regardless it is calling another stored procedure which is not compiled.
    Lets say i m compiling stored Procedure 'ABC' which is calling stored procedure 'DEF' and 'DEF' is not complied yet.So is there any way that 'ABC' get complied ithout errors regardless 'DEF' is compiled or not.

    You might be able to use package procedure instead of procedure.
    But, why must you compile it when related objects are invalid?

  • Get Error on using Stored Procedure to use it in Crystal Reports XI

    Post Author: Krüger
    CA Forum: Integrated Solutions
    Hello, I need your help please. I use Oracle 10 and now write a correct compiled stored procedure: this procedure is really simple how you can see:set pagesize 50000set linesize 1000set wrap offset head offset feedback offset trimspool onset serveroutput onset verify offcreate or replace procedure GetFirmenNachMontag is  lutype varchar2(10);BEGINDECLAREbegin lutype:='Test';  dbms_output.put_line(lutype);END;END; In using in sql directly it is really all fine. But when I want to integrat it in a simple report in Crystal I get the error unknow databank connector error. I hope that somebody can help me please. With best regardsM.Krüger 

    If you are using MSSQL SERVER then try creating a stored procedure like this
    create proc Name
    select * from Table
    by executing this in sql query analyzer will create a stored procedure that returns all the data from Table
    here is the syntax to create SP
    Syntax
    CREATE PROC [ EDURE ] procedure_name [ ; number ]
        [ { @parameter data_type }
            [ VARYING ] [ = default ] [ OUTPUT ]
        ] [ ,...n ]
    [ WITH
        { RECOMPILE | ENCRYPTION | RECOMPILE , ENCRYPTION } ]
    [ FOR REPLICATION ]
    AS sql_statement [ ...n ]
    Now Create new report and create new connection to your database and select stored procedure and add it to the report that shows all the columns and you can place the required fields in the report and refresh the report.
    Regards,
    Raghavendra
    Edited by: Raghavendra Gadhamsetty on Jun 11, 2009 1:45 AM

  • Ora-04021 error while compiling a stored procedure

    Hi Gurus,
    I am getting a ora-04021 timeout error while trying to compile a stored procedure. My Oracle version is 9i on Unix.
    Thanks
    Amitava.

    amitavachatterjee1975 wrote:
    Hi Gurus,
    I am getting a ora-04021 timeout error while trying to compile a stored procedure. My Oracle version is 9i on Unix.
    Thanks
    Amitava.
    my car won't go.
    tell me how to make my car go.
    How do I ask a question on the forums?
    https://forums.oracle.com/forums/thread.jspa?threadID=2174552#9360002
    [oracle@localhost ~]$ oerr ora 4021
    04021, 00000, "timeout occurred while waiting to lock object %s%s%s%s%s"
    // *Cause:  While waiting to lock a library object, a timeout occurred.
    // *Action: Retry the operation later.
    [oracle@localhost ~]$

  • Error while compiling a stored procedure

    Hi Expertise,
    I want to have all table names with their column name and tried using below stored procedure and it is throwing some compiler error at "fetch TestCurr into temp2;"
    I am very new to Data base and writing stored procedure and not able to understand how to resolve it. Please anyone help me out to correct it and provide some better idea to achieve my requirement. This is very urgent. One more thing, I want all these data into a log file.
    create or replace
    procedure temp as
    begin
    DECLARE
    cursor C1 IS SELECT COLUMN_NAME FROM user_tab_columns;
    file_id UTL_FILE.FILE_TYPE;
    Temp1 all_tables.table_name%TYPE;
    temp2 user_tab_columns.COLUMN_NAME%TYPE;
    cursor TempCur is Select table_name from all_tables where owner='XSS_ADMIN' order by TABLE_NAME;
    begin
    open TempCur;
    loop
    fetch TempCur into Temp1;
    exit when TempCur%NOTFOUND;
    DBMS_OUTPUT.PUT_LINE(Temp1);
    declare cursor TestCurr is select COLUMN_NAME from user_tab_columns where table_name= Temp1;
    open TestCurr;
    loop
    fetch TestCurr into temp2;
    exit when TestCurr%NOTFOUND;
    DBMS_OUTPUT.PUT_LINE(Temp2);
    end loop ;
    close TestCurr;
    end loop;
    Thanks in advance
    R e h a n

    Hi,
    declare cursor TestCurr is select COLUMN_NAME from user_tab_columns where table_name= Temp1;
    open TestCurr;
    loop The Cursor Declarations Should be done in the declaration Section of the PLSQL Block.
    The General Structure of Cursor Declaration is:
    DECLARE
    CURSOR curr IS
    SELECT FROM WHERE;
    rec curr%ROWTYPE;
    BEGIN
    OPEN curr;
    LOOP
    FETCH curr INTO rec;
    EXIT WHEN curr%NOTFOUND;
    END LOOP;
    CLOSE curr;
    END;
    If Use Multiple Cursor Declaration, then Use the below Structure ,
    DECLARE
    CURSOR curr IS
    SELECT FROM WHERE;
         CURSOR curr_1 IS
    SELECT FROM WHERE;
    rec curr%ROWTYPE;
    rec_1 curr_1%ROWTYPE;
    BEGIN
    OPEN curr;
    LOOP
    FETCH curr INTO rec;
    EXIT WHEN curr%NOTFOUND;
    END LOOP;
    CLOSE curr;
    END;
    So, You can Fetch the value for the Second Cursor in the LOOP of the First Cursor Statement.
    Or Just Declare a Single Cursor and User FOR-CURSOR LOOP as
    DECLARE
    CURSOR curr IS
    SELECT FROM WHERE;
    rec curr%ROWTYPE;
    BEGIN
    OPEN curr;
    LOOP
    FETCH curr INTO rec;
    EXIT WHEN curr%NOTFOUND;
         for rec_curr in(select *from where  col_name =rec.col_value)loop
         .............Processing
         end loop;
    END LOOP;
    CLOSE curr;
    END;
    You have ample example available for ,Please have a look at it and Try.. All the Best !!!!!
    Thanks,
    Shankar

  • Running a stored procedure in JDev initiates a bpel compile

    When I want to run a stored procedure from the connections area to test it this action always initiates a bpel compile for the highlighted bpel process in the applications palette. It is annoying and time consuming but if the bpel compile fails I can't run the stored procedure either.
    What is with this 'feature'?

    I'm still plagued by this 'symptom/feature'. Is there any workaround?

  • Trouble compiling a stored procedure

    Hello, I have trouble compiling a stored procedure. I include part of the code because I think the key problem is illustrated in these lines:
    date1 is declared as a DATE.
    index_value2 NUMBER;
    BEGIN
    date1 := (select sysdate from dual);
    index_value2 := (select index_value from tmsdat.a_index_values where price_date < (SELECT sysdate -180
       FROM dual) and price_date > (SELECT sysdate -210
       FROM dual));
    [\code]
    The problem seems to be that a more complex syntax is included in the allocation statement (:=), can that be the case? That is, no select etc??
    How is this solved?
    Any help much appreciated!
    best regards
    Harald                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Well, actually WhiteHat´s magic did the trick, but two errors:
    temp := (select (to_number(to_char(sysdate, 'DD'))-1)/(decode(to_char(sysdate,'MM'),'02',28,30)) as result
       from dual);
    [\code]
    this line generates problems but I think the approach is the same maybe, that is:
    select to_number(to_char(sysdate, 'DD'))-1)/(decode(to_char(sysdate,'MM'),'02',28,30)) into temp as result frmo dual
    Further, some error about encountering end of line?
    END CONVERT_MARKET_INDEX;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Re-compiling a package in a stored procedure

    Hi All,
    We are using Oracle 10g. I have coded a stored procedure that does many things one of which is re-creating a Materialized View using Dynamic SQL. However, when this Materialized View is created, a package that this stored procedure needs, becomes invalid. What is the syntax for recompiling the package using Dynamic SQL? I tried something like script listed below, but I am getting "*ORA-24344: success with compilation error*" error message. I like to re-compile the package before it's use in this stored procedure.
    DECLARE
          v_sql         VARCHAR2 (1000);
          object_name   VARCHAR2 (50) := 'TEST.PS2_FNS366';
    BEGIN
           dbms_output.put_line('This is a test.');
           v_sql := 'Alter package ' || object_name || ' compile  package';
           dbms_output.put_line (v_sql);
           EXECUTE IMMEDIATE v_sql;
           v_sql := 'Alter package ' || object_name || ' compile  body';
           dbms_output.put_line (v_sql);
           EXECUTE IMMEDIATE v_sql;     
    END;Thanks,
    Seyed

    Hi Justin,
    I agree with you. Initially, I didn't want to use materialized view in the stored procedure to load a table, but I a kind of was forced into it. I first tried using an Oracle View, but then the Oracle package using it was not finding the view. Then I tried to grant select to it, that failed too. That is when I decided to use a materialized view because, at least I could issue the needed grants.
    After seeing your e-mail and Frank's, I went back to my original plan. I re-created the old view and then tried to give it the right grants. Here is what I tried and the resulting error message:
    GRANT SELECT ON STUDENT.v_ben_reg_case_number TO SCOTT A grant similar to above results in ORA-01720: grant option does not exit for one of the underlying tables. Our DBA tried granting a developer role a system privilege called under_any_role, but that didn't solve it either.
    Thank you for your assistance,
    Seyed

  • N-comp compilation of an Java Stored Procedure

    I am working on Oracle 9.2.0.2 Enterprise Server running on Windows 2000 Advanced Server SP3. I am trying to compile (N-comp) a Java Stored Procedure. It throws up quite a few errors. Normal deployment works fine.
    Oracle has acknowledged the error & provided a bug number. (Period)
    Is there a solution to this ? Has anyone attempted this with success on the environment mentioned above.
    Thanks..

    Thanks. One of the Oracle support staff told me it is a known bug.
    The bug number is 2453291
    "NCOMP DOES NOT WORK ON THE WINDOWS NT PLATFORM"
    While N-comp compilation of an Java Stored Procedure (SQLJ) am getting following errors :-
    softwares used
    Java ver :- JDK 1.3
    database :- oracle version 9.2 with JServer Rel 9.2.0.1.0
    Steps carried for Ncomp compilation
    1) sqlj -ser2class Ap_cm_am_exchange1.sqlj
    2) jar cvf ap_cm_am_exchange1.jar *.class
    3) dropjava -user host/[email protected] ap_cm_am_exchange1.jar
    4) loadjava -oci8 -resolve -force -user host/[email protected] ap_cm_am_exchange1.jar
    5) ncomp -user host/[email protected] -force ap_cm_am_exchange1.jar
    Also Pls find attached
    1) SQLJ code ( Ap_cm_am_exchange1.sqlj )
    2) complete error txt
    3) Ncomp log
    Errors
    error in: FindClassesToNcomp :java.sql.SQLException: ORA-29540: class oracle/jaccelerator/server/ap_cm_am_exchange1_minimalClassListAndTCDumper does not exist
    ORA-06512: at "DV58BOTEST2.JACCELERATOR___FIND_CLASS_LIST", line 0
    ORA-06512: at "DV58BOTEST2.JACCELERATOR_FIND_CLASS_LIST", line 1
    ORA-06512: at line 1
    java.sql.SQLException: ORA-29540: class oracle/jaccelerator/server/ap_cm_am_exchange1_minimalClassListAndTCDumper does not exist
    ORA-06512: at "DV58BOTEST2.JACCELERATOR___FIND_CLASS_LIST", line 0
    ORA-06512: at "DV58BOTEST2.JACCELERATOR_FIND_CLASS_LIST", line 1
    ORA-06512: at line 1
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java)
    at oracle.jdbc.oci8.OCIDBAccess.check_error(OCIDBAccess.java)
    at oracle.jdbc.oci8.OCIDBAccess.executeFetch(OCIDBAccess.java)
    at oracle.jdbc.oci8.OCIDBAccess.parseExecuteFetch(OCIDBAccess.java)
    at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java)
    at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java)
    at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java)
    at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java)
    at oracle.jaccelerator.client.FindClassesToNcomp.doit(FindClassesToNcomp.java:82)
    at oracle.jaccelerator.client.JDBCDriver.run(JDBCDriver.java:80)
    at oracle.jaccelerator.client.FindClassesToNcomp.main(FindClassesToNcomp.java:17)

  • Compiling a frequently accessed Stored Procedure

    RDBMS version :10.2.0.4.0 in a 2 node RAC
    Our Production DB is 24x7 . Our development team has made a change in a frequently accessed Procedure's code.
    At any given time this Stored proc is accessed by at least 5 sessions.
    I have been asked to compile this Procedure with the new changes.
    Since this is a frequently accessed, i think the only option i've left to compile this proc is to Shutdown the DB and start it up using
    STARTUP RESTRICTand then compile it. But, this procedure is actually run by a DBMS_JOB , so even if i shutdown, when i restart it , the job will resume ie continue executing the stored proc. Right?
    I cannot bring down the local listeners as they are listening for another DB in the cluster.
    Is there any other better way ?

    It's nothing to do with Oracle or any other technology -it's part of defining maintainable service levels.
    Unless you really, really need 24/7 availability, it's always best to give yourself a window of downtime for doing upgrades, maintenance etc. A small bit of planned downtime can help prevent large periods of unplanned!
    If you do need that 100% uptime then it needs to be architected in from the start - define your SLAs then architect an environment that can deliver. Unfortunately it is nearly always done the other way round, based upon what people would like, not necessarly what they need, or what is deliverable.

  • Stored Procedure not compiling

    Hi,
    I am not able to compile stored proc in oracle 8i,
    whenever I compile the SP, the pl/sql devloper getting hanged..
    I also tried to compile it from sqlplus, even sqlplus is getting hanged.
    No SP/Functions are dependent on this SP.
    Plz help, Its urgent
    Thanks,
    Shailesh

    Please try this approach:
    First SQL*Plus session:
    select sid from v$mystat where rownum < 2
    compile procedure
    Second SQL*Plus session:
    select *
    from v$session_wait
    where sid = your_sid_from_previous_session
    This will enable you to find out the reason why you are waiting
    Best Regards
    Krystian Zieja / mob

  • Error while deploying a Java Stored Procedure using JDeveloper

    Hi,
    I was going thru the Oracle By Example article: "Developing SQL and PL/SQL with JDeveloper". (http://www.oracle.com/technology/obe/obe9051jdev/ide1012/plsqlobe/obeplsql.htm)
    One of the items in this article is - "Creating and Deploying a Java Stored Procedure"
    I was able to create a java class, compile it. Created a deployment profile. created a pl/sql wrapper. While trying to deploy the java stored procedure, I am getting the following error:
    Invoking loadjava on connection 'hr_conn' with arguments:
    -order -resolve -thin
    errors : class package1/mypackage/JavaStoredProc
    ORA-29521: referenced name java/lang/StringBuilder could not be found
    The following operations failed
    class package1/mypackage/JavaStoredProc: resolution
    oracle.aurora.server.tools.loadjava.ToolsException: Failures occurred during processing
         at oracle.aurora.server.tools.loadjava.LoadJava.process(LoadJava.java:863)
         at oracle.jdeveloper.deploy.tools.OracleLoadjava.deploy(OracleLoadjava.java:116)
         at oracle.jdeveloper.deploy.tools.OracleLoadjava.deploy(OracleLoadjava.java:46)
         at oracle.jdevimpl.deploy.OracleDeployer.deploy(OracleDeployer.java:97)
         at oracle.jdevimpl.deploy.StoredProcHandler.doDeploy(StoredProcHandler.java:474)
         at oracle.jdevimpl.deploy.StoredProcHandler.doDeploy(StoredProcHandler.java:361)
         at oracle.jdevimpl.deploy.StoredProcHandler.doDeploy(StoredProcHandler.java:285)
         at oracle.jdevimpl.deploy.StoredProcProfileDt$Action$1.run(StoredProcProfileDt.java:383)
    #### Deployment incomplete. #### Oct 27, 2005 1:38:56 PM
    Appreciate your help on this..

    I am using Jdeveloper 10.1.3 Early Access Version. JDK comes with it. I also have another JDK on my machine (JDK1.4.2_09)

Maybe you are looking for