Package, procedure, check routine

Hi,
DB version: 11.2.0.3 EE
A basic question has arisen concerning a check routine in a package and/or procedure:
2 procedures exist and the parameters for both procedures are the same, however the business
logic in each proc is slightly different. The data is stored in one table with an identifier for each
business case. The check routine should run "in the background" after the user entered the
parameters.
Simplified example:
Base_table data with identifier 1 and 2
SQL queries are the same except for the where clauseBusiness case 1 (fetch data that has identifier 1)
Proc_1
p_1
p_2
p_3
p_4
...Business case 2 (fetch data that has identifier 2)
Proc_2
p_1
p_2
p_3
p_4
...Maybe this check routine could(should) be implemented in a package, package body that holds these procs?
Thanks for your feedback!

Hi,
the check routine can be implemented:
a) As it is now. Do you experience any problem in having 2 separate procedures?
b) In a package with 2 different procedures
c) In a package with 1 procedure having 1 additional parameter (identifier) which is driving the check routine accordingly
b) In one procedure having 1 additional parameter (identifier) which is driving the check routine accordingly
This is up to you to decide what fits better for your case. However from your question I did not understand if you expect any improvement or you want just do it for organizational issues.
By the way, I had a look at your profile. Why don't you think to close some of your open questions?
Handle:      user545194 
Status Level:      Newbie
Registered:      Nov 25, 2006
Total Posts:      389
Total Questions:      122 (99 unresolved) 99 unresolved question over 122 is quite a high number.
Regards.
Al

