Warnings of compilation of a stored procedure in NDS (immediate execution);

CREATE OR REPLACE PROCEDURE P_PRO1 AS
P_VAR VARCHAR2 (1000): =' CREATE OR REPLACE PROCEDURE PROC1 AS
X CONSTANT BOOLEAN: = TRUE;
BEGIN
IF X THEN
DBMS_OUTPUT. PUT_LINE('||)
Q'! 'REAL'!'
*||'); *
ON THE OTHER
DBMS_OUTPUT. PUT_LINE('||)
Q'! 'FALSE'!'
*||'); *
END IF;
END;';
BEGIN
RUN IMMEDIATELY P_VAR;
END;

ALTER SESSION SET PLSQL_WARNINGS = ' ENABLE: ALL ';

Set serveroutput on
EXECUTE P_PRO1; -(No warning messages)




I don't have any compilation warnings by running the above query. In fact, the procedure PROC1, which is compiled by "Execute Immediate" should produce the bcz of warning messages all types of warnings are ENABLED through Alter session, but there are no warnings when running the main proceedings and no log of warnings in the table of user_errors also. Whence the PROC1 warning went?

NDS would only know to run the query given at runtime,
then the PROC1 procedure is compiled at runtime in the main proceedings P_PRO1 will produce warning or not?
If so, den how to check that the warning message?


Thanks for the reply,
Shafir.

You create dynimically then you are the person who needs to print the WARNING.

You can do this by querying the table ALL_ERRORS

select *
  from all_errors
 where name = 'PROC1'
   and type = 'PROCEDURE'

Tags: Database

Similar Questions

  • Compilation of a stored procedure that is frequently consulted

    RDBMS version: 10.2.0.4.0 in a 2 RAC node

    Our Production database is 24 x 7. Our development team has made a change in the code of the procedure frequently consulted.
    At some point this stored proc is accessible by at least 5 sessions.
    I was asked to compile this procedure with the new changes.
    Since this is a frequently viewed, I think that the only option I have left to compile this proc is stopped by the DB and launch it using
    STARTUP RESTRICT
    and then compile it. But, this procedure is actually headed by a DBMS_JOB, so even if I stop, when I restart, the work will resume i.e. that execution of the stored procedure. Right?

    I can't knock local listeners because they are listening to an another DB in the cluster.

    Is there another better way?

    ALTER system set job_queue_processes = 0 will stop the ease of use.

    You might also consider to define windows service and stop the practical execution of cowboy.

    ------------
    Sybrand Bakker
    Senior Oracle DBA

  • Need to query to find stored procedures that takes great execution time

    Hi all

    I use the oracle version below:

    Oracle Database 11 g Release 11.2.0.3.0 - 64 bit Production

    PL/SQL Release 11.2.0.3.0 - Production

    CORE Production 11.2.0.3.0

    AMT for Linux: Version 11.2.0.3.0 - Production

    NLSRTL Version 11.2.0.3.0 - Production

    is it possible to find the name of stored procedure that take too long to run, I need those optimized all SPs.

    Is there a query as top queries that are used to find queries albums that have great time for execution...

    or y at - it another way to find the names of MS. I try with AWR report but showing only used the names of MS.

    Thank you

    No, it not there no such request as far as I know.

    or y at - it another way to find the names of MS.

    Just listen to complaints from the user...

  • Unexpected token: the error that occur inside a stored procedure

    I get an unexpected token error when you try to compile the following stored procedure. The error occurs on the run pk_proof.pr_ProofAssets inside the stored procedure exec statement. No reason?
    CREATE OR REPLACE PROCEDURE MONTHLY_ASSET (ln_business_dt_num IN NUMBER DEFAULT NULL,
                                               missing_tbl_name OUT NOCOPY VARCHAR2) 
    IS
       ln_business_dt_num NUMBER;
       missing_tbl_name VARCHAR2;
       no_tbl_name_found EXCEPTION;
       bad_date_value EXCEPTION;
       counts_not_matched EXCEPTION;
     BEGIN
       IF ln_business_dt_num < 0 THEN
       RAISE bad_date_value;
       ELSE
         Select MAX(business_dt_num) into ln_business_dt_num
         FROM sasor.dp_ca_proof;
          
       if missing_tbl_name IS NOT NULL then
          raise no_tbl_name_found;
       end if;
       
       exec pk_proof.pr_ProofAssets('SLH_DST_ASSET', ln_business_dt_num, 'sasor_batch');
     

    Remove 'exec '.

  • Re-compile a package in a stored procedure

    Hi all
    We are using Oracle 10 g. I coded a stored procedure that does a lot of things which is re - create a materialized using the dynamic SQL view. However, when this materialized view is created, a package that this stored procedure must, becomes invalid. What is the syntax to recompile the package using the dynamic SQL? I tried something like script below, but I'm getting ' * ORA-24344: success with compilation error * "error message. I would like to re - build the package until it is used 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;
    Thank you


    Seyed

    Normally, this means that STUDENT. V_BEN_REG_CASE_NUMBER references objects (tables and views) that has received the STUDENT SELECT on, but not with the WITH GRANT option. If this is the case, STUDENT may not grant other users access to this data.

    If STUDENT. V_BEN_REG_CASE_NUMBER refers to tables A, B and C belonged to another user U, U have to

    GRANT SELECT ON u.a TO student WITH GRANT OPTION;
    GRANT SELECT ON u.b TO student WITH GRANT OPTION;
    GRANT SELECT ON u.c TO student WITH GRANT OPTION;
    

    If the STUDENT has these privileges, it will be able to grant access to his point of view V_BEN_REG_CASE_NUMBER other users.

    Justin

  • compilation of stored procedure

    The procedure can be stored below.

    I need to declare varchar2 with a number such as varchar2 (30)
    How can I do and how to compile the stored procedure to display the output.

    number variable t1
    date variable t2

    test exec ('345', 'test', 'ECE','' 2008-09-10: t1: t2);

    I am facing problems




    Create or REPLACE procedure (eno vARCHAR2
    ename VARCHAR2
    dept VARCHAR2
    Join_date DATE
    sno ON NUMBER
    End_date DATE
    )
    IS

    BEGIN

    SELECT SNO, end_date IN sno, end_date of EMPLOYEE

    WHERE EMPLOYEE_NO = eno;



    EXCEPTION

    WHEN NO_DATA_FOUND THEN
    SNO: = NULL;
    End_date: = NULL;

    WHILE OTHERS THEN
    SNO: = NULL;
    End_date: = NULL;

    END;
    /

    Your case,

    satyaki>
    satyaki>ed
    Wrote file afiedt.buf
    
      1  cREATE OR REPLACE PROCEDURE Sample (carrier_code vARCHAR2
      2  ,vessel_name VARCHAR2
      3  ,voyage_no  VARCHAR2
      4  ,port_code  VARCHAR2
      5  ,eta_date   DATE
      6  ,tmp_rotation OUT NUMBER
      7  ,tmp_eta_date OUT DATE
      8  )
      9  IS
     10  BEGIN
     11  SELECT ROTN,ETA_DATE INTO
     12  tmp_rotation,tmp_eta_date
     13  FROM Sample1
     14  WHERE LINE_CODE = carrier_code
     15  AND VESS_NAME = vessel_name
     16  AND VOYAGE_NO = voyage_no
     17  AND PORT_CODE = port_code
     18  AND SAIL_DATE IS NULL
     19  AND VOYAGE_TYPE = 0;
     20  EXCEPTION
     21  WHEN NO_DATA_FOUND THEN
     22  tmp_rotation := NULL;
     23  tmp_eta_date := NULL;
     24  WHEN OTHERS THEN
     25  tmp_rotation := NULL;
     26  tmp_eta_date := NULL;
     27* END;
     28  /
    
    Procedure created.
    
    Elapsed: 00:00:02.33
    satyaki>
    satyaki>
    
    satyaki>
    satyaki>declare
      2  t1 number(10);
      3  t2 date;
      4  begin
      5  Sample('MSK','DUBAI','5645','J',null,t1,t2);
      6  dbms_output.put_line('SNO: '||t1||' - '||' END_DATE: '||t2);
      7  exception
      8  when others then
      9  dbms_output.put_line(sqlerrm);
     10  end;
     11  /
    SNO:  -  END_DATE:
    
    PL/SQL procedure successfully completed.
    
    Elapsed: 00:00:01.04
    satyaki>
    satyaki>
    satyaki>
    satyaki>SELECT ROTN,ETA_DATE
      2  FROM Sample1
      3  WHERE LINE_CODE = 'MSK'
      4  AND VESS_NAME = 'DUBAI'
      5  AND VOYAGE_NO = '5645'
      6  AND PORT_CODE = 'J'
      7  AND SAIL_DATE IS NULL
      8  AND VOYAGE_TYPE = 0;
    
          ROTN ETA_DATE
    ---------- ---------
        623930 23-APR-08
    
    Elapsed: 00:00:00.16
    satyaki>
    

    And now to change your query to->

    satyaki>
    satyaki>cREATE OR REPLACE PROCEDURE Sample (carrier_code vARCHAR2
      2  ,vessel_name VARCHAR2
      3  ,voyage_no  VARCHAR2
      4  ,port_code  VARCHAR2
      5  ,eta_date   DATE
      6  ,tmp_rotation OUT NUMBER
      7  ,tmp_eta_date OUT DATE
      8  )
      9  IS
     10
     11  cursor c1
     12  is
     13    SELECT ROTN,ETA_DATE
     14    FROM Sample1
     15    WHERE LINE_CODE = carrier_code
     16    AND VESS_NAME = vessel_name
     17    AND VOYAGE_NO = voyage_no
     18    AND PORT_CODE = port_code
     19    AND SAIL_DATE IS NULL
     20    AND VOYAGE_TYPE = 0;
     21
     22    r1 c1%rowtype;
     23
     24  BEGIN
     25
     26  for r1 in c1
     27  loop
     28    tmp_rotation := r1.ROTN;
     29    tmp_eta_date := r1.ETA_DATE;
     30  end loop;
     31
     32  EXCEPTION
     33  WHEN NO_DATA_FOUND THEN
     34  tmp_rotation := NULL;
     35  tmp_eta_date := NULL;
     36  WHEN OTHERS THEN
     37  tmp_rotation := NULL;
     38  tmp_eta_date := NULL;
     39  dbms_output.put_line(sqlerrm);
     40  END;
     41  /
    
    Procedure created.
    
    Elapsed: 00:00:01.96
    satyaki>
    satyaki>
    satyaki>declare
      2  t1 number(10);
      3  t2 date;
      4  begin
      5  Sample('MSK','DUBAI','5645','J',null,t1,t2);
      6  dbms_output.put_line('SNO: '||t1||' - '||' END_DATE: '||t2);
      7  exception
      8  when others then
      9  dbms_output.put_line(sqlerrm);
     10  end;
     11  /
    SNO: 623930 -  END_DATE: 23-APR-08
    
    PL/SQL procedure successfully completed.
    
    Elapsed: 00:00:00.17
    satyaki>
    satyaki>
    satyaki>SELECT ROTN,ETA_DATE
      2  FROM Sample1
      3  WHERE LINE_CODE = 'MSK'
      4  AND VESS_NAME = 'DUBAI'
      5  AND VOYAGE_NO = '5645'
      6  AND PORT_CODE = 'J'
      7  AND SAIL_DATE IS NULL
      8  AND VOYAGE_TYPE = 0;
    
          ROTN ETA_DATE
    ---------- ---------
        623930 23-APR-08
    
    Elapsed: 00:00:00.06
    satyaki>
    

    Hope this will help.

    Kind regards.

    LOULOU.

  • Create stored procedure

    Hi, I create my first stored procedure and really need help... I managed to set up the following:

    CREATE or REPLACE PROCEDURE DRL_PROCEDURE (var_SOURCE_OBJECTID IN varchar2, var_NEW_OBJECTID OUT varchar2)
    IS
    var_temp_newobjectid varchar2 (20);
    BEGIN
    SELECT MAX (NEW_OBJECTID)
    IN var_temp_newobjectid
    OF DRL_CONVERSION
    WHERE SOURCE_OBJECTID = var_SOURCE_OBJECTID;

    var_NEW_OBJECTID: = var_temp_newobjectid;
    return;
    END;

    I don't know if this is correct, however, I tried running with the following text, but when it does not perform any results show... it just says: procedure completed successfully:

    RETVAL VARIABLE VARCHAR2 (20)
    EXEC DRL_PROCEDURE('ab',:RETVAL);

    Do I need to change somehow to show the result?
    Also if you know how I can call the procedure in c# and show the result in this way which would be useful... Thank you

    Hi and welcome to the forums!

    The last step, you forgot to PRINT your result. See the example below:

    SQL> CREATE OR REPLACE PROCEDURE TEST_PROC
      2  (
      3          pOwner  IN VARCHAR2
      4  ,       pCnt    OUT VARCHAR2
      5  )
      6  AS
      7  BEGIN
      8          SELECT  COUNT(*) INTO pCnt
      9          FROM    ALL_OBJECTS
     10          WHERE   OWNER = pOwner;
     11  END;
     12  /
    
    SP2-0804: Procedure created with compilation warnings
    
    SQL> VAR result NUMBER;
    SQL> EXECUTE TEST_PROC(USER,:result);
    
    PL/SQL procedure successfully completed.
    
    SQL> PRINT result
    
        RESULT
    ----------
          7090
    

    In addition, you don't need the VAR_TEMP_NEWOBJECTID variable. You can SELECT... IN VAR_NEW_OBJECTID instead.

    HTH!

  • Version of 5.0.2.00.07(online à APEX) - error in the execution of a stored procedure through anonymous block

    DECLARE

    the stored procedure varchar2 (25);

    BEGIN

    -DBMS_OUTPUT. Put_line ("enter the name of the procedure :'||: procname");

    the stored procedure: =: procname;

    DBMS_OUTPUT. Put_line (' procedure :'|| stored procedure);

    stored procedure.

    END;

    : procname is a variable binding in the apex to switch the running value.

    apex-bind_var.png

    This is the error I get

    ORA-06550: line 7, column 2:

    PLS-00221: "STORED procedure" is not a procedure or is not defined

    ORA-06550: line 7, column 2:

    PL/SQL: Statement ignored

    5the stored procedure: =: procname;

    6 DBMS_OUTPUT. Put_line (' procedure :'|| stored procedure);

    7. the stored procedure.

    8 END;

    SmtWtL wrote:

    DECLARE

    the stored procedure varchar2 (25);

    BEGIN

    -DBMS_OUTPUT. Put_line ("enter the name of the procedure :'||: procname");

    the stored procedure: =: procname;

    DBMS_OUTPUT. Put_line (' procedure :'|| stored procedure);

    stored procedure.

    END;

    : procname is a variable binding in the apex to switch the running value.

    This is the error I get

    ORA-06550: line 7, column 2:

    PLS-00221: "STORED procedure" is not a procedure or is not defined

    ORA-06550: line 7, column 2:

    PL/SQL: Statement ignored

    5. the stored procedure: =: procname;

    6 DBMS_OUTPUT. Put_line (' procedure :'|| stored procedure);

    7. the stored procedure.

    8 END;

    What you're trying to achieve?

    Bind variables cannot be used for the dynamic execution of stored programs. Dynamic SQL using lexical rather than bind substitution must be used to run when the program name is not known until execution of the programs.

    declare
      sproc varchar2(25);
    begin
      sproc := :procname;
      dbms_output.put_line('procedure:'||sproc);
      execute immediate 'begin ' || sproc || '; end;'; -- DO NOT DO THIS!
    end;
    

    It is a fundamental design flaw and a security disaster. It's stops essential compilation controls is performed and is open to attack by SQL injection and other security vulnerabilities. There is no good reason to do this.

  • Why these stored procedures his does not work

    Hi I'm new and I need help following SQL works correctly, but when I walked into a stored procedure me displays error

    SELECT Por.PortalID,

    Name,

    Lower (LTrim (RTrim (SEOName))) SEOName,

    IsParent,

    Por.Parentid,

    (Select Seoname

    Portal port

    Where Por.Parentid = Port.Portalid) Parentportalname;

    SettingValue.SettingValue DefaultPage

    Por PORTAL

    JOIN SettingValue

    ON Por.PortalID = SettingValue.settingtypeid

    Where Settingtype = 'SiteAdmin '.

    And Settingkey = 'PortalDefaultPage. '

    his return:

    Portald Name SEONAME ISPARENT ParentId parentportalname DefaultPage
    1by defaultby default10nullHomepage

    It's my stored procedure

    create or replace

    Procedure Sp_Portalgetlist as

    Start

    SELECT Por.PortalID,

    Name,

    Lower (LTrim (RTrim (SEOName))) SEOName,

    IsParent,

    Por.Parentid,

    (Select Seoname

    Portal port

    Where Por.Parentid = Port.Portalid) Parentportalname;

    SettingValue.SettingValue DefaultPage

    Por PORTAL

    JOIN SettingValue

    ON Por.PortalID = SettingValue.settingtypeid

    Where Settingtype = 'SiteAdmin '.

    And Settingkey = 'PortalDefaultPage ';

    END SP_PORTALGETLIST;

    When I compile with oracle sqldeveloper show this error:

    • Error (4.1): PLS-00428: an INTO clause in this SELECT statement

    I appreciate all the help

    What about the compile error in a PL/SQL block a select statement has an additional part:

    Select attr1, attr2...

    in var1, var2,...

    Of...

    but you can also use your selection (without the) in a cursor:

    procedure is...

    cursor my_select is

    Select...;

    my_variable my_cursor % rowtype;

    Start

    Open my_cursor;

    extract my_cursor in my_variable; -fails at the record and then one more found!

    close my_cursor;

    ...

    Good bye

    DPT

  • "WARNING: compiled, but with compilation errors" when executing procedure.

    Hi all, I am so new plsql. This code has been compiled, but there was a warning. I guess that I'm missing a small question as semicolon but since im new I couldn't see what is the problem.

    CREATE or REPLACE procedure BAKIM.grantt_uguser as

    cursor synn is

    Select 'CREATE a PUBLIC SYNONYM' | object_name |' for '. owner: '. ' || object_name dba_objects TXT

    where owner = 'DS' and object_type in ('INDEX', 'PROCEDURE', 'TABLE', 'FUNCTION', 'SEE', 'TRIGGER', 'SEQUENCE', 'PACKAGE')

    and

    object_name not in (select table_name from dba_synonyms where owner = "FCY");

    Start

    for li in synn

    loop

    immediately run li. TXT;

    end loop;

    end;

    /

    Right.  When you use SQL, you privileges through roles are available.  When PL/SQL is running, your own roles aren't usually in fact, if we were to be granted directly to the owner of the stored procedure privileges on objects (there are few exceptions to this, but do not worry for this discussion).

  • Error of insufficient privileges on the creation of model running in a stored procedure

    Hello

    I get the error of insufficient privileges on execution of the DBMS_DATA_MINING. Script CREATE_MODEL in a stored procedure.

    If I run the same DBMS_DATA_MINING. Script CREATE_MODEL in an anonymous block with just begin... end;

    I am able to create a model successfully, but if I do the same thing after having stored the script in the stored procedure, it is throwing error of insufficient privileges.

    Scripts:

    BEGIN

    DBMS_DATA_MINING. () CREATE_MODEL

    Model_name = > < template name >

    mining_function = > dbms_data_mining. CLASSIFICATION,

    DATA_TABLE_NAME = > < data table name >

    CASE_ID_COLUMN_NAME = > < case ID >

    target_column_name = > < target column >

    SETTINGS_TABLE_NAME = > < settings table >

    DATA_SCHEMA_NAME = > < schema >

    SETTINGS_SCHEMA_NAME = > < schema >

    );

    END;

    The foregoing, works very well and created a model with the model given with success.

    But if I keep the above, in a stored procedure as - MINING_TESTING

    create or replace procedure MINING_TESTING as

    BEGIN

    DBMS_DATA_MINING. () CREATE_MODEL

    Model_name = > < template name >

    mining_function = > dbms_data_mining. CLASSIFICATION,

    DATA_TABLE_NAME = > < data table name >

    CASE_ID_COLUMN_NAME = > < case ID >

    target_column_name = > < target column >

    SETTINGS_TABLE_NAME = > < settings table >

    DATA_SCHEMA_NAME = > < schema >

    SETTINGS_SCHEMA_NAME = > < schema >

    );

    END;

    Compiles correctly.

    Enforcement - EXEC MINING_TESTING;

    Error message throw sufficient privileges.

    The error message complete below:

    Error report:

    ORA-01031: insufficient privileges

    ORA-06512: at "SYS." DBMS_DATA_MINING', line 1798

    ORA-06512: at "MIS_ORABI_ODM.CA_MINING_TESTER", line 3

    ORA-06512: at line 1

    01031 00000 - "insufficient privileges".

    * Cause: An attempt was made to change the user name or password

    without the privilege appropriate. This error also occurs if

    trying to install a database without the need for employment

    access privileges.

    When Trusted Oracle is configure in DBMS MAC, this error may occur

    If the user has been granted the privilege necessary for a higher label

    that the connection is active.

    * Action: Ask the database to perform the operation or grant administrator

    the required privileges.

    For users Trusted Oracle get this error, well that granted the

    the privilege that is suitable for the top label, ask the database

    administrator to grant the privilege to the appropriate label.

    Hello

    DataMiner UI grants privileges to a role, so if you're depending on these privileges you must proceed as follows when you create a stored procedure.

    Your stored procedure was created with the default authid which is definers. It will not use the privileges for the role. Solution is to create the stored procedure with authid current_user. This will pick up the privileges for the role. Another option is to apply the following subsidies directly to the user account:

    grant CREATE MINING MODEL

    CREATE THE TABLE,

    IN ORDER TO CREATE

    Example of stored procedure:

    create or replace procedure MINING_TESTING AUTHID CURRENT_USER as

    BEGIN

    DBMS_DATA_MINING. () CREATE_MODEL

    MODEL_NAME =>

    mining_function-online dbms_data_mining. CLASSIFICATION,

    DATA_TABLE_NAME =>

    CASE_ID_COLUMN_NAME =>

    target_column_name =>

    SETTINGS_TABLE_NAME =>

    DATA_SCHEMA_NAME =>

    SETTINGS_SCHEMA_NAME =>

    );

    END;

    Thank you, Mark

  • How to do a select on the results of a stored procedure?

    Hello

    I am new to Oracle. I work with SQL Developer.

    I'm doing a simple select on the results of a stored procedure call. I don't know how to do it. Here's what I have so far:

    declare
    type ref_cursor is ref cursor;
    results ref_cursor;
    Start
    MyStoredProcedure (123 results);
    Select * from results;
    end;
    /

    but he said to me:

    Error from the 1 in the command line:
    declare
    type ref_cursor is ref cursor;
    results ref_cursor;
    Start
    GET_TAX_TYPE_BY_TAX_ENTITY_KEY (60670100000000, results);
    Select * from results;
    end;
    Error report:
    ORA-06550: line 6, column 15:
    PL/SQL: ORA-00942: table or view does not exist
    ORA-06550: line 6, column 1:
    PL/SQL: SQL statement ignored
    06550 00000 - "line %s, column % s:\n%s".
    * Cause: Usually a PL/SQL compilation error.
    * Action:

    Obviously, select * results; is not the right way to do it. But what is?

    Thanks for any advice forthcoming.

    If a SQL cursor is built by a reporting system, a Java application, a c# program, or a PL/SQL call - the database doesn't care, because he doesn't know the difference. A Select SQL cursor created in PL/SQL through the ref cursor interface, won't be faster than the same SQL select in Eclipse. If the SQL source code is the same, the same cursor SQL program will be used by both.

    What give you BIRT is the flexibility of the use of code Server (PL/SQL) to create the slider - this code doing business and technical decisions on how to design side than SQL, Select. Which is a good thing because it summarized the data model and the complexity BIRT server technique.

    So my choice would be to use the procedural interface and return to the reporting system for the rendering of the ref Cursor.

    The question of a slider running via the slider (selection of a cursor), is questionable. Yes, there are a set of specifications that allows to do this kind of thing. But it must be very firmly justified and careful design because it really is an exception. I personally (blame my DBA) would need a justification because it is much more of an exception. I have never seen it put in place in production in more than a decade of DBA'ing, despite the developers try to use such a hack - as it has always been much more powerful and the deployment of alternatives.

    The concept for robust and efficient code for Oracle is: Maximise SQL. Minimize the PL/SQL (or Java / c# / etc.).

    That means when it comes to database power, write an SQL program to do. Stop thinking of SQL as a language of data recovery a single simplistic statement. Think of it as a programming language. Extremely complex problems can be resolved with a single SQL, which requires easy code 100 + lines of PL/SQL, Java, or c#. Write SQL programs. Not SQL one-liners for a grinding program PL/SQL or Java data.

    Why then PL/SQL? It is the best language to manage the creation of SQL, dealing with the process flow, conditional processing, and so on of exception handling. It is less than SQL (such as Java and c#) in the treatment of the data.

  • DBI - ORA-04065: stored procedure 'APPS. HRI_BPL_CONC_ADMIN

    Hello!

    When I tried to deal with the application of DBI, I hava the following error:

    ORA-04065: no to ha ejecutado porque is ha borrado o reworked

    ORA-04065: stored procedure 'APPS. HRI_BPL_CONC_ADMIN"no to ha ejecutado porque is ha borrado o reworked

    ORA-06508: PL/SQL: no to ha sown the programa llamada unidad: "APPS. HRI_BPL_CONC_ADMIN ".

    ORA-04065: no to ha ejecutado porque is ha borrado o reworked

    ORA-04065: stored procedure 'APPS. HRI_BPL_CONC_ADMIN"no to ha ejecutado porque is ha borrado o reworked

    ORA-06508: PL/SQL: no to ha sown the programa llamada unidad: "APPS. HRI_BP

    +---------------------------------------------------------------------------+

    Top of registro desde FND_FILE messages

    +---------------------------------------------------------------------------+

    ORA-04065: no to ha ejecutado porque is ha borrado o reworked

    ORA-04065: stored procedure 'APPS. HRI_BPL_CONC_ADMIN"no to ha ejecutado porque is ha borrado o reworked

    ORA-06508: PL/SQL: no to ha sown the programa llamada unidad: "APPS. HRI_BPL_CONC_ADMIN ".

    I followed the note:

    ORA-06508: PL/SQL: could not find program unit called: "APPS. HRI_BPL_CONC_ADMIN"error on HRI event capture incremental process [1069280.1 ID], but this ended up completed with warnings

    INFO: 1) YES - 67078:Interim patch 9010222 is a superset of the patches [9010222] OH /u02/CLON/db/tech_st/11.1.0

    INFO:--------------------------------------------------------------------------------

    GRAVE: YES - 67204:OPatch Session is complete warning.

    I have reviewed the invalid objects and the db has no APPS. Invalid HRI_BPL_CONC_ADMIN object.

    The database version is 11.0.7.0 and the i686 plataform.

    Can you help me?

    Thank you

    Hello

    I see the thread marked as answer, have you managed to solve the problem?

    What is the problem you are having now...

    Best regards

  • Double games of results returned on stored procedure call

    Hello

    I have a stored procedure created Java and called using the Spring JDBC using StoredProcedure class, stored procedure returns duplicate rows, is this a known problem?

    When I run the stored procedure even in DBVizualiser it not show correctly.

    The class below is used to execute the stored procedure:

    public class CustomerSearchProcedureRunner extends StoredProcedure {
     public CustomerSearchProcedureRunner(JdbcTemplate jdbcTemplate) {
      super();
      this.setJdbcTemplate(jdbcTemplate);
      this.declareParameter(new SqlReturnResultSet(RETURN_RESULTS, new CustomerRowMapper()));
      this.declareParameter(new SqlParameter(CUST_SP_IN_PARAM, Types.VARCHAR));
      this.setSql("{CALL INSURANCE.SEARCHCUSTOMER (?) ON ALL}");
      this.setSqlReadyForUse(true);
      this.compile();
     }
    }
    


    and Java Stored Procedure that runs SQLFire is given below:

    public class CustomerSearchProcedure {
     
     private static final String DOLLAR = "\\$";
     private static final String COLON = ":";
     private static final String CUST_NAME = "CUST_NAME";
     private static final String CUST_NO = "CUST_NO";
     private static final String GENDER = "GENDER";
     
     
     public static void searchCustomer (String customers, ResultSet[] outResults,
       ProcedureExecutionContext context) throws SQLException {
      StringBuilder sql = new StringBuilder();
      StringBuilder whereCondt = new StringBuilder();
      String[] tokens = new String[]{};
      
      if (customers != null && customers.trim().length() > 0) {
       tokens = customers.split(DOLLAR);
      }
      
      sql.append("<global>SELECT * FROM INSURANCE.CUSTOMERS ");
      whereCondt.append("WHERE CUST_PRIMARY IN ('Y', 'N') ");
      // Apply dynamic where condt
      for (int i=0; i < tokens.length; i++ ) {
       String token = tokens[i];
       if (token.startsWith(CUST_NO)) {
        if (whereCondt.length() > 0) {
         whereCondt.append(" AND ");
        }
        whereCondt.append("CUST_NO = " + token.substring(token.indexOf(COLON)+1));
       }
       if (token.startsWith(CUST_NAME))  {
        if (whereCondt.length() > 0) {
         whereCondt.append(" AND ");
        }
        whereCondt.append("CUST_NAME LIKE '"+ token.substring(token.indexOf(COLON)+1).trim() + "%'");
       }
       if (token.startsWith(GENDER)) {
        if (whereCondt.length() > 0) {
         whereCondt.append(" AND ");
        }
        whereCondt.append("GENDER ='"+ token.substring(token.indexOf(COLON)+1).trim() + "'");
       }
      } //End of for
      
      if (whereCondt.length() > 0) {
       sql.append(whereCondt.toString());
      }
      
      Connection cxn = context.getConnection();
      Statement stmt = cxn.createStatement();
      ResultSet rs = stmt.executeQuery(sql.toString());
      outResults[0] = rs;
     } //END OF METHOD
    }
    

    A correction preceding: "for the case on the information in the TABLE of the DataSet to be targeted on each node is also sent for the tag requests will target only this dataset (and avoids duplicates).»

    should read "in the case of on TABLE query Tags will only target the local primary data on the node for tables partitioned, while for replicated tables, it is sent to only one of the lines (and so avoids duplicates in both cases).» WHERE clause to TABLE is not used for cutting data only for the size of the set of nodes to the target.

    The tag prunes yet the query to all of the local primary buckets in all cases (i.e. which WE ALL and on GROUPS of SERVERS) so the comment about and equivalent was incorrect. However, this will always be looking for data in duplicate for replicated tables and TABLE is the only way to avoid it for now.

  • Privileges differ between SQL * more and stored procedure

    A user with the dba role can access dba_role_privs. But this is not possible in a stored procedure created by the same user.
    Normally, the example should work fine
    But with Oracle XE 11.02 - cost free database with some limitations - I get error 942

    I show a simple example in SQL * more:

    SQL > r
    1 * select distinct dba_role_privs recipient where the recipient as "SY %.

    DEALER
    ------------------------------
    SYSTEM
    SYS

    SQL > create or replace procedure x as
    2 start
    3 for rec in (select distinct dba_role_privs dealer where the beneficiary as 'SY %')
    4 loop
    5 zero;
    6 end of loop;
    7 end;
    8.

    Warnung: Prozedur wurde mit Kompilierungsfehlern standing.
    English translation: procedure created with compilation errors

    SQL > show error

    LINE/COL ERROR
    -------- -----------------------------------------------------------------
    3/14 PL/SQL: statement ignored
    3/43 PL/SQL: ORA-00942: table or view does not exist
    SQL >

    How can I fix?

    Why do you think the example should work properly?

    Normally, regardless of the version, the privileges granted through roles (such as DBA) not available for stored procedures. Stored procedure of a DEFINER rights can only take advantage of the privileges granted directly to the owner of the procedure. Stored procedure of the invoker rights can enjoy privileges granted by a role, but that requires that the appellant has independent privileges to query the table in question (and, in this case, would require dynamic SQL usage).

    Generally, the simplest approach would be to grant the privilege to CHOOSE ANY DICTIONARY to the owner of the procedure.

    Justin

Maybe you are looking for

  • If I change my email Apple ID for a new email, I lose my photos, contacts, applications etc?

    I recently did a new email, which is different from my email Apple ID. I want to change my old email to my new on my phone, but I don't want to lose my apps, contacts, pictures, etc..

  • HARD drive in PIO mode - very slow

    Anyone else have a HD Sentinel message - or another HARD drive test, that HARD is only in PIO mode, not in Ultra DMA? It's really slow.It can be verified, my computer - property - materials - IDE ATA/ATAPI - IDE elementary or secondary school - prope

  • Portal HP DesignJet 1055 CM more

    Hi all I recently got a used HP DesignJet 1055 CM Plus and when turned on I got the error mentioned here: Designjet 1055 cm Plus - error code 007 has a 0251 09 001 So I removed the internal HD, following the instructions here: DesignJet 1055 CM plus

  • Flash 10.2 on Webtop

    Noticed that the flash in the webtop browser is 10.1 even after updating the phone to 10.2 via the market. Y at - it an update in the next few weeks? I feel that the entire experience of webtop might be smoother if we consider the power of this phone

  • Backup of data files

    What program do you use to backup data files?