Package creation in SQL*Plus

DB Version: 10gR2
Sometimes, we have huge Packages, stored procs to compile. I don't want the entire code of Package to be 'Echoed'. I just want to see if a particular package/SP/Function has been Compiled succesfully or not.
So, i set the ECHO to off.
set echo off
set feedback on
set define off
Spool test9.log
create table xyz_tab1
  empid          varchar2(15 byte)           not null,
  emp_Code       varchar2(15 byte)           not null,
  updated_c      varchar2(1 byte)            not null
alter table xyz_tab1 add constraint pk_xyz_tab1 primary key (empid, emp_Code);
CREATE OR REPLACE PACKAGE lms
AUTHID CURRENT_USER
AS
FUNCTION get_emp_x
   (in_code            NUMBER,
   iv_period            VARCHAR2,
   iv_emp_id            VARCHAR2,
   id_date            DATE
   RETURN VARCHAR2;
end ;
spool off;But it doesn't say which procedure got created (or errored in compilation)
SQL > drop table xyz_tab1;
Table dropped.
MANU:rac > @test.sql
Table created.
Table altered.
Package created.
SQL >How can I get the Package/SP name to be printed ?

you could use PROMPT:
PROMPT Create Package: lms
CREATE OR REPLACE PACKAGE lms
AUTHID CURRENT_USER
AS
FUNCTION get_emp_x
   (in_code            NUMBER,
   iv_period            VARCHAR2,
   iv_emp_id            VARCHAR2,
   id_date            DATE
   RETURN VARCHAR2;
end ;
{Code}
Output:
Create Package: lms
Package created.
Edited by: jowahl on 19.10.2010 13:35                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • Reading package contents in SQL Plus

    Hi,
    I'd asked a similar question last week, but didn't see it responded to with a proper reply.
    Ive created a package in SQL Plus, and much like you use the DESCRIBE command to see info on tables that are created, I'd like to see the contents and script of my package to verify some contents of it.
    How can I do that? Or can I do that?
    I've read this:
    http://download-west.oracle.com/docs/cd/A87860_01/doc/appdev.817/a77069/08_packs.htm#4376
    But it doesn't explain within how to go about doing that if indeed that is possible at all. Would anyone that knows if this can be done please reply with the way to do it?
    Thanks!

    Hi,
    You can query USER_SOURCE (or ALL_SOURCE, at your choice) to get what you need.
    Consider:
    SQL> create or replace package small is
      2    procedure Test;
      3  end;
      4  /
    Package created.
    SQL> create or replace package body small is
      2
      3  procedure Test is
      4  begin
      5    null;
      6  end;
      7
      8  end;
      9  /
    Package body created.We just created simple package, for demonstration purposes. Now, we're about to view its source:
    SQL> column text format a100
    SQL>
    SQL> select line, text
      2    from user_source
      3   where name = 'SMALL'
      4     and type = 'PACKAGE'
      5   order by line;
          LINE TEXT
             1 package small is
             2   procedure Test;
             3 end;
    SQL> select line, text
      2    from user_source
      3   where name = 'SMALL'
      4     and type = 'PACKAGE BODY'
      5   order by line;
          LINE TEXT
             1 package body small is
             2
             3 procedure Test is
             4 begin
             5   null;
             6 end;
             7
             8 end;
    8 rows selected.
    SQL>Alternatively, you can make use of DBMS_METADATA package.
    Regards.

  • Help Using SQL*Plus Format Commands (like TTITLE) in Packages

    Where (within a package) can/should SQL*Plus format commands such as TTITLE, COLUMN & BREAK be coded?

    A package is coded in PL/SQL.
    TTITLE, COLUMN and BREAK are SQL*Plus commands, they cannot be used in PL/SQL.
    If you want to output data (using dbms_output) in your package, you'll have to implement the features yourself. But probably just using SQL*Plus is better in your case.
    Regards,
    Rob.

  • SQL*Plus crash due to PL/SQL package compilation

    The problem:
    SQL*Plus crash due to creation large PL/SQL with windows dump error.
    But if insert that package using for example ToAD it works fine.
    The solution:
    I have increased processes parameter in spfile from 40 up to 400. I think it is no need to increase the parameter to such large value, but this value is works.

    emss wrote:
    Can a .sql sql*plus script be called from a pl/sql package? I so, can someone provide a brief example?Not really - there is no easy interface.
    There are interfaces that are not easy. You could instead
    * use DBMS_SCHEDULER to create a host call to execute an OS script to execute the SQL*PLUS script
    * use a java stored procedure to do the same thing
    Do a web search to find examples

  • Execution of Immediate SQL in compiled package in two versions of SQL*PLUS

    A peculiar problem has risen in our database.
    Execution of Immediate SQL in compiled package in two versions of SQLPLUS gives different results
    We have a compiled package with two procedures that contain immediate SQL statements, and these are:
    +PROC_DELETE_ROWS+
    +     -- This immediate sql deletes unreferenced Document Types from the DOC_REF_TYPE table+
    +     delete from doc_ref_type t where exists (select 1 from PROARC_DOC_REF_TYPE_VW d where d.doc_ref_type = t.doc_ref_type)+
       +     and not exists (select 1 from doc_ref d where d.doc_ref_type = t.doc_ref_type)+
       +     and doc_ref_type not in (select doc_ref_type from eis_doc_ref_type)+
       +     and doc_ref_type not in (select eis_doc_ref_type from eis_doc_ref_type)+
    +PROC_ADD_NEW_ROWS+
    +     -- Drop the temporary table+
    +     drop table TMP_PROARC_DOC_REF_TYPE+
    +     -- Create a temporary table+
    +     create table tmp_PROARC_DOC_REF_TYPE as+
    +     select DOC_REF_TYPE, substr(DOC_REF_TYPE_DESC,1,100) as DOC_REF_TYPE_DESC+
    +     from PROARC_DOC_REF_TYPE_VW+
    +     -- Insert document types that do not exist in the DOC_REF_TYPE table+
    +     insert into doc_ref_type t (DOC_REF_TYPE, DOC_REF_TYPE_DESC)+
            +     select distinct DOC_REF_TYPE, DOC_REF_TYPE_DESC from tmp_PROARC_DOC_REF_TYPE s+
            +     where not exists (select 1 from doc_ref_type t where t.doc_ref_type = s.doc_ref_type)+
    I am using the following test script:
    +Exec mypackage.proc_delete_rows;+
    +Commit;+
    +Select count(*) from DOC_REF_TYPES;+
    +Exec mypackage.proc_add_new_rows;+
    +Commit;+
    +Select count(*) from DOC_REF_TYPES;+We have a Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit
    I am using SQL*Plus: Release 8.1.7.0.0
    The test script is working as expected.
    Count after delete =155
    Count after insert = 511
    but when I use another computer with SQL*Plus: Release 10.x
    The Test script returns the following
    Count after delete =155
    Count after insert =155
    The same is happening when I am running the scripts as a scheduled job.
    QUESTION:
    I believe I have found a fix for the problem though. By changing tmp_PROARC_DOC_REF_TYPE in the insert statement to all upper case, the script is running in both environments apparently. But how is this possible? I am executing a compiled package in the database. The session shell should have no impact on the behaveour of the procedure I am calling. What causes this?
    Edited by: Reon on Jun 16, 2011 4:44 AM

    1) I am using the same user (PANDORA)
    2) (PANDORA) for both
    3) I am actually not handling any errors. Just skipping any error altogether. I'll check to see what exceptions are raised, and come back.
    I have also noticed that SQL/PLUS is not the culprit here. If I use SQLTools 1.5 to run the script, the same thing happens. So it has to do something with the connection or session environment that is inheritet to both clients.
    The CODEZ:_
      procedure add_doc_types IS
      sqlstr     VARCHAR2(2000);
      begin
      BEGIN
           sqlstr := 'drop table TMP_PROARC_DOC_REF_TYPE';
         EXECUTE IMMEDIATE sqlstr;
        EXCEPTION
          WHEN OTHERS THEN
            null;
        END;
      BEGIN
           sqlstr := 'create table tmp_PROARC_DOC_REF_TYPE as select DOC_REF_TYPE, substr(DOC_REF_TYPE_DESC,1,100) as DOC_REF_TYPE_DESC from PROARC_DOC_REF_TYPE_VW';
         EXECUTE IMMEDIATE sqlstr;
        EXCEPTION
          WHEN OTHERS THEN
            null;
        END;
        BEGIN
            sqlstr := 'insert into doc_ref_type t (DOC_REF_TYPE, DOC_REF_TYPE_DESC)
                    select distinct DOC_REF_TYPE, DOC_REF_TYPE_DESC from TMP_PROARC_DOC_REF_TYPE s
                    where not exists (select 1 from doc_ref_type t where t.doc_ref_type = s.doc_ref_type)';
         EXECUTE IMMEDIATE sqlstr;
            sqlstr := 'update doc_ref_type t set DOC_REF_TYPE_DESC = (
                    select DOC_REF_TYPE_DESC from tmp_PROARC_DOC_REF_TYPE s
                    where t.doc_ref_type = s.doc_ref_type)
                    where exists (select 1 from tmp_PROARC_DOC_REF_TYPE s where t.doc_ref_type = s.doc_ref_type)';
         EXECUTE IMMEDIATE sqlstr;
        EXCEPTION
          WHEN OTHERS THEN
            null;
        END;
      end add_doc_types;
      procedure delete_doc_types IS
      sqlstr     VARCHAR2(2000);
       BEGIN
            sqlstr := 'delete from doc_ref_type t where exists (select 1 from PROARC_DOC_REF_TYPE_VW d where d.doc_ref_type = t.doc_ref_type)
            and not exists (select 1 from doc_ref d where d.doc_ref_type = t.doc_ref_type)
            and doc_ref_type not in (select doc_ref_type from eis_doc_ref_type)
            and doc_ref_type not in (select eis_doc_ref_type from eis_doc_ref_type)';
          EXECUTE IMMEDIATE sqlstr;
         EXCEPTION
           WHEN OTHERS THEN
             null;
      end delete_doc_types;Edited by: Reon on Jun 16, 2011 2:01 AM

  • Creating a package in sql*plus

    Dear all;
    Do you know what is wrong with this statement
    SQL> create or replace pkg_initial_comment as procedure save_initial_comment(p_i
    d number, p_first_name varchar2, p_last_name varchar2, p_comment varchar2, p_dat
    e date); end save_initial_comment; create or replace package body pkg_initial_co
    mment as procedure save_initial (p_id number, p_comments varchar2, p_first_name
    varchar2, p_last_name varchar2, p_date date) is begin insert into initial_commen
    ts values (1, p_first_name, p_last_name, p_comment, sysdate); end save_initial;
    end pkg_initial_comment;
    create or replace pkg_initial_comment as procedure save_initial_comment(p_id num
    ber, p_first_name varchar2, p_last_name varchar2, p_comment varchar2, p_date dat
    e); end save_initial_comment; create or replace package body pkg_initial_comment
    as procedure save_initial (p_id number, p_comments varchar2, p_first_name varch
    ar2, p_last_name varchar2, p_date date) is begin insert into initial_comments va
    lues (1, p_first_name, p_last_name, p_comment, sysdate); end save_initial; end p
    kg_initial_commentI keep getting the following error message
    ora-00922:
    and my table structure is below
    create table initial_comment (id number(30),
    first_name varchar2(4000), last_name varchar2(4000), create_date date);

    yeah I just realized all my problems, it wasnt just the package keyword, it was also the names were wrong in both the specification and body. I am not used to using sql*plus, i use all other client tools which gives an opportunity to see and understand my syntax clearly. sorry about the posting and formatting. thanks for the help

  • SQL Plus session - "schema.package" has been invalidated on making any chng

    Hi
    I am in the process of testing a stored procedure. Whenever I make changes to the procedure I am executing it from the SQL Plus session. But whenever I make a change to the procedure - i have to close that particular SQL Plus session and open another one. I get the message:
    ORA-06510: PL/SQL: unhandled user-defined exception
    ORA-04061: existing state of has been invalidated
    ORA-04061: existing state of package body
    "schema.package" has been invalidated
    ORA-04065: not executed, altered or dropped package body
    Is there a way that I do not have to open a new SQL Plus session everytime I make change to the package?

    It does not help :(. I get this problem in a SQL+ session only when I make a change in a JDev session. I have to log off the SQL+ session and log back in and it is OK again without re-compling anything. I don't have a problem with two SQL+ session. Isn't that strange?
    ben

  • SQL*Plus add-on for Instant Client Package on Solaris-SPARC 32bits ???

    Hi,
    I need sqlplus for a solaris 32bits platform, but following this page
    http://www.oracle.com/technology/tech/oci/instantclient/instantclient.html, if I choose Solaris 32-bit (SPARC), it doesn't give a link to download Instant Client Package - SQL*Plus (as it does if I choose Solaris 64-bit (SPARC) or Windows 32-bit).
    I don't understand why... :(

    SQL*Plus is not supported on the 32-bit versions of 64-bit platforms. Please use the 64-bit version of SQL*Plus. Thanks!

  • Debugging procedure or packages using sql*plus reg

    Dear all,
    I am new to oracle, can any body provide me some information related to this below issues.
    a) suppose i have created a procedure using sql*plus tool then next day i wanted to debug or modify my stored procedure.
    Then what could approach using sql*plus
    b) same case if we consider for packages then for any specific stored procedure or functions what would be the approach to debug or modify using sql*plus
    yours cordination will be highly appreciate
    Thanks n regards
    Laxman

    Using SQL*Plus you can debug your stored pl/sql code only adding some "prints" in your code:
    SQL> create or replace procedure test is
      2  begin
      3  dbms_output.put_line('starting...');
      4  --do something here
      5  dbms_output.put_line('done step 1');
      6  --do something else here
      7  dbms_output.put_line('end procedure...');
      8  end;
      9  /
    Procedura creata.
    SQL> set serverout on
    SQL> exec test
    starting...
    done step 1
    end procedure...
    Procedura PL/SQL completata correttamente.Or writing logs in a log table:
    SQL> create table logtab(ts timestamp(9),mess varchar2(4000));
    Tabella creata.
    SQL> create or replace procedure test is
      2  begin
      3  insert into logtab values(systimestamp,'starting...');
      4  --do something here
      5  insert into logtab values(systimestamp,'done step 1');
      6  --do something else here
      7  insert into logtab values(systimestamp,'end procedure...');
      8  end;
      9  /
    Procedura creata.
    SQL> exec test
    Procedura PL/SQL completata correttamente.
    SQL> col ts for a40
    SQL> col mess for a40
    SQL> select * from logtab;
    TS                                       MESS
    25-DIC-09 15:33:13,656000000             starting...
    25-DIC-09 15:33:13,656000000             done step 1
    25-DIC-09 15:33:13,656000000             end procedure...Max
    [My Italian Oracle blog|http://oracleitalia.wordpress.com]

  • OLAP commands at sql*plus

    Hi there,
    I installed on my computer the Analytic Workspace Manager 11g to manage olap cubes by using this page http://www.oracle.com/technology/products/bi/olap/index.html. It is a very useful tool which really helped me on building and quering tools, but i wasn't able to find any staff about how to do all this at command prompt "sql*plus".
    So, I would like to know how i can work with olap using commands at a proper command prompt like sqlplus. To be more specific i need commands which:
    1. Define dimensions,levels,hierarchies and cubes at command prompt!
    2. Load data on dimension tables and cubes!
    Also, could you give me a tutorial which organises all OLAP commands?
    Note: If there is no other way but to use the tool i just said, It would be helpful to tell me!

    All metadata/object creation is via the OLAP API (which is Java) so you can't create dimensions and cubes via SQL Plus. You can, however, manage cube maintenance using the dbms_cube package (which can, of course, be called from SQL Plus). See http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28419/d_cube.htm#CFHGDJAA

  • A question about the impact of SQL*PLUS SERVEROUTPUT option on v$sql

    Hello everybody,
    SQL> SELECT * FROM v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0  Production
    TNS for Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    SQL>
    OS : Fedora Core 17 (X86_64) Kernel 3.6.6-1.fc17.x86_64I would like to ask a question about the SQL*Plus SET SERVEROUTPUT ON/OFF option and its impact on queries on views such as v$sql and v$session. Here is the problem
    Actually I define three variables in SQL*Plus in order to store sid, serial# and prev_sql_id columns from v$session in order to be able to use them later, several times in different other queries, while I'm still working in the current session.
    So, here is how I proceed
    SET SERVEROUTPUT ON;  -- I often activate this option as the first line of almost all of my SQL-PL/SQL script files
    SET SQLBLANKLINES ON;
    VARIABLE mysid NUMBER
    VARIABLE myserial# NUMBER;
    VARIABLE saved_sql_id VARCHAR2(13);
    -- So first I store sid and serial# for the current session
    BEGIN
        SELECT sid, serial# INTO :mysid, :myserial#
        FROM v$session
        WHERE audsid = SYS_CONTEXT('UserEnv', 'SessionId');
    END;
    PL/SQL procedure successfully completed.
    -- Just check to see the result
    SQL> SELECT :mysid, :myserial# FROM DUAL;
        :MYSID :MYSERIAL#
           129   1067
    SQL> Now, let's say that I want to run the following query as the last SQL statement run within my current session
    SELECT * FROM employees WHERE salary >= 2800 AND ROWNUM <= 10;According to Oracle® Database Reference 11g Release 2 (11.2) description for v$session
    http://docs.oracle.com/cd/E11882_01/server.112/e25513/dynviews_3016.htm#REFRN30223]
    the column prev_sql_id includes the sql_id of the last sql statement executed for the given sid and serial# which in the case of my example, it will be the above mentioned SELECT query on the employees table. As a result, right after the SELECT statement on the employees table I run the following
    BEGIN
        SELECT prev_sql_id INTO :saved_sql_id
        FROM v$session
        WHERE sid = :mysid AND serial# = :myserial#;
    END;
    PL/SQL procedure successfully completed.
    SQL> SELECT :saved_sql_id FROM DUAL;
    :SAVED_SQL_ID
    9babjv8yq8ru3
    SQL> Having the value of sql_id, I'm supposed to find all information about cursor(s) for my SELECT statement and also its sql_text value in v$sql. Yet here is what I get when I query v$sql upon the stored sql_id
    SELECT child_number, sql_id, sql_text
    FROM v$sql
    WHERE sql_id = :saved_sql_id;
    CHILD_NUMBER   SQL_ID          SQL_TEXT
    0              9babjv8yq8ru3    BEGIN DBMS_OUTPUT.GET_LINES(:LINES, :NUMLINES); END;Therefore instead of
    SELECT * FROM employees WHERE salary >= 2800 AND ROWNUM <= 10;for the value of sql_text I get the following value
    BEGIN DBMS_OUTPUT.GET_LINES(:LINES, :NUMLINES);Which is not of course what I was expecting to find in v$sql for the given sql_id.
    After a bit googling I found the following thread on the OTN forum where it had been suggested (well I think maybe not exactly for the same problem) to turn off SERVEROUTPUT.
    Problem with dbms_xplan.display_cursor
    This was precisely what I did
    SET SERVEROUTPUT OFFafter that I repeated the whole procedure and this time everything worked pretty well as expected. I checked SQL*Plus documentation for SERVEROUTPUT
    and also v$session page, yet I didn't find anything indicating that SERVEROUTPUT should be switched off whenever views such as v$sql, v$session
    are queired. I don't really understand the link in terms of impact that one can have on the other or better to say rather, why there is an impact
    Could anyone kindly make some clarification?
    thanks in advance,
    Regards,
    Dariyoosh

    >
    and also v$session page, yet I didn't find anything indicating that SERVEROUTPUT should be switched off whenever views such as v$sql, v$session
    are queired. I don't really understand the link in terms of impact that one can have on the other or better to say rather, why there is an impact
    Hi Dariyoosh,
    SET SERVEROUTPUT ON has the effect of executing dbms_output.get_lines after each and every statement. Not only related to system view.
    Here below what Tom Kyte is explaining in this page:
    Now, sqlplus sees this functionality and says "hey, would not it be nice for me to dump this buffer to screen for the user?". So, they added the SQLPlus command "set serveroutput on" which does two things
    1) it tells SQLPLUS you would like it <b>to execute dbms_output.get_lines after each and every statement</b>. You would like it to do this network rounding after each call. You would like this extra overhead to take place (think of an install script with hundreds/thousands of statements to be executed -- perhaps, just perhaps you don't want this extra call after every call)
    2) SQLPLUS automatically calls the dbms_output API "enable" to turn on the buffering that happens in the package.Regards.
    Al

  • SQL*PLUS 32 Bit Client needed for Windows 64 Bit

    Hi,
    I have got a 64 Bit Windows OS and an Oracle 11.
    With 32 Bit Applications ( Crystal Reports) I can not run SQL NET Thick, SQL NET Thin and JDBC.
    Oracle 32 Bit Installation is Missing.
    Oracles "Instant Client Downloads for Microsoft Windows (32-bit)" will not do it.
    http://www.oracle.com/technetwork/topics/winsoft-085727.html
    What else to use ?
    Thank You
    Martin Sautter

    Martin.Sautter wrote:
    Hi,
    i used:
    instantclient-basic-nt-11.2.0.2.0.zip (32BitClient)
    instantclient-sqlplus-nt-11.2.0.2.0.zip.
    I did not find an "old", "classic" SQL*PLUs client.What does that mean exactly, classic client?
    Did you unzip the ic sqlplus .zip (the one listed) in the same dir as ic basic?
    After dezipping waht than ?
    No installer, nothing ...That's the beauty of Instant Client, just unzip or move a few files, set PATH if needed, and you have client libraries all "installed" and ready.
    >
    You can give advice ?Generally, required lib files are (n Windows) oci.dll, oraociicusN.dll or oraocieiN.dll (N= e.g. 11). Then for Sql*plus add orasqlplusicN.dll and the .exe from ic-sqlplus package.
    C:\Users\Test\Ora-IClite>dir
    Volume in drive C is OS
    Volume Serial Number is 6E8F-186A
    Directory of C:\Users\Test\Ora-IClite
    2011-12-16  09:30    <DIR>          .
    2011-12-16  09:30    <DIR>          ..
    2011-08-31  11:39                38 ldap.ora
    2011-07-30  12:21           683 008 oci.dll
    2011-07-30  12:21        44 153 856 oraociicus11.dll
    2011-07-30  12:21         1 501 696 Orasqlplusic11.dll
    2011-07-30  12:21           869 376 sqlplus.exe
    C:\Users\Test\Ora-IClite>.\sqlplus user@'localhost/xe'
    SQL*Plus: Release 11.2.0.2.0 Production on Fri Dec 16 09:34:13 2011
    Copyright (c) 1982, 2010, Oracle.  All rights reserved.
    Enter password:Edited by: orafad on Dec 16, 2011 9:35 AM

  • Can't see package body in SQL Developer version 3.1

    Hello,
    Have been scouring the boards and google for this issue for quite some time now. I think I have discovered the issue, but would like to see if a work around exists.
    Problem:
    I am unable to view packages, procs, VIEW DDl, etc. of other users. When a colleague of mine uses Toad, with the EXACT same connection ID and setting, they are in fact able to see all the source code...
    What I've found:
    Looking around, apparently Toad and SQL Dev work in different ways. Toad apparently uses DBA_SOURCE and DBA_OBJECTS to generate everything.
    SQL Dev uses the META_DATA package to retrieve everything. Further, in order to use the meta_data package, I need the grant catalog role, or something like that.
    Is there a way to set up SQL Developer to use the same method as Toad to retrieve the code? It's a fact that I WILL NOT receive the catalog permission per the DBAs... I can write out the
    select text from DBA_SOURCE where OWNER = 'OWNER' and NAME = 'OBJECT NAME';
    But, I would prefer to just be able to use the tree nodes and click on objects to generate all this. Anyone know of any setting for this?

    Hi,
    No doubt SQL Developer wants to be competitive with Toad but, in terms of raising red flags over inconsistencies in basic functionality, any difference versus SQL*Plus would be more surprising than versus Toad.
    DBA_SOURCE and DBA_OBJECTS are public synonyms available in any standard Oracle installation, but you also need the SELECT ANY DICTIONARY privilege to get maximum benefit from them. That lets you view code in another user's schema without having an explicit privilege (like EXECUTE) on a package/procedure/function.
    If you already do have such privileges (either SELECT ANY DICTIONARY, or EXECUTE or DEBUG on specific executable objects), and the Code tab is empty, then you will need to provide a test case, as Vadim indicates.
    In terms of any case where SQL Developer utilizes DBMS_METADATA, my understanding is the API relies on the SELECT_CATALOG_ROLE privilege if a user does not own or otherwise have an explicitly granted privilege on an object. Developers like to use this API wherever possible in place of writing a script that might break or need maintenance to deal with future versions of the Oracle database.
    I have no idea how Toad works, and I probably shouldn't speculate, but here is one scenario that could explain the case you mention without the connection user having any of the privileges noted above. Let's say the Toad client software calls a PL/SQL package that selects from DBA_SOURCE and is installed in a schema that has the SELECT ANY DICTIONARY privilege. All Toad users are granted EXECUTE on this package and therefore inherit SELECT ANY DICTIONARY in the context of running the package. This will work, but at the price of complicating installation of Toad. Also, it doesn't afford an administrator fine-grained control over metadata security.
    Regards,
    Gary
    SQL Developer Team

  • && Substitution Variable in Package Body using SQL Developer

    Hi Folks,
    I've moved over to working to in SQL Developer (its a very early version - 1.0.0) from a combination of SQL*Plus command line and a text editor. I'm trying to get this upgrgraded, but I think the question will be the same with a newer version anyway.
    I am creating a package, and in the package body I have some &&my_var substitutions that I was previoulsy prompted for when calling the .sql from the command line SQL*Plus. I need this as the variable needs to be different for the development and live environment.
    When working in SQL Developer, I can load the package body from Connection->Packages->My Package->My Package Body, and click the edit button to edit the code, however, when I click the Compile button in the top of the window my code error's because of the substituion variablle. An example is:
    CREATE OR REPLACE
    PACKAGE BODY MY_PACKAGE AS
    PROCEDURE MY_PROCEDURE
    BEGIN
    my_variable := &&my_function_from_live_or_dev_database
    END MY_PROCEDURE
    Can anyone tell me if there is a way of defining a compiler variable within the IDE widow while editing a package body stored in the database, without manually copying the code into the Worksheet and running it as a script?
    Thanks,
    AM

    953104 wrote:
    Thanks for the reply, the code was just quickly typed to show the sort of thing I am doing, it wasn't actual code form my project.
    I've come from a C background so what I would have done would be create a #define and changed to when on live or development - or passed the variable to the build environment from the IDE or makefiles and the change would have reflected through my whole project.
    What I want to be able to do is alter a definition of some sort that will reflect throughout my whole project, so I can change it in one location to minimize code changes before going live. I don't really want to be prompted at all. On one system it needs to be DEV_10 and on the other it needs to be LIVE_10.Is there a possibility to elimiante this difference at all?
    For example if DEV_10 is the oracle schemauser on the development database and LIVE_10 would be the one on the production system. THen you could just remove all references to the schema from your code.
    IF you are already connected to this schema, then you don't need to specify the schema name anymore.
    example
    instead of
    create or replace package dev_10.myPackage
    ...you can simply use
    create or replace package myPackage
    ...If needed you can alter the cuurently connected user just before you run the script.
    alter session set current_schema = LIVE10;
    create or replace package myPackage
    ...This would be a different working window in the developer (script worksheet, instead of direct pl/sql editor).
    Substitution variables are allowed there.

  • How to execute a mapping in sql plus?

    hi,
    OWB generate a package code from the mapping, for example if I have a package named map1, what is the request to execute ,in SQL
    PLUS, map1.main() which is the function main of this package?
    Thank you

    Hi
    There is a MAIN procedure you can use, if you have no mapping input parameters defined it will be like;
    PROCEDURE Main(p_status OUT VARCHAR2,
    p_max_no_of_errors IN VARCHAR2 DEFAULT NULL,
    p_commit_frequency IN VARCHAR2 DEFAULT NULL,
    p_operating_mode IN VARCHAR2 DEFAULT NULL,
    p_bulk_size IN VARCHAR2 DEFAULT NULL,
    p_audit_level IN VARCHAR2 DEFAULT NULL,
    p_purge_group IN VARCHAR2 DEFAULT NULL,
    p_job_audit IN VARCHAR2 DEFAULT 'TRUE');
    If you define mapping input parameters they will also be included in the signature of this procedure.
    See this post here for some details;
    http://blogs.oracle.com/warehousebuilder/2008/11/using_3rd_party_schedulers_with_owb_1.html
    Cheers
    David

Maybe you are looking for

  • Crystal report - sub report

    Hi everyone Can anybody help me with crystal report - sub report problem  as i am new to crystal report. I have created two reports"mainreport" and "subreport" using crysta report XI with the same query for both reports using stored procedure. I set

  • HT201250 Need info about TM re-set

    Hi I've had my TM unplugged for about three months due to renovations. In that time we have also changed internet service provider and therefore have a new network and password. However I can't get my TM on to this wireless network. If I re-set the T

  • I need the names of standard smartform for FI module.

    i need the names of standard smartform for FI module or if possible if one can provide the smart form for FI - CML & FI - CFM module (new module introduced).

  • EMET 4.1 (Update 1) - GPO Settings

    We have successfully deployed EMET 4.1 Update 1 via SCCM and now I am controlling EMET settings with GPO using the EMET GPO templates from the Deployment folder. However, after group policy is set, you have to use the command "emet_conf.exe --refresh

  • MB21 Sachkonto

    Hello, We have a problem with the language of the field "G / L Account" in the transaction MB21 (New Items) Our system is on French, all the fields of this transaction are on French but the field "G / L Account" is on German ('Sachkonto') while on Fr