Similar Messages

  • Check package/procedure level privileges for a user

    hi gurus,
    how to check the package/procedure level privileges for a user? like dba_tab_privs for tables.
    for eg: grant execute on dbms_scheduler to user1.
    now, i need to verify that user1 has execute privilege on dbms_scheduler or not.
    what's the view for this?
    thanks in advance,
    charles

    SQL> select privilege, count(*) from dba_tab_privs group by privilege order by 1;
    PRIVILEGE                       COUNT(*)
    ALTER                               19
    DEBUG                              256
    DELETE                              131
    DEQUEUE                            3
    EXECUTE                           19315
    FLASHBACK                          52
    INDEX                               14
    INSERT                              137
    MERGE VIEW                          36
    ON COMMIT REFRESH                     52
    QUERY REWRITE                          52
    PRIVILEGE                       COUNT(*)
    READ                                7
    REFERENCES                          54
    SELECT                                3752
    UNDER                                3
    UPDATE                              111
    WRITE                                5
    17 rows selected.DBA_TAB_PRIVS is for more than just tables.

  • How can I create packages procedure & function in user-define Library

    hi.
    i am already created packages procedure & function in database and use so on.
    now i would like to create these in library file.
    please anyone give me example of any procedure or function to store in library.
    thanks
    Ali

    <FONT FACE="Arial" size=2 color="2D0000">> please send me one simple example for create library
    then create any function in library.
    2nd is any package can be create in library or not??
    Thanks S.K
    AliHave you checked the link?
    A simple example is provided.
    I think What I understood from your post is that, you want to put function/ Proc and want to call that as Library ..
    Which is not  possible.
    For exampel an external routine is a third-generation language procedure stored in a
    dynamic link library (DLL), registered with PL/SQL, and called by the DBA to perform
    special-purpose processing.
    In Unix a dynamic link library is known as a shared object (so).
    At run time, PL/SQL loads the library dynamically, then calls the routine as if it were a
    PL/SQL subprogram. To safeguard our database, the routine runs in a separate address
    space, but it participates fully in the current transaction. Furthermore, the routine can
    make a call back to the database to perform SQL operations.
    To identify a DLL we have to use CREATE LIBRARY command.
    The CREATE LIBRARY command is used to create a schema object, library, which
    represents an operating-system shared library, from which SQL and PL/SQL can call
    external third-generation-language (3GL) functions and procedures.
    Learn something more on External Procedures
    -SK
    </FONT>

  • Packaged Procedures Usage in Forms

    I am intending to base some forms 6i on packaged procedures passing out pl/sql table of records. Will it be wise/useful to handle any errors (user defined possibly) within such procedures using a user defined error processing routine or RAISE_APPLICATION_ERROR and pass such errors out using out parameters ? Or does one leave all error handling to the forms interface level e.g raise EXCEPTIONS
    using the WHEN OTHERS exception and RAISE FORM TRIGGER FAILURE ? I'm slightly in the dark here ?
    Regards
    laide

    You may want to use a combination of both. You if you have an error you may want to record where the error happened (in an error log) and then propagate the error up. If really depends on the type of error. If it is a failed validation then you may want to propagate. If it is an error your code can handle then pass a parameter.
    You may also want to consider the fact thatif you get and error and propagate it then it becomes harder or trace the source of the error.
    Regards
    Grant

  • Ability to filter out Views, Indexes, Packages, Procedures, Functions, etc.

    Under Connections, I choose my database, then the user, and from there I view my Tables. I have no need to view Views, Indexes, Packages, Procedures, etc., just the tables (which I am able to filter).
    Since the tree containing Views, Indexes, Packages, etc., take up a lot of real estate (I work with multiple databases, each with a specific user, or schema), is it not possible to filter these out?
    Thanks!
    Edited by: user9956988 on Jun 15, 2010 3:53 PM

    Just to double check that I'm interpreting the problem correctly, is the following true:
    select * from all_objects where object_name = 'DBA_SOURCE'
    returns nothing
    select * from dba_source where name = your PL/SQL module
    returns all the code

  • Privilages for Package.procedure

    Hi all,
    can any one plzz help me out how to grant privilages for package.procedure.
    I had given grant execute on Package but its not working out.
    Thanks in Advance

    <FONT FACE="Arial" size=2 color="2D0000">
    The reason may be
    ORA-00942:     table or view does not exist
         ORA-06512: at line <number> ? check in that line number
       * the spelling of the table or view name.
        * that a view is not specified where a table is required.
        * that an existing table or view name exists.
      -SK
    Edited : See to that table/view used in the packages can be accessed by  granted user
    </FONT>

  • Error While Creating Block on Package Procedure

    Hi
    When I try to create a block on a package Procedure I get the following error
    ifbld60.exe has generated errors and will be closed by Windows.
    You will need to restart the program.
    An Error log is being created,
    and forms closes.
    Is it something to do with Forms problem or with Windows? Is there a patch available for this problem or its a OS bug. The client I am testing this form from is Windows 2000 Professional.
    Thanks for your help
    Diogo

    Hi
    You cannot directly insert object in Stored Procedure universe,Whatever object you are using to define your derived table,you have to include all those objects into the universe first.
    From the below image you can see that i have 3 derived tables ,but whatever objects i am trying to use all those i have inserted into the universe.
    Try to build like this save and export.
    Let me know if you face nay error

  • Error while accessing oracle packaged procedure in crystal report./ How to

    Hi,
    When i tried to call a packaged procedure in crystal reports for .net, i am unable to access it.
    i am getting error as 'unknown query engine'
    In that packaged procedure i have a two IN parameters and one OUT TABLE parameter ( which is declared in package specification )
    And when selecting the packaged procedure in crystal report,the wizard shows all the parameters like the IN parameters, and when i just leave it blank. i unable to set into report.
    ie., the OUT table type is shown as IN paramters (Actually it is an output and has field fields in it.)
    And No fields are coming in the Fields Explorer of crystal reports in .net.
    can you provide any help.
    thanks and regards
    Mohan Raj K.
    Actually using vs.net 2005 prof.
    Message was edited by:
    mohanraj_k

    Actually the OUT Parameter type in the stored
    procedure is showing as IN Parameters and asking
    for input values in the crystal report creation
    wizard(while selecting the
    database,connection,storedprocedures/qualifiers).That sounds like a problem on the .net / crystal report creation wizard side of things. Oracle no doubt recognises them as OUT parameters, so it's not Oracle at fault. I would guess the .net stuff is just querying the data dictionary to see what parameters there are rather than differentiating between the INs and OUTs.

  • Calling a package procedure with Date parameter only

    Hi All,
    Please help me to call a package procedure with Date parameter from sql prompt.
    Arif

    Check the below procedure.
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace procedure procdate (p_date_in date)
      2  is
      3  p_date_out date;
      4  begin
      5  p_date_out := add_months(p_date_in,6);
      6  dbms_output.put_line(p_date_out);
      7* end;
    SQL> /
    Procedure created.
    SQL> exec procdate('01-JAN-2010');
    01-JUL-10
    PL/SQL procedure successfully completed.
    SQL> exec procdate(to_date('01/01/2010','DD-MM-YYYY'));
    01-JUL-10
    PL/SQL procedure successfully completed.
    SQL> exec procdate('31-DEC-2010');
    30-JUN-11
    PL/SQL procedure successfully completed.

  • How to find out Unused Packages/Procedures/Functions/Triggers

    Hi,
    I have one database. This database is with 7 schemas. Around 1000 triggers are associated with each schema. But the application is using only some triggers.
    How to find out the used triggers? Apllications is developed in J2EE.
    Same way I want to find out the for Packages/Procedures and Functions.
    Any easy way is available?
    Please help me.
    regards
    Mathew

    Hi,
    >Audit the execution event on the objects by access.
    Kindly explain how to enable this auditing.
    regards
    Mathew

  • Encryption of pl/sql package/procedures/function code

    Is it possible to make the code inside a package/procedure/function un readable to other users.
    As is some of the api package body code in portal ?
    thanks in anticipation.
    SD,

    PL/SQL Wrap Utilityhttp://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96624/c_wrap.htm#LNPLS016
    Note, however that you cannot revert back to original un-wrapped code from a code that has been wrapped. You would need access to the original source files to get the original source code.

  • How to Create a PDF file from database package/procedure in 10g?

    Hi,
    Is there a way to create a pdf file in 10g Application Server using PL/SQL package/procedure in 10g database?
    Thanks in advance.
    Regards
    Vishnu Nekkanti

    http://technology.amis.nl/2010/10/20/as_pdf-generating-a-pdf-document-with-some-plsql/
    http://technology.amis.nl/2012/04/11/generating-a-pdf-document-with-some-plsql-as_pdf_mini-as_pdf3/

  • How to know (package , procedures or functions) name for current sessions

    Hi all
    I'm DBA and i want to find way to get object name whatever (package , procedures or functions) for current running statement in active session.
    To clarify when i open session browser from toad i can see active sessions and see current statement for every session but without the name of the object.
    Is there any way to know this point.
    thanks in advance

    select *
      from dba_objects
    where object_id in (select nvl(t.PLSQL_ENTRY_OBJECT_ID,-1)
                           from v$session t
                          where sid = 452)
    Ramin Hashimzade

  • Calling a package.procedure that accepts a type table.

    I'm getting the error "Error(45,20): PLS-00330: invalid use of type name or subtype name" when I run the procedure SP when it calls the d.is_date procedure that accepts a table as the second parameter.
    below is the Abbreviated code for the package.procedures that contain the "is_date".
    I've tried several things and can't seem to get SP to compile.
    thanks.
    create or replace
    PROCEDURE SP AS
    valid_out boolean;
    date_out date;
    date_fmt_out varchar2(30);
    type Mask_Tabtype is
    table of varchar2( 30 )
    index by binary_integer;
    Fmts Mask_Tabtype;
    BEGIN
    Fmts( 1 ) := 'fxDD-MON-RR';
    Fmts( 2 ) := 'fxDD-MON-YYYY';
    Fmts( 3 ) := 'fxDD-MON';
    Fmts( 4 ) := 'fxMM/DD';
    Fmts( 5 ) := 'fxMM/RRRR';
    d.Is_Date( 'test', Mask_Tabtype, Valid_out, Date_out, Date_Fmt_out);
    END SP;
    create or replace package d as
    type Mask_Tabtype is
    table of varchar2( 30 )
    index by binary_integer;
    Fmts Mask_Tabtype;
    Procedure Is_Date( Value_in in varchar2,
    Tab in Mask_Tabtype,
    Valid_out out boolean,
    Date_out out date,
    Date_Fmt_out out varchar2);
    end d;
    create or replace package body d as
    Fmt_Count integer;
    Date_Val date := null;
    Date_Fmt varchar2( 30 ) := 'fxMM/DD/YYYY';
    Procedure Is_Date(value_in in varchar2, Tab In Mask_Tabtype,
    Valid_out out boolean, Date_out out date, Date_Fmt_Out out varchar2)
    is
    begin
    /* Logic here removed to make post smaller
    End Is_date;
    End d;

    Here...
    d.Is_Date( 'test', Mask_Tabtype, Valid_out, Date_out, Date_Fmt_out);you are passing in Mast_Tabtype, which is a type declaration, rather than a variable of that type.
    Try...
    d.Is_Date( 'test', Fmts, Valid_out, Date_out, Date_Fmt_out);

  • How to give grant permission on packaged procedure

    Hi ,
    This is Ramesh  what is my requirement is i want give permission packaged procedure that means i given permission  only procedure not entire package it is possible or  not? if yes then why
    given example

    Hi,
    You  can't  give grant to package.function or procedure.
    You  can do that following way.
    SQL> create or replace package p is function f return number; end p;
      2  /
    Package created.
    SQL> create or replace function f return number is begin return p.f; end;
      2  /
    Function created.
    SQL> grant execute on f to scott;
    Grant succeeded.
    Regards
    Mahir M. Quluzade

Maybe you are looking for