How to call a package from a different instance?

Dear all:
how to call a package from a different instance?
for example:
package A belongs to instance A1
package B belongs to instance B1
Now I want to call the package B in instance A1, how can I do ? my environment is oracle 10g
Regards
Terry

Terry Chen wrote:
Dear all:
how to call a package from a different instance?
for example:
package A belongs to instance A1
package B belongs to instance B1
Now I want to call the package B in instance A1, how can I do ? my environment is oracle 10g
First you have to create create dblink in A1 database as below
CREATE DATABASE LINK INSA1
   CONNECT TO USER_NAME IDENTIFIED BY <pass>
   USING 'B!' Then you can execute exec pack_b@INSA1;

Similar Messages

  • How to call a package from the Report in Oracle Application Express

    How to call a package from the Report in Oracle Application Express

    Hello,
    What do you mean? Something like SELECT mypackage.function( par1, par2) from dual?
    Or do you want to execute a procedure when something happens on the page, like clicking a button?
    Greetings,
    Roel
    http://roelhartman.blogspot.com/
    You can reward this reply by marking it as either Helpful or Correct ;-)

  • How to call a package from within a package

    How would I call a package from within a package and pass variables to it. For instance I am trying to pass variables to a log package from another package when a user inserts or updates a table

    First, technical questions need to be addressed to one of the technical forums. Products | Database | SQL & PL/SQL would be appropriate for this question. Please direct any followup to that forum.
    Second, you cannot call a package; a package is a collection of stored procedures and functions. You can call a packaged function or procedure from another package simply by specifying the package name and the procedure
    CREATE OR REPLACE PACKAGE pkgA
    AS
      PROCEDURE callPkgB;
    END;
    CREATE OR REPLACE PACKAGE BODY pkgA
    AS
      CREATE PROCEDURE callPkgB
      AS
      BEGIN
        pkgB.someProcedure( 'Some argument' );
      END callPkgB;
    END pkgA;In general, any packaged procedure can be called by specifying the schema, package, and procedure name, i.e.
    EXEC mySchema.myPackage.myProcedurethough the schema and package can be omitted if the calling procedure is in the same schema or package.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • How to call a function from a different script object?

    Hi All,
    Here is the scenario,
    I have 2 script objects A and B .
    In script object A i have a function called "funcA" and
    in script object B i have a function called "funcB"
    Now I want to call funcA from funcB which is not happening.
    I tried doing
    A.funcA();
    inside funcB , but not able to access.
    Kindly help.
    Thanks
    Abhiram

    Hi Abhiram,
    Just a guess - try including the root node/node reference above the script object.
    form1.A.funcA();
    What does the JavaScript Console say when firing the function? Are there any errors?
    Your script objects can contain multiple functions. So you could move funcA() and funcB() into the same script object. This will make it easier.
    Niall
    Assure Dynamics

  • How to call a controller from a different BSP application?

    I have searched for the documentation, I have found literature that says it is possible but I am struggling with the syntax. I am in BSP 'MVC1' and upon a condition I would like to call the main controller of BSP 'MVC2'. What will be the syntax?
    Thanks
    Mani

    Hi,
    this might help:
    MVC call another controller with other (own) namespace
    grtz
    Koen

  • How to call java files from different directories

    hi, how do i call java files from a different directory??
    let say i got partA.java, and i need to include functions from partB.java which is in a different folder. how can i do that?

    Chicon wrote:
    Hi nuttynibbles,
    Before the class declaration in partA.java, you must have an import statement like :
    import someDirectory.partB;
    public class partA {
    ... and before you ask... you'll probably want to read through this http://java.sun.com/docs/books/tutorial/java/package/index.html

  • How to call business service from xquery transformation in OSB ??

    Hi All,
    How to call business service from xquery transformation in OSB ??
    I need to assign the response variable of Business Service to a target element in XQuery Transformation Mapper file.
    It's urgent.
    Regards,
    Jyoti Nayak

    Transformation is to mapping the source and target of 2 different schemas.
    In your case you should have a XQuery transformation between, your Business Service output schema and the target schema.
    Thanks,
    Vijay

  • How to call oracle function from ejb3

    i'm trying to call an oracle query-function from ejb3.
    The oracle function:
    create or replace FUNCTION getSecThreadCount(secId in NUMBER,avai in NUMBER)
    RETURN SYS_REFCURSOR is cur SYS_REFCURSOR;
    m_sql VARCHAR2(250);
    BEGIN
    m_sql:='select count(thrId) from thread where secId='|| secid||'
    and thrAvai='|| avai;
    open cur for m_sql;
    return cur;
    END;
    I'v tried several ways to call it,but all failed:
    1. the calling code:
    public Object getSectionThreadCount(int secId,int avai){
              Query query=manager.createNativeQuery("{call getSecThreadCount(?,?) }");     
              query.setParameter(1, secId);
              query.setParameter(2, avai);
              return query.getSingleResult();
    but i got the exception:
    Exception in thread "main" javax.ejb.EJBException: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query; nested exception is: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query
    javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query
    Caused by: java.sql.SQLException: ORA-06550: row 1, col 7:
    PLS-00221: 'GETSECTHREADCOUNT' not procedure or not defined
    ORA-06550: row 1, col 7:
    PL/SQL: Statement ignored
    2. the calling code:
    @SqlResultSetMapping(name = "getSecThreadCount_Mapping")
    @NamedNativeQuery(name = "getSecThreadCount",
    query = "{?=call getSecThreadCount(:secId,:avai)}",
    resultSetMapping = "getSecThreadCount_Mapping",
    hints = {@QueryHint(name = "org.hibernate.callable", value = "true"),
              @QueryHint(name = "org.hibernate.readOnly", value = "true")})
    public Object getSectionThreadCount(int secId,int avai){
              Query query=manager.createNamedQuery("getSecThreadCount");     
              query.setParameter("secId", secId);
              query.setParameter("avai", avai);
              return query.getSingleResult();
    but i run into the exception:
    Exception in thread "main" javax.ejb.EJBException: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query; nested exception is: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query
    javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query
    Caused by: java.sql.SQLException: lost in index IN or OUT parameter:: 3
    By the way, i have successfully called the function from hibernate. And i use oracle 11g, JBoss5 RC1.
    Could anyone tell me how to call the function from EJB3?
    Thanks.

    Here's a working model:
    package.procedure: (created in example schema scott)
    CREATE OR REPLACE package  body data_pkg as
      type c_refcursor is ref cursor;
      -- function that return all emps of a certain dept
      function getEmployees ( p_deptId in number
      return c_refcursor
      is
        l_refcursor c_refcursor;
      begin
         open l_refcursor
        for
              select e.empno as emp_id
              ,        e.ename as emp_name
              ,        e.job   as emp_job
              ,        e.hiredate as emp_hiredate
              from   emp e
              where  e.DEPTNO = p_deptId;
        return l_refcursor;
      end getEmployees;
    end data_pkg;
    /entity class:
    package net.app.entity;
    import java.io.Serializable;
    import java.util.Date;
    import javax.persistence.Column;
    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    import javax.persistence.Id;
    import javax.persistence.NamedNativeQuery;
    import javax.persistence.QueryHint;
    import javax.persistence.SequenceGenerator;
    import javax.persistence.Table;
    @SuppressWarnings("serial")
    @Entity
    @Table (name="emp")
    @SequenceGenerator(name = "EmployeeSequence", sequenceName = "emp_seq")
    @NamedNativeQuery( name = "getEmpsByDeptId"
                   , query = "{ ? = call data_pkg.getEmployees(?)}"
                   , resultClass = Employee.class
                   , hints = { @QueryHint(name = "org.hibernate.callable", value = "true")
                          , @QueryHint(name = "org.hibernate.readOnly", value = "true")
    public class Employee implements Serializable
        @Id
        @Column(name="emp_id")
        @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "EmployeeSequence")
        private int id;
        @Column(name="emp_name")
        private String name;
        @Column(name="emp_job")
        private String job;
        @Column(name="emp_hiredate")
        private Date hiredate;
        // constructor
        public Employee (){}
        // getters and setters
        public int getId()
         return id;
    etc...session bean:
    package net.app.entity;
    import java.util.ArrayList;
    import java.util.List;
    import javax.ejb.Stateless;
    import javax.persistence.EntityManager;
    import javax.persistence.PersistenceContext;
    import javax.persistence.Query;
    import net.app.entity.Employee;
    import net.app.iface.ScottAdmin;
    @Stateless
    public class ScottAdminImpl implements ScottAdmin
        @PersistenceContext
        private EntityManager entityManager;
        @SuppressWarnings("unchecked")
        public List<Employee> getEmployeesByDeptId(int deptId)
         ArrayList<Employee> empList;
         try
             Query query = entityManager.createNamedQuery("getEmpsByDeptId");
             query.setParameter(1, deptId);
             empList = (ArrayList<Employee>) query.getResultList();
             return empList;
         catch (Exception e)
             e.printStackTrace(System.out);
             return null;
    }client:
    package net.app.client;
    import java.util.List;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import net.app.entity.Employee;
    import net.app.iface.ScottAdmin;
    public class ScottClient
        public static void main(String[] args)
         try
             // create local interface
             InitialContext ctx = new InitialContext();
             ScottAdmin adminInterface = (ScottAdmin) ctx.lookup("ScottAdminImpl/remote");
             // select employees by deptno
             int deptno = 20;
             List<Employee> empList = adminInterface.getEmployeesByDeptId(deptno);
             // output
             System.out.println("Listing employees:");
             for (Employee emp : empList)
              System.out.println(emp.getId() + ": " + emp.getName() + ", " + emp.getJob() + ", " + emp.getHiredate());
         catch (NamingException e)
             e.printStackTrace(System.out);
    }Basically you just ignore the refcursor outbound parameter.
    This is a stored function, have yet to try outbound refcursor parameters in stored procedures...
    Edited by: _Locutus on Apr 2, 2009 2:37 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Calling DTS package from Stored Procedure

    I am getting error calling DTS package from CF.
    So i want to call DTS package from SQL Server Stored
    Procedure.
    DTS package create text file. So no need of input or output
    parameter.
    What is the syntax?.
    thanks for ur help.

    Ted Kruger explains how this can be done in his blog post
    Run SSIS Package from Stored Procedure
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog

  • Run Script Logic/Package from a different Application

    Hi Experts,
    I have a scenario here that I need to run a package from a different application. For example, I'm in Finance application and I need to run a package which is in the LegalApp application, is it possible to call that package or perhaps run the logic it was calling without having switch back to LegalApp.
    Thanks,
    Marvin

    To run a package that runs logic on another application, you could copy a package such as "Default Formulas" and put the name of the target application in the new package's name.  Then go to Modify Package --> Advanced.  Edit the package to set the application as below.  The LegalApp (for example) is set on the third Task command.  Default logic is called on fifth.
    PROMPT(RADIOBUTTON,%CHECKLCK%,"Select whether to check work status settings when running logic.",1,{"Yes, check for work status settings before running logic","No, do not check work status settings"},{"1","0"})
    PROMPT(SELECTINPUT,,,,%CATEGORY_DIM%%ENTITY_DIM%%TIME_DIM%)
    TASK(Execute formulas,USER,%USER%)
    TASK(Execute formulas,APPSET,%APPSET%)
    TASK(Execute formulas,APP,LegalApp)
    TASK(Execute formulas,SELECTION,%SELECTIONFILE%)
    TASK(Execute formulas,LOGICFILE,)
    TASK(Execute formulas,CHECKLCK,%CHECKLCK%)

  • How to call a function from asp

    Hi!, I'd like to know how to call a function from an asp page. I've written:
    set rs = server.createobject("Adodb.recordset")
    rs.open "call dbo.sf_Obt_Des_Producto ('0000161')",Conn
    if err.description <> "" then
    response.write ("No se pudo! :(")
    else
    response.write ("rs: " & rs(0))
    end if
    rs.close
    set rs = nothing
    but there is an error:
    ORA-06576: not a valid function or procedure name
    Please is very urgent!!!
    Thanks.
    Angie.

    You need to use the syntax "{call <procedure_name>}".
    The {call } syntax tells the OLE DB provider that it needs to translate the call into whatever the database's procedure calling syntax is. This means that even though different databases have different syntax for calling stored procedures, your OLE DB code can be run against any of them without changing.
    Justin

  • While calling plsql  package from Pro*c getting  ORA-1426 error

    Hi Friends
    I am calling a package from Pro*c and getting numberic overflow error ORA-1426 but when i introduce a debug message such as printf or calling standard oracle utility to write in a log file no error comes. So how just introduction of debug messages is resolving the error.Can any one throw some light on it, whether it is some kind of synchronization issue or something else
    Regards
    Abhijeet

    Pretty hard to guess here since you're not providing any sample code.
    However:
    "Internally, PL/SQL assigns the values of the bounds to temporary PLS_INTEGER variables, and, if necessary, rounds the values to the nearest integer. The magnitude range of a PLS_INTEGER is -2147483648 to 2147483647, represented in 32 bits. If a bound evaluates to a number outside that range, you get a numeric overflow error when PL/SQL attempts the assignment. "
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/loop_statement.htm#sthref2852

  • Problem while executing my package from a different schema

    Hi,
    I developed a package.
    Now when i try to execute my package( which is in Schema1) from a different schema(Sc2) in the same database(9.2.0.1)
    i.e. execute <Sc1>.<package_name.Package_main_proc>;
    I'm able to execute the package successfully.. but .. my package is deleting all records in all the tables used by the package !!
    If I run the same package from my schema(Sc1).. everything is working fine.
    i.e. its deleted only unwanted records after executing the whole package.
    Can anyone pls help me.
    Regards
    Jack

    Guido,
    I'm sorry for asking a really vague question.
    I included all the dbms_output.put_line() in my code. As i executed in my schema. I couldnt find any error.
    So now, instead of calling my package from Sc1.
    I compiled my package in Sc2( I dint get any errors) and then executed it.
    Even now data is deleted from the tables.
    So now i tried thru another schema(SC3)..
    again compiled it and executed it.. now everything is working fine.
    So to my understanding i just there is some dependency is Schema 2. But i'm not able to figure it out as i'm not getting any error.
    Am i going is right direction. If not please correct me .
    Thanks

  • How to call a form from report? in 6i

    How to call a Form from Report? In Developer 6i of oracle. Plz tell me tex.

    try this
    declare
       AppID PLS_INTEGER;
    begin
         AppID := DDE.App_Begin('ifrun60 module=myform.fmx userid=scott/tiger@mydb maximize=no', DDE.App_Mode_Maximized);
    exception when others then
          srw.message(1,'Errror');
    end;Baig
    [My Oracle Blog|http://baigsorcl.blogspot.com/]

  • How can I transfer songs from two different itunes?

    I want to transfer songs from my brother's itunes library to my shuffle, but when I plug it in his computer, a message saying that his library is not linked to my library (or something to that extent) and whether I would like to replace the songs. If I click yes, all my existing songs are replaced with HIS songs. If I click on NO, the Shuffle icon does not appear at all and I cannot transfer any of his songs to my shuffle. How can I transfer songs from two different computers into my shuffle without replacing any of my existing music?
    Shuffle   Windows XP  
      Windows XP  

    You'll have to setup your iPod to manual instead of automatic update (I'm not sure, though, if it works with the Shuffle as well).
    Alexander.

Maybe you are looking for

  • Need to develop a help system

    I need to develop a help system for a Client-Server Oracle Form Application. Can any one suggest any good packages to develop Help system? Does any one tried Oracle Help for Java (OHJ)? Please let me know your recommendations and opinions, thanks. nu

  • Key mapping to extension.

    Hi, I have setup Exchange 2010 with Unified Messaging role and Lync 2010. They are integrated and working fine. I also have a prompt that says: "Welcome to CompanyABC. If you know the extension number of the person you wish to speak to, please dial n

  • Maximum Permitted File Size in XI

    Hi, What is the maximum file size that XI can process ?? (With no splitting in adapters) Thanks in Advance, Chemmanz

  • How to create users with i18n characters in SunONE directory server?

    Was trying to create users and groups with i18n characters in SunONE directory server 1. Started LDAP console using -l option 2. Chaged the Locale to Japanese 3. Entered few japanese character as username (meaning internationalization user name) 4. H

  • Putting Drop Down Javascript in External File

    I am creating drop-down menus using Fireworks. I am then importing them into DW. The problem is that this menu is going into a template so any time I make a change to the navigation bar I have to update all the pages and re-upload all the pages that