Calling package from another package

Hi gurus,
Quick question
Say i m in user1 schema.
I want to call package from another package in the same schema. So do i need to grant permission to the calling package to call.Thank you!!

Why don't you test it?
create or replace package pack2
is
  procedure t2;
end;
Package created.
create or replace package body pack2
is
  procedure t2
  is
  begin
   dbms_output.put_line('Inside Pack2 And t2');
  end;
end;
Package Body created.
create or replace package pack1
is
  procedure t1;
end;
Package created.
create or replace package body pack1
is
  procedure t1
  is
  begin
    pack2.t2;
    dbms_output.put_line('Inside Pack1 And t1');
  end;
end;
Package Body created.
begin
pack1.t1;
end;
Inside Pack2 And t2
Inside Pack1 And t1
Statement processed.
0.11 secondsRegards.
Satyaki De

Similar Messages

  • Can we call an ODI package from another ODI package within same Project?

    hi All,
    Can we call an ODI package from another ODI package within same Project?

    What you can do is get all the interfaces on the old package that you want to be included in the new package. This way, the new package will have the exact code from the old package.Or generate a scenario out of your ("old") package and drag&drop the scenario in the "new" package.
    That seems easier to me, because you can re-use the scenario as often as you want.
    But you have to take care: If you change your original ("old") package, you have to regenerate the scenario, otherwise the changes do not affect the scenario.
    Edited by: h_elmu_t on 02.07.2009 08:50

  • NetBeans: Calling code from other packages?

    Normally, when I would call code from eclipse, I would type something like:
    import +<package name>.<class name>+But somehow, this approach doesn't seem to work in NetBeans, how can I import code from another package? I can seem to import from the same package, but not a different one.
    Edited by: px7659 on Jun 15, 2010 6:21 PM

    px7659 wrote:
    Normally, when I would call code from eclipse, I would type something like:
    import +<package name>.<class name>+But somehow, this approach doesn't seem to work in NetBeans, how can I import code from another package? I can seem to import from the same package, but not a different one.Then the package is not part of the project. Did you perhaps forget to add the jar library in question?

  • Instantiating a class from another package

    Hi,
    I have two packages, say "framework" and "impl" -
    framework package (framework.jar)
    - contains base classes
    - contains factories to instantiate concrete classes
    - bundled in <product>.ear
    impl package (impl.jar)
    - contains implementation(concrete) classes
    - compile time dependency on framework.jar
    - bundled in <product>.ear
    I could successfully compiled and build <product>.ear which contains both the jars. The ear gets deployed successfully.
    PROBLEM
    Now, whenever a factory class (part of framework package) tries to instantitate an impl class (part of impl package) using -
    Class.forName(impl.ConcreteClassName OR fully_qualified_concrete_class_name).newInstance();
    It throws "classNotFoundException". It is not able to locate the concrete class.
    So, my question is how can i instantiate a class using its fully qualified name(package.classname) from another package ?
    Thanks.

    909219 wrote:
    PROBLEM
    Now, whenever a factory class (part of framework package) tries to instantitate an impl class (part of impl package) using -
    Class.forName(impl.ConcreteClassName OR fully_qualified_concrete_class_name).newInstance();
    It throws "classNotFoundException". It is not able to locate the concrete class.This sound like a classpath problem. Check your ear's manifest.
    BTW:
    Shouldn't the framework better use ServiceRegistry to load implementations?
    bye
    TPD

  • How to import a class not in the package from a package

    how to import a class not in the package from a package?

    http://java.sun.com/docs/books/tutorial/java/interpack/usepkgs.html

  • Is it possible to call methods from another class from within an abstract c

    Is it possible to call methods from another class from within an abstract class ?

    I found an example in teh JDK 131 JFC that may help you. I t is using swing interface and JTable
    If you can not use Swing, then you may want to do digging or try out with the idea presented here in example 3
    Notice that one should refine the abstract table model and you may want to create a method for something like
    public Object getValuesAtRow(int row) { return data[row;}
    to give the desired row and leave the method for
    getValuesAt alone for getting valued of particaular row and column.
    So Once you got the seelcted row index, idxSelctd, from your table
    you can get the row or set the row in your table model
    public TableExample3() {
    JFrame frame = new JFrame("Table");
    frame.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {System.exit(0);}});
    // Take the dummy data from SwingSet.
    final String[] names = {"First Name", "Last Name", "Favorite Color",
    "Favorite Number", "Vegetarian"};
    final Object[][] data = {
         {"Mark", "Andrews", "Red", new Integer(2), new Boolean(true)},
         {"Tom", "Ball", "Blue", new Integer(99), new Boolean(false)},
         {"Alan", "Chung", "Green", new Integer(838), new Boolean(false)},
         {"Jeff", "Dinkins", "Turquois", new Integer(8), new Boolean(true)},
         {"Amy", "Fowler", "Yellow", new Integer(3), new Boolean(false)},
         {"Brian", "Gerhold", "Green", new Integer(0), new Boolean(false)},
         {"James", "Gosling", "Pink", new Integer(21), new Boolean(false)},
         {"David", "Karlton", "Red", new Integer(1), new Boolean(false)},
         {"Dave", "Kloba", "Yellow", new Integer(14), new Boolean(false)},
         {"Peter", "Korn", "Purple", new Integer(12), new Boolean(false)},
         {"Phil", "Milne", "Purple", new Integer(3), new Boolean(false)},
         {"Dave", "Moore", "Green", new Integer(88), new Boolean(false)},
         {"Hans", "Muller", "Maroon", new Integer(5), new Boolean(false)},
         {"Rick", "Levenson", "Blue", new Integer(2), new Boolean(false)},
         {"Tim", "Prinzing", "Blue", new Integer(22), new Boolean(false)},
         {"Chester", "Rose", "Black", new Integer(0), new Boolean(false)},
         {"Ray", "Ryan", "Gray", new Integer(77), new Boolean(false)},
         {"Georges", "Saab", "Red", new Integer(4), new Boolean(false)},
         {"Willie", "Walker", "Phthalo Blue", new Integer(4), new Boolean(false)},
         {"Kathy", "Walrath", "Blue", new Integer(8), new Boolean(false)},
         {"Arnaud", "Weber", "Green", new Integer(44), new Boolean(false)}
    // Create a model of the data.
    TableModel dataModel = new AbstractTableModel() {
    // These methods always need to be implemented.
    public int getColumnCount() { return names.length; }
    public int getRowCount() { return data.length;}
    public Object getValueAt(int row, int col) {return data[row][col];}
    // The default implementations of these methods in
    // AbstractTableModel would work, but we can refine them.
    public String getColumnName(int column) {return names[column];}
    public Class getColumnClass(int col) {return getValueAt(0,col).getClass();}
    public boolean isCellEditable(int row, int col) {return (col==4);}
    public void setValueAt(Object aValue, int row, int column) {
    data[row][column] = aValue;
    };

  • We have a 5s active on our account.  After turning on a previously active 4s (it had the same number)  The 5s can no longer place call and when you call it from another phone the 4s rings, but will not pick up.  Texting over the cell networks works fine.

    We have a 5s active on our account.  After turning on a previously active 4s (it had the same number)  The 5s can no longer place call and when you call it from another phone the 4s rings, but will not pick up.  Texting over the cell networks works fine.  Any suggestions??

    hens0861,
    Hmm, let's ensure this is working as it should be! So what phone should be active on your account? Did you switch the devices online or how to did you activate the 5s? Please share details.
    KarenC_VZW
    Follow us on Twitter @VZWSupport

  • A package is considered invalid from another package when it isn't

    Hi all,
    I have two packages, A and B. I have unit test for both packages. B uses some procedures from A. After they are compiled (A first, then B), when I run the unit test for B in sqlplus, I get
    ORA-04068: existing state of packages has been discarded
    ORA-04065: not executed, altered or dropped stored procedure "my_schema.A"
    ORA-06508: PL/SQL: could not find program unit being called
    ORA-06512: at "my_schema.B", line 886
    ORA-06512: at line 6
    But if I run the unit test for A, it works perfectly (so I think A has been compiled correctly and could be found in the database).
    For those who have read my post yesterday titled 'existing state of packages has been discarded', this is the same problem. Sorry for posting twice but I really need to get this working.
    Thanks.
    Gloria Chung

    This shouldn't be a problem if you are running the unit tests in the same session as you are recompiling the packages.
    Basically, package A must be storing values in package level variables. Like this...
    SQL1> CREATE OR REPLACE PACKAGE ap AS
    2 FUNCTION f RETURN number;
    3 END;
    4 /
    Package created.
    SQL1> CREATE OR REPLACE PACKAGE BODY ap AS
    2 FUNCTION f RETURN number IS
    3 BEGIN
    4 RETURN 2;
    5 END;
    6 END;
    7 /
    Package body created.
    SQL1> CREATE OR REPLACE PACKAGE bp AS
    2 FUNCTION f RETURN NUMBER;
    3 END;
    4 /
    Package created.
    SQL1> CREATE OR REPLACE PACKAGE BODY bp AS
    2 n NUMBER;
    3 FUNCTION f RETURN NUMBER IS
    4 BEGIN
    5 n := n + ap.f;
    6 RETURN n;
    7 END;
    8 BEGIN
    9 n := 0;
    10 END;
    11 /
    Package body created.
    SQL1>
    Now we can use that in another session...
    SQL2> var x number
    SQL2> exec :x := bp.f
    PL/SQL procedure successfully completed.
    SQL2> print x
             X
             2
    SQL2>So far so good. Now in the first session we run ...
    SQL1> CREATE OR REPLACE PACKAGE BODY bp AS
      2    n NUMBER;
      3    FUNCTION f RETURN NUMBER IS
      4    BEGIN
      5       n := n * ap.f;
      6       RETURN n;
      7    END;
      8  BEGIN
      9      n := 4;
    10  END;
    11  /
    Package body created.
    SQL1> back in session two...
    SQL2> exec :x := bp.f
    BEGIN :x := bp.f; END;
    ERROR at line 1:
    ORA-04068: existing state of packages has been discarded
    ORA-04061: existing state of package body "APC.BP" has been invalidated
    ORA-04065: not executed, altered or dropped package body "APC.BP"
    ORA-06508: PL/SQL: could not find program unit being called
    ORA-06512: at line 1
    SQL2>aaargh! disaster! But all we have to do is ...
    SQL2> conn apc/apc
    Connected.
    SQL2> var x number
    SQL2> exec :x := bp.f
    PL/SQL procedure successfully completed.
    SQL2> print x
             X
             8
    SQL2> I'm not saying its satisfactory, because obviously it isn't. But I don't see what else Oracle can do.
    Cheers, APC

  • Running SSIS Package from another server and performance

    I've built an SSIS package that integrates data from one SQL Server 2008 database to another SQL Server 2008 database.  However, since I needed to leverage some SSIS 2012 components, I've installed the package on another SQL Server 2012 in the network.
    Is there a performance hit (positive or negative) if I run a SSIS package on a SQL Server that isn't the source or destination server?

    Hi,
    we cannot tell for sure. It depends on so many things, amount of data to be transferred, processing needs to be done, overall capacity of the server, workloads that can be handleld by the servers, etc. The mos important aspect but nt the only one is the
    amount of data to be access / tranformed / processed / transmitted to the destination.
    This is a typical case for a test done representative amount of data in a load test on your side.
    -Jens
    Jens K. Suessmeyer http://blogs.msdn.com/Jenss

  • Executing another class from another package with a click of a button

    package language;
    textfield_4 = new JTextField();
    getContentPane().add(textfield_4);
    button_10 = new JButton("Open");
        getContentPane().add(button_10);
        button_10.addActionListener(new java.awt.event.ActionListener()
          public void actionPerformed(ActionEvent e)
            String cmd = "notepad.exe";
            String path = textfield_4.getText();
            try
              Runtime.getRuntime().exec(cmd + " \"" + path + "\"");
            catch (IOException ex)
              ex.printStackTrace();
        button_12 = new JButton("Run");
        getContentPane().add(button_12);From the codes above, what i intended to do is when clicking the "Run" button, it will pass the values from textfield_4 to another class in another package thus, executing the class with the value of textfield_4. What are the steps to do that? If possible, please insert sample codes. Thank you.

    import  anyPackage.AnotherClass;
    button_12.addActionListener(new ActionListener() {
      AnotherClass ac = new AnotherClass();
      ac.execute(textfield_4.getText());
    });Is that what you wanted?

  • Package importing problem from 1 package to another package.

    Hi All,
    I have made to package, "forum" and "utility". DBhandler java file is in "utility" package and Forumhandler is in "forum" package.
    I want to import DBhandler classes from "utility" package into "forum" package for this i write
    "import utility.*" in forum package's Forumhandler java file. But it is giving error.
    The error is -
    forum/ForumHandler.java:13: cannot resolve symbol
    symbol : class DBHandler
    location: class forum.ForumHandler
    DBHandler dbhand = new DBHandler();

    is the class DBHandler declared a public class in utitlity? Does it start with the line
    package utitility;
    Is it in the directory:
    %CLASSPATH%/utility/
    Have you read the tutorials and done a search for packages on these forums?

  • Compiling application (with several sub-packages) from another java app

    Hi,
    I'm writing my own build tool and need to be able to compile an external application (pulled from cvs, subversion, ...) from within this build tool.
    Probably I need to use com.sun.tools.javac.Main.compile ?
    But how do I pass classpath, output dir, etc to this class and how can I make it compile all files in all (sub)packages of the given folder ?
    thanks for any help.

    Never mind my previous post, I found a solution to the "the input line is too long" problem:
    Putting all the files in a temporary file and then providing that file as the source to compile, like this:
    javac -g:none -cp <classpath> -d classes @sourcefiles.txtwhere sourcefiles.txt is the name of the temporary file that contains the names of the source files (note the "@"-prefix)
    For some reason, this is not mentioned/documented in the java docs (at least not in my docs)
    Ok, so everything is compiling now, but I have one problem remaining:
    For each "module" that I compile (the application I use for my tests consists of several "modules", i.e. subpackages), I get an error stating that "The system cannot find the path specified"
    This seems obvious, because it is trying to write a file <package-name>\classes\<package-name>\<classname>.class
    But why is it trying to write that file ?
    -> Is this a known bug or something ?
    Let me explain a little more...
    For each compilation I do using the com.sun.tools.javac.Main.compile() method, it is giving this error.
    Everything is compiling correctly, but it seems it is trying to write an extra class file to a wrong path.
    Until now, it was always the first file in the row that gave the problem.
    Example:
    ** module 1:
    sources/com/example/module1/class1.java
    sources/com/example/module1/class2.java
    sources/com/example/module1/class3.java
    sources/com/example/module1/sub1/subclass1.java
    sources/com/example/module1/sub1/subclass2.java
    sources/com/example/module1/sub1/subclass3.java
    ** module 2:
    sources/com/example/module2/class1.java
    sources/com/example/module2/class2.java
    sources/com/example/module2/class3.java
    sources/com/example/module2/sub1/subclass1.java
    sources/com/example/module2/sub1/subclass2.java
    sources/com/example/module2/sub1/subclass3.java
    => My application will compile module 1, do some other things with it and the module 2 and again do some other things with it.
    The result would be:
    Application started.
    Loading configuration: OK
    Compiling sources for module module1: E:\temp\_User_\project\packaging\workingdir\source\com/example/module1\class1.java:12: error while writing com.example.module1.class1: com\example\module1\classes\com\example\module1\class1.class (The system cannot find the path specified)public class class1 extends Thread {
           ^
    Note: Some input files use or override a deprecated API.
    Note: Recompile with -deprecation for details.
    1 error
    OK
    Note: Contents of my classes directory for module1:
    classes/com/example/module1/class1.class
    classes/com/example/module1/class2.class
    classes/com/example/module1/class3.class
    classes/com/example/module1/sub1/subclass1.class
    classes/com/example/module1/sub1/subclass2.class
    classes/com/example/module1/sub1/subclass3.class
    => all class files are correctly compiled
    Compiling sources for module module2: E:\temp\_User_\project\packaging\workingdir\source\com/example/module2\class1.java:12: error while writing com.example.module2.class1: com\example\module2\classes\com\example\module2\class1.class (The system cannot find the path specified)public class class1 extends Thread {
           ^
    Note: Some input files use or override a deprecated API.
    Note: Recompile with -deprecation for details.
    1 error
    OK
    Application finished without errors.
    Note: Contents of my classes directory for module2:
    classes/com/example/module2/class1.class
    classes/com/example/module2/class2.class
    classes/com/example/module2/class3.class
    classes/com/example/module2/sub1/subclass1.class
    classes/com/example/module2/sub1/subclass2.class
    classes/com/example/module2/sub1/subclass3.class
    So, as you can see everything compiles as expected, but an error message is displayed related to each first file that is compiled.
    ==> Is this a known issue ?
    ==> What can I do about it ?
    Suggestions welcome

  • Error running child packages from parent package - Error 0xC0011008

    Hey...
    I am running a parent SSIS package (running sp2, 9.0.3042) that calls several child packages.
    On our development server, we now cannot run this because we get 1 or more of these errors:
    "Error 0x80004003 while preparing to load the package. Invalid pointer  .  "
    "Error 0xC0011008 while preparing to load the package. Error loading from XML. No further detailed error information can be specified for this problem because no Events object was passed where detailed error information can be stored.  .  "
    It is not occuring on the same packages.  It varies every time it is run.
    I can run every one of the child packages individually, using the same login ID that the parent is executed under.
    The parent package works fine on my local machine and other servers running the same version of SSIS.  Just not on this server.
    Does anyone have any ideas???
    Thanks
    BobP

    I have the same error with no parent child package relationship. I have changed the "Max Concurrent Executables" in each package from -1 to 10 and got  no change.  My code is below:
    List
    <string> fileList = new List<string>();
    private
    void checkedListBox1_SelectedIndexChanged(object sender, EventArgs e)
    //this.fileList.Add(checkedListBox1.SelectedValue.ToString().Trim());
    this.fileList.Add("name");
    private
    void button1_Click(object sender, EventArgs e)
    string @fileName;
    foreach (string str in fileList)
    @fileName = str;
    string pkgLocation;
    Microsoft.SqlServer.Dts.Runtime.
    Application app;
    DTSExecResult pkgResults_Sql;
    pkgLocation =
    @"C:\" + @fileName + ".dtsx";
    app =
    new Microsoft.SqlServer.Dts.Runtime.Application();
    Package pkgIn = new Package();
    pkgIn = app.LoadPackage(pkgLocation,
    null);
    pkgResults_Sql = pkgIn.Execute();

  • How to import one package in another package in java

    HI ,
    I want call a class which is located in package pckage1 into another package package2s class..
    could any one help me on this...
    realy that would be appricateble

    Use import package.ClassName;

  • Calling method from another class problem

    hi,
    i am having problem with my code. When i call the method from the other class, it does not function correctly?
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class Dice extends JComponent
        private static final int SPOT_DIAM = 9; 
        private int faceValue;   
        public Dice()
            setPreferredSize(new Dimension(60,60));
            roll(); 
        public int roll()
            int val = (int)(6*Math.random() + 1);  
            setValue(val);
            return val;
        public int getValue()
            return faceValue;
        public void setValue(int spots)
            faceValue = spots;
            repaint();   
        @Override public void paintComponent(Graphics g) {
            int w = getWidth(); 
            int h = getHeight();
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
            g2.setColor(Color.WHITE);
            g2.fillRect(0, 0, w, h);
            g2.setColor(Color.BLACK);
            g2.drawRect(0, 0, w-1, h-1); 
            switch (faceValue)
                case 1:
                    drawSpot(g2, w/2, h/2);
                    break;
                case 3:
                    drawSpot(g2, w/2, h/2);
                case 2:
                    drawSpot(g2, w/4, h/4);
                    drawSpot(g2, 3*w/4, 3*h/4);
                    break;
                case 5:
                    drawSpot(g2, w/2, h/2);
                case 4:
                    drawSpot(g2, w/4, h/4);
                    drawSpot(g2, 3*w/4, 3*h/4);
                    drawSpot(g2, 3*w/4, h/4);
                    drawSpot(g2, w/4, 3*h/4);
                    break;
                case 6:
                    drawSpot(g2, w/4, h/4);
                    drawSpot(g2, 3*w/4, 3*h/4);
                    drawSpot(g2, 3*w/4, h/4);
                    drawSpot(g2, w/4, 3*h/4);
                    drawSpot(g2, w/4, h/2);
                    drawSpot(g2, 3*w/4, h/2);
                    break;
        private void drawSpot(Graphics2D g2, int x, int y)
            g2.fillOval(x-SPOT_DIAM/2, y-SPOT_DIAM/2, SPOT_DIAM, SPOT_DIAM);
    }in another class A (the main class where i run everything) i created a new instance of dice and added it onto a JPanel.Also a JButton is created called roll, which i added a actionListener.........rollButton.addActionListener(B); (B is instance of class B)
    In Class B in implements actionlistener and when the roll button is clicked it should call "roll()" from Dice class
    Dice d = new Dice();
    d.roll();
    it works but it does not repaint the graphics for the dice? the roll method will get a random number but then it will call the method to repaint()???
    Edited by: AceOfSpades on Mar 5, 2008 2:41 PM
    Edited by: AceOfSpades on Mar 5, 2008 2:42 PM

    One way:
    class Flintstone
        private String name;
        public Flintstone(String name)
            this.name = name;
        public String toString()
            return name;
        public static void useFlintstoneWithReference(Flintstone fu2)
            System.out.println(fu2);
        public static void useFlintstoneWithOutReference()
            Flintstone barney = new Flintstone("Barney");
            System.out.println(barney);
        public static void main(String[] args)
            Flintstone fred = new Flintstone("Fred");
            useFlintstoneWithReference(fred); // fred's the reference I"m passing to the method
            useFlintstoneWithOutReference();
    {code}
    can also be done with action listener
    {code}    private class MyActionListener implements ActionListener
            private Flintstone flintstone;
            public MyActionListener(Flintstone flintstone)
                this.flintstone = flintstone;
            public void actionPerformed(ActionEvent arg0)
                //do whatever using flinstone
                System.out.println(flintstone);
        }{code}
    Edited by: Encephalopathic on Mar 5, 2008 3:06 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Maybe you are looking for