Without calling stored procedure or functions from database

Hi,
I am using Jdeveloper 11.1.1.5.0.
=>How to do PL/SQL procedures and functions in ADF without calling stored procedure or function from DB?

S, PL/SQL procedures and functions are done in Application Module class or in managed bean..By calling the stored procedures or functions from DB.
But I am asking how to do if DB doesn't have any procedures,triggers and functions.

Similar Messages

  • Calling stored procedures in Sybase from java

    Hi,
    I am using the following stored procedure in Sybase
    use xyzdb
    go
    -- drop procedure if it already exist
    if object_id('up_name_select') is not null
    begin
    drop procedure up_name_select
    end
    go
    create procedure up_name_select
    @zid          numeric(7,0),
    @firstname     char(40),
    @lastname     char(40)
    as
    select zid,
    firstname,
    lastname
    from name
    where zid = @zid or
    (lastname like @lastname or firstname like @firstname)
    go
    -- update documentation records in object_docs
    delete object_docs
    from object_docs
    where object_name = "up_name_select"
    go
    insert into object_docs values("up_name_select","Selects records from the name table based upon the values of the input parameters.")
    go
    -- update documentation records in column_docs
    delete column_docs
    from column_docs
    where object_name = "up_name_select"
    go
    insert into column_docs values("up_name_select","@zid","System generated ID for an individual contact.")
    insert into column_docs values("up_name_select","@firstname","First name of the contact. SQL wild card characters are accepted.")
    insert into column_docs values("up_name_select","@lastname","Last name of the contact. SQL wild card characters are accepted.")
    go
    -- print success message and grant permissions
    if object_id('up_name_select') is not null
    begin
    print "Procedure up_name_select created."
    grant execute on up_name_select to developer_role
    end
    go
    This stored procedure selects the values from the table "name" for a given where condition (if I am not wrong).
    Can any one give me sample java code to select the records from the table "name" for a given zid.
    Thankyou in advance.
    Regards
    sgatl2

    calling stored procedures from java
    here is the sample code
    CallableStatement cs = con.prepareCall("{call selectlogin (?)}");
    cs.setString (1, "value");         
    ResultSet rs = cs.executeQuery ();
                while (rs.next ())
                //your code for display
                } more on gooooooogle
    http://www.google.com/search?q=calling+stored+procedures+from+java+with+sample+example&client=netscape-pp&rls=com.netscape:en-US

  • Calling Stored Procedure with parameters from a C program

    Hello, I need to call a PL/SQL stored procedure from a C program.
    Something like this sample program provided by Oracle -
    main()
    int i;
    EXEC SQL BEGIN DECLARE SECTION;
    */* Define type for null-terminated strings. */*
    EXEC SQL TYPE asciz IS STRING(20);
    asciz  username[20];
    asciz  password[20];
    int    dept_no;    / which department to query */*
    char   emp_name[10][21];
    char   job[10][21];
    EXEC SQL VAR emp_name is STRING (21);
    EXEC SQL VAR job is STRING (21);
    float  salary[10];
    int    done_flag;
    int    array_size;
    int    num_ret;    / number of rows returned */*
    int    SQLCODE;
    EXEC SQL END DECLARE SECTION;
    */* Connect to Oracle. */*
    strcpy(username, "SCOTT");
    strcpy(password, "TIGER");
    EXEC SQL WHENEVER SQLERROR DO sqlerror();
    EXEC SQL CONNECT :username IDENTIFIED BY :password;
    printf("Enter department number: ");
    scanf("%d", &dept_no);
    fflush(stdin);
    */* Set the array size. */*
    array_size = 10;
    done_flag = 0;
    num_ret = 0;
    */* Array fetch loop - ends when NOT FOUND becomes true. */*
    EXEC SQL EXECUTE
    BEGIN personnel.get_employees
    *(:dept_no, :array_size, :num_ret, :done_flag,*
    *:emp_name, :job, :salary);*
    END;
    END-EXEC;
    The question is - how is the Stored procedure get_employees declared ? Or more specifically, how is the salary parameter declared in get_employees ? Any help is highly appreciated.

    Hope following will help
    NOTE: Not tested
    Calling a stored procedure
    This program connects to ORACLE using the SCOTT/TIGER
    account. The program declares several host arrays, then
    calls a PL/SQL stored procedure (GET_EMPLOYEES in the
    CALLDEMO package) that fills the table OUT parameters. The
    PL/SQL procedure returns up to ASIZE values.
    It keeps calling GET_EMPLOYEES, getting ASIZE arrays
    each time, and printing the values, until all rows have been
    retrieved. GET_EMPLOYEES sets the done_flag to indicate "no
    more data."
    #include <stdio.h>
    #include <string.h>
    EXEC SQL INCLUDE sqlca.h;
    typedef char asciz[20];
    typedef char vc2_arr[11];
    EXEC SQL BEGIN DECLARE SECTION;
    /* User-defined type for null-terminated strings */
    EXEC SQL TYPE asciz IS STRING(20) REFERENCE;
    /* User-defined type for a VARCHAR array element. */
    EXEC SQL TYPE vc2_arr IS VARCHAR2(11) REFERENCE;
    asciz username;
    asciz password;
    int dept_no; /* which department to query? */
    vc2_arr emp_name[10]; /* array of returned names */
    vc2_arr job[10];
    float salary[10];
    int done_flag;
    int array_size;
    int num_ret; /* number of rows returned */
    EXEC SQL END DECLARE SECTION;
    long SQLCODE;
    void print_rows(); /* produces program output */
    void sql_error(); /* handles unrecoverable errors */
    main()
    int i;
    char temp_buf[32];
    /* Connect to ORACLE. */
    EXEC SQL WHENEVER SQLERROR DO sql_error();
    strcpy(username, "scott");
    strcpy(password, "tiger");
    EXEC SQL CONNECT :username IDENTIFIED BY :password;
    printf("\nConnected to ORACLE as user: %s\n\n", username);
    printf("Enter department number: ");
    gets(temp_buf);
    dept_no = atoi(temp_buf);/* Print column headers. */
    printf("\n\n");
    printf("%-10.10s%-10.10s%s\n", "Employee", "Job", "Salary");
    printf("%-10.10s%-10.10s%s\n", "--------", "---", "------");
    /* Set the array size. */
    array_size = 10;
    done_flag = 0;
    num_ret = 0;
    /* Array fetch loop.
    * The loop continues until the OUT parameter done_flag is set.
    * Pass in the department number, and the array size--
    * get names, jobs, and salaries back.
    for (;;)
    EXEC SQL EXECUTE
    BEGIN calldemo.get_employees
    (:dept_no, :array_size, :num_ret, :done_flag,
    :emp_name, :job, :salary);
    END;
    END-EXEC;
    print_rows(num_ret);
    if (done_flag)
    break;
    /* Disconnect from the database. */
    EXEC SQL COMMIT WORK RELEASE;
    exit(0);
    void
    print_rows(n)
    int n;
    int i;
    if (n == 0)
    printf("No rows retrieved.\n");
    return;
    for (i = 0; i < n; i++)
    printf("%10.10s%10.10s%6.2f\n",
    emp_name, job[i], salary[i]);
    /* Handle errors. Exit on any error. */
    void
    sql_error()
    char msg[512];
    int buf_len, msg_len;
    EXEC SQL WHENEVER SQLERROR CONTINUE;
    buf_len = sizeof(msg);
    sqlglm(msg, &buf_len, &msg_len);
    printf("\nORACLE error detected:");
    printf("\n%.*s \n", msg_len, msg);
    EXEC SQL ROLLBACK WORK RELEASE;
    exit(1);
    Remember, the datatype of each actual parameter must be convertible to the datatype of its corresponding formal parameter. Also, before a stored procedure is exited, all OUT formal parameters must be assigned values. Otherwise, the values of corresponding actual parameters are indeterminate.
    SQLCHECK=SEMANTICS is required when using an anonymous PL/SQL block.

  • Calling a SP or Function from Java receiving a geometry(MDSYS.SDO_GEOMETRY)

    Hi there,
    What I want to do is: calling a stored procedure OR function from Java with a String-variable as input and receiving a geometry (SDO_GEOMETRY).
    I’m facing currently the problem of calling a stored function on oracle 11g from Java using JPA (EclipseLink), Spring 2.5.6 returning an MDSYS.SDO_GEOMETRY object.
    I’ve tried to call a stored procedure with MDSYS.SDO_GEOMETRY as an output parameter instead, but with no success.
    The function’s signature looks like this:
    CREATE or REPLACE
    FUNCTION GET_GEO_BRD_FUNCTION(p_geo_brd_id IN VARCHAR2) RETURN MDSYS.SDO_GEOMETRY AS
    sdo_geom    MDSYS.SDO_GEOMETRY := null;
    BEGIN
    /* do some fancy stuff on the database side */
      SELECT sp_geom
        INTO sdo_geom
        FROM geo_brd WHERE id = p_geo_brd_id;
      RETURN sdo_geom;
    END;
    The calling code looks like this:
    MyClass extends JpaDaoSupport{
       /** logger */
       protected static final ILogger LOG = LogFactory.getLogger(MyClass.class);
        * {@inheritDoc}
        * @see com.example.MyClass#calculateGeometry(java.lang.String)
       @Override
       public JGeometry calculateGeometry(final String id) {
           JGeometry geometry = null;
           final JpaCallback action = new JpaCallback() {
                @Override
                public Object doInJpa(final EntityManager em) throws PersistenceException {
                   final Session session = JpaHelper.getEntityManager(em).getActiveSession();
                   final StoredFunctionCall functionCall = new StoredFunctionCall();
                   functionCall.setProcedureName("GET_GEO_BRD_FUNCTION");
                   functionCall.addNamedArgument("p_geo_brd_id");
                   functionCall.setResult("sdo_geom", Oracle.sql.STRUCT.class);
                   final ValueReadQuery query = new ValueReadQuery();
                   query.setCall(functionCall);
                   query.addArgument("p_geo_brd_id");
                   final ArrayList args = new ArrayList();
                   args.add("2e531e62-2105-4522-978a-ab8baf19e273");// hardcoded for test
                   final Object result = session.executeQuery(query, args);
                   return result;
        final STRUCT result = (STRUCT) this.getJpaTemplate().execute(action);
        try {
           geometry = JGeometry.load(result);
        } catch (final SQLException e) {
           MyClass.LOG.error("Error loading JGeometry from STRUCT.", e);
           return null;
        return geometry;
    And when I execute the query I get the following error:
    Internal Exception: java.sql.SQLException: ORA-06550: Row 1, Column 13:
    PLS-00382: expression is of wrong type
    ORA-06550: Row 1, Column 7:
    PL/SQL: Statement ignored
    Error Code: 6550
    Call: BEGIN ? := GET_GEO_BRD_FUNCTION(p_geo_brd_id=>?); END;
         bind => [=> sdo_geom, 2e531e62-2105-4522-978a-ab8baf19e273]
    Query: ValueReadQuery()
    So I thought may be let's try it with a stored procedure instead...
    The procedure looks like this:
    CREATE or REPLACE
    PROCEDURE GET_GEO_BRD_PROCEDURE(p_geo_brd_id IN VARCHAR2, sdo_geom OUT MDSYS.SDO_GEOMETRY) AS
    BEGIN
    /* do some fancy stuff on the database side */
      SELECT sp_geom
        INTO sdo_geom
        from geo_brd where id = p_geo_brd_id;
    END;
    The calling Java code in case of the stored procedure looks like this (only the content of the JPACallback has changed):
    @Override
    public Object doInJpa(final EntityManager em) throws PersistenceException {
        final Session session = JpaHelper.getEntityManager(em).getActiveSession();
        final StoredProcedureCall spCall = new StoredProcedureCall();
        spCall.setProcedureName("GET_GEO_BRD_PROCEDURE");
        spCall.addNamedArgument("p_geo_brd_id", "p_geo_brd_id", String.class);
        spCall.addNamedOutputArgument("sdo_geom", "sdo_geom", OracleTypes.STRUCT);
        final ValueReadQuery query = new ValueReadQuery();
        query.setCall(spCall);
        query.addArgument("p_geo_brd_id"); // input
        final List args = new ArrayList();
        args.add("2e531e62-2105-4522-978a-ab8baf19e273");// hardcoded for test
        final Object result = session.executeQuery(query, args);
        return result;
    And when I execute the query I get the following error:
    java.sql.SQLException: ORA-06550: Row 1, Column 13:
    PLS-00306: wrong number or types of arguments in call to 'GET_GEO_BRD_PROCEDURE'
    ORA-06550: Row 1, Column 7:
    PL/SQL: Statement ignored
    So both exceptions look quite similar.
    I guess in both cases the exception description leads to the assumption, that the wrong type for the return value / output parameter is used…
    So - how can a receive a MDSYS_SDO_GEOMETRY object from a stored procedure or stored function in Java ?
    What is wrong in the Java code?
    Thank you in advance for any suggestions!
    Yours,
    Chris
    Edited by: user3938161 on 20.12.2011 07:46
    Edited by: user3938161 on Dec 20, 2011 8:06 AM: added variable declaration of JGeometry geometry in source code

    Thanks, that did the trick! ;-)
    Here is now the code for stored procedure and function for anybody else encountering the same troubles... (be aware of the parameter order and/or naming!)
    Code for stored functions:
    final JpaCallback action = new JpaCallback() {
      @Override
      public Object doInJpa(final EntityManager em) throws PersistenceException {
         final Session session = JpaHelper.getEntityManager(em).getActiveSession();
           * Using CallableStatement for stored functions
          STRUCT st = null;
          CallableStatement cs = null;
          final DatabaseLogin login = session.getLogin();
          final Connection _conn = (Connection) login.connectToDatasource(session.getDatasourceLogin().buildAccessor(), session);
          try {
             try {
                cs = _conn.prepareCall("{? = call GET_GEO_BRD_FUNCTION(?)}");
                cs.registerOutParameter(1, OracleTypes.STRUCT, "MDSYS.SDO_GEOMETRY");
                cs.setString(2, "2e531e62-2105-4522-978a-ab8baf19e273");//TODO: hardcoded for test
                cs.execute();
             } catch (final SQLException e) {
                MyClass.LOG.error("An exception occured calling the stored procedure", e);
             if (cs != null) {
                //reading geometry from the database
                try {
                   st = (STRUCT) cs.getObject(1);
                } catch (final SQLException e) {
                   MyClass.LOG.error("An exception occured converting the query result to oracle.sql.STRUCT", e);
          } finally {
             try {
                if (_conn != null && !_conn.isClosed()) {
                    _conn.close();
             } catch (final SQLException e) {
                MyClass.LOG.error("An exception occured on closing the database connection.", e);
          return st;
    final STRUCT result = (STRUCT) this.getJpaTemplate().execute(action);
    The code for stored procedure solution:
    final JpaCallback action = new JpaCallback() {
      @Override
      public Object doInJpa(final EntityManager em) throws PersistenceException {
          final Session session = JpaHelper.getEntityManager(em).getActiveSession();
           * Using CallableStatement for stored procedure
          STRUCT st = null;
          CallableStatement cs = null;
          final DatabaseLogin login = session.getLogin();
          final Connection _conn = (Connection) login.connectToDatasource(session.getDatasourceLogin().buildAccessor(), session);
          try {
             try {
                cs = _conn.prepareCall("{call GET_GEO_BRD_PROCEDURE(?,?)}");
                cs.setString("p_geo_brd_id", "2e531e62-2105-4522-978a-ab8baf19e273");
                cs.registerOutParameter("sdo_geom", OracleTypes.STRUCT, "MDSYS.SDO_GEOMETRY");
                cs.execute();
              } catch (final SQLException e) {
                MyClass.LOG.error("An exception occured calling the stored procedure", e);
              if (cs != null) {
                //reading geometry from the database
                try {
                   st = (STRUCT) cs.getObject("sdo_geom");
                } catch (final SQLException e) {
                   MyClass.LOG.error("An exception occured converting the query result to oracle.sql.STRUCT", e);
           } finally {
              try {
                if (_conn != null && !_conn.isClosed()) {
                   _conn.close();
              } catch (final SQLException e) {
                MyClass.LOG.error("An exception occured on closing the database connection.", e);
            return st;
    final STRUCT result = (STRUCT) this.getJpaTemplate().execute(action);

  • Procedure and Functions from ADF View Layer

    Hi,
    Before i ask my question ,I would like to mention that I have done lot of googling on this topic before asking this question.
    http://adfhowto.blogspot.in/2010/11/call-db-procedure-or-function-from-adf.html
    http://adf-tools.blogspot.ca/2010/03/adf-plsql-procedure-or-function-call.html
    Lot of threads on otn forum too on this topic.
    I m pretty new to ADf too.
    Now most of our logic is in procedures and functions ,so on various events on form(view layer) I need to call procedure and function and then return values back to value layer too.
    Now the approach mentioned in the link above is good whats best approach to return out parameters to view layer considering i will be using either the DbCall class for all calls to procedures and functions
    I am thinking of this approach to Create a view with static fields,and in Model layer set values for these fields and access them in view layer or binding view controls to these fields.
    From View layer i will call the methods in AppmodImpl which will be calling procedure( methods will be exposed as Client Interface)
    Also in few articles i came across generic CallStoredProcedure and CallStoredFunctions.
    But my main concern is how to share out parameters with view layer....can anyone give link of showing application of it on view layer.
    Regards,

    From your subject. am stating that, dont do all those stuff in backing bean. backing bean is 1:1 mapping with your .jpsx or .jsff .
    best approach would be call those things your Application Module(model layer) exposed it. access the method over your pagedef. well said by ram.

  • How to call plsql procedure or function and getting back the string?

    Hi Everyone,
    i am using Jdev 11.1.1.5.0.
    i have a requirement to call plsql procedure or function from my backing bean java file and get back the returned value from the procedure or function.
    what piece of simple code i need to write in my backing bean?
    please suggest.
    Thanks.

    As always you write the method to call he pl/sql in the application module, expose this method to the client (so you see it in the datacontroll) then create a operation binding to the method and call this operation from the bean. The result you get by operation.getResult();
    You should never call pl/sql from the bean directly!
    The doc shows how to call the procedure from an application module: http://docs.oracle.com/cd/E21764_01/web.1111/b31974/bcadvgen.htm#sm0297
    Timo

  • Calling Stored Procedure from Oracle DataBase using Sender JDBC (JDBC-JMS)

    Hi All,
    We have requirement to move the data from Database to Queue (Interface Flow: JDBC -> JMS).
    Database is Oracle.
    *Based on Event, data will be triggered into two tables: XX & YY. This event occurs twice daily.
    Take one field: 'aa' in XX and compare it with the field: 'pp' in YY.
    If both are equal, then
         if the field: 'qq' in YY table equals to "Add" then take the data from the view table: 'Add_View'.
         else  if the field: 'qq' in YY table equals to "Modify"  then take the data from the view table: 'Modify_View'.
    Finally, We need to archive the selected data from the respective view table.*
    From each table, data will come differently, means with different field names.
    I thought of call Stored Procedure from Sender JDBC Adapter for the above requirement.
    But I heard that, we cannot call stored procedure in Oracle through Sender JDBC as it returns Cursor instead of ResultSet.
    Is there any way other than Stored Procedure?
    How to handle Data Types as data is coming from two different tables?
    Can we create one data type for two tables?
    Is BPM required for this to collect data from two different tables?
    Can somebody guide me on how to handle this?
    Waiting eagerly for help which will be rewarded.
    Thanks and Regards,
    Jyothirmayi.

    Hi Gopal,
    Thank you for your reply.
    >Is there any way other than Stored Procedure?
    Can you try configuring sender adapter to poll the data in intervals. You can configure Automatic TIme planning (ATP) in the sender jdbc channel.
    I need to select the data from different tables based on some conditions. Let me simplify that.
    Suppose Table1 contains 'n' no of rows. For each row, I need to test two conditions where only one condition will be satisfied. If 1st condition is satisfied, then data needs to be taken from Table2 else data needs to be taken from Table3.
    How can we meet this by configuring sender adapter with ATP?
    ================================================================================================
    >How to handle Data Types as data is coming from two different tables?
    If you use join query in the select statement field of the channel then whatever you need select fields will be returned. This might be fields of two tables. your datatype fields are combination of two diff table.
    we need to take data only from one table at a time. It is not join of two tables.
    ================================================================================================
    Thanks,
    Jyothirmayi.

  • CALLING STORED PROCEDURE IN DATABASE FROM FORMS4.5

    Is there any body know how to call stored procedure from Forms 4.5 ?
    I am writing a when-button-pressed trigger.
    Put the stored procedure name on there. But
    it said "stored procedure name is not declared on this scope".
    Thanks a lot
    null

    Try logging in to SQL*Plus and running the procedure, e.g....
    SQL> begin
    database_procedure_name(update_web);
    end;
    If it runs OK there, then it should run from within your form (provided that you are logged in as the same user as the test with SQL*Plus.

  • Java Stored Procedure via Function Give 0RA 600 from SQL Workshop and App

    Hi,
    Anyone experienced stored procedures or functions failing when called from APEX app or SQL Workshop ( ora 600 ) yet they work fine when called from SQLPlus?
    Sqlplus connected as my apex workspace schema owner:
    select net_services.test_db_connection_via_ldap(
    'APEXPRD1', 'test1', 'test1', null ) as result from dual;
    RESULT
    The database connection attempt was SUCCESSFUL
    From Apex Sql Worshop:
    select net_services.test_db_connection_via_ldap(
    'APEXPRD1', 'test1', 'test1', null ) as result from dual;
    ORA-00600: internal error code, arguments: [16371], [0x434B08150], [0], [], [], [], [], [], [], [], [], []
    NOTE: Same result when run in response to button push on page in application.
    Apex Version: 3.2.1.00.10
    Oracle Version: 11.1.0.7.0
    NOTE: I am using the embedded plsql gateway; was going to try NOT using it to see if it was shared server related (seemed to be from trc files)
    Any ideas?
    Since the code works from sqlplus, I know that it's good: Here some snippets
    -- ========================================================================================
    public class NetServices extends Object {
    public static String doTestDbConnectionViaLdap
    String piDbConnUrl,
    String piUserName,
    String piUserPassword
         String vResult = null;
    try
         Connection conn = null;
         OracleDataSource ods = new OracleDataSource();
         ods.setUser( piUserName );
         ods.setPassword( piUserPassword );
         ods.setURL( piDbConnUrl );
         conn = ods.getConnection();
         conn.close();
         vResult = "The database connection attempt was SUCCESSFUL";
    } catch ( SQLException e )
         int vErrCode = e.getErrorCode();
         String vErrMsg = e.toString();
              if ( vErrCode == 1017 ) {
              vResult = "The database connection attempt FAILED! Incorrect Username or Password";
         } else if ( vErrCode == 17433 ) { // Null Username or Password
              vResult = "The database connection attempt FAILED! You must provide both a Username and a Password";
         } else if ( vErrCode == 17002 ) {
              vResult = "The database connection attempt FAILED! Net Service Name was Not Found";
         } else if ( vErrCode == 17067 ) { // NULL Net Service Name
              vResult = "The database connection attempt FAILED! You must provide a Net Service Name";
         } else {
              vResult = "The database connection attempt FAILED! Error " + vErrCode;
    return vResult;
    } // method: doTestDbConnectionViaLdap
    -- ========================================================================================
    function do_test_db_connection_via_ldap
    pi_db_conn_url IN VARCHAR2,
    pi_user_name IN VARCHAR2,
    pi_user_password IN VARCHAR2
    return VARCHAR2
    is -- PRIVATE to the net_services package
    language java -- NOTE: See cr_java_class_NetServices.sql for actual java implementation
    name 'NetServices.doTestDbConnectionViaLdap
    ( java.lang.String, java.lang.String, java.lang.String ) return java.lang.String ';
    -- ========================================================================================
    function test_db_connection_via_ldap
    pi_net_service_name IN VARCHAR2,
    pi_user_name IN VARCHAR2,
    pi_user_password IN VARCHAR2,
    pi_search_base IN VARCHAR2
    return VARCHAR2
    is -- PUBLIC procedure
    v_url      VARCHAR2(256);
    begin
    g_err_source := 'NET_SERVICES.test_db_connection_via_ldap';
    g_err_action := 'build_jdbc_conn_url_using_oid';
    /*     NOTE: We don't want to assert the parameters because we don't want to raise
    an exception;
    -- Get the jdbc connection url that uses oid info
    v_url := build_jdbc_conn_url_using_oid( pi_net_service_name, pi_search_base );
    return( do_test_db_connection_via_ldap( v_url, pi_user_name, pi_user_password ) );
    end test_db_connection_via_ldap;
    -- ========================================================================================
    Thanks in advance for your consideration.
    Troy

    Troy:
    You could be right in your guess that the error is related to MTS. Search Metalink for '16371'. Why not switch your APEX app to use OHS and test whether the error persists. ?
    varad

  • Calling Stored procedure from Forms 6i

    Dear all,
    I have a stored procedure having INand INOUT parameters. I need to call it from Forms 6i triggers. Will you please tell me the syntax for calling stored procedure and stored function from Forms 6i and report 6i.
    Saibaldas
    [email protected]

    Just the same as for a local procedure, the only restrictions concern package public variables which are not visible from client side PL/SQL, and you probly want to keep the interfaces simple as client side PL/SQL (e.g. the Forms and Reports engines) don't support the same range of datatypes that the database does.

  • Calling stored procedures from entity object and application module

    Hello
    I've put in place an EntiyImpl base class containg helper methods to call stored procedures.
    I now need to call stored procedures from the application module.
    Apart from creating an application module base class and duplicating the helper method code is there a way
    to share the helper methods for calling stored procedures between the entity impl and application module impl ?
    Regards
    Paul

    Does the helper code depend on features of a particular entity object instance, beyond its database transaction?
    If so, I'm not sure I see how it could be used from an application module class.
    If not, here's what you do:
    Step 1:
    Parametrize the database transaction--you might even want to. So instead of
    protected myHelperMethod(Object someParam) {
    DBTransaction trans = getDBTransaction();
    change this to
    protected myHelperMethod(DBTransaction trans, Object someParam) {
    Step 2: make the method public and static--once you parameterize the DBTransaction, you should be able to do this.
    public static myHelperMethod(DBTransaction trans, Object someParam) {
    Step 3: Remove the method from your EntityImpl base class into a utility class:
    public abstract class PlSqlUtils {
    private PlSqlUtils() {}
    public static myHelperMethod(DBTransaction trans, Object someParam) {
    When you want to call the method from an application module, entity object, or even view object class, call
    PlSqlUtils.myHelperMethod(getDBTransaction(), paramValue);
    Unlike Transaction.executeCommand(), this lets you provide functionality like setting procedure parameter values, retrieving OUT parameter values, etc.
    Hope this helps,
    Avrom

  • How to call stored procedure in remote database

    Hi:
    I have a stored procedure in Oracle 8i database A on server A. I would like to call a stored procedure in Oracle 8i database B on server B. Both servers are on the same network.
    Is there an easy way to accomplish this using PL/SQL?
    What's the "best practice" for this?
    Thanks for your help!
    Rob

    I simply want to make a call from a procedure on server A to an insert procedure on server B. The procedure which is on server B should execute on server B. Is this what I need?
    Thanks!
    I assume you want to initiate the procedure from server B and executed on server A. Is that right ?
    1. Create a database link on server B
    CREATE DATABASE LINK databaseA.world CONNECT TO username identified by password using 'DATABASEA';
    2. Create synonym for the procedure
    CREATE SYNONYM proc_on_databaseB for [email protected];
    3. Execute the procedure using the new synonym.
    HTH,
    Allwyn
    Hi:
    I have a stored procedure in Oracle 8i database A on server A. I would like to call a stored procedure in Oracle 8i database B on server B. Both servers are on the same network.
    Is there an easy way to accomplish this using PL/SQL?
    What's the "best practice" for this?
    Thanks for your help!
    Rob

  • How to use @jws:sql call Stored Procedure from Workshop

    Is there anyone know how to use @jws tag call Sybase stored procedure within
    Workshop,
    Thanks,

    Anurag,
    Do you know is there any plan to add this feature in future release? and
    when?
    Thanks,
    David
    "Anurag Pareek" <[email protected]> wrote in message
    news:[email protected]..
    David,
    In the current release, we do not support calling stored procedures from a
    database control. You will have to write JDBC code in the JWS file to call
    stored procedures.
    Regards,
    Anurag
    Workshop Support
    "David Yuan" <[email protected]> wrote in message
    news:[email protected]..
    Anurag,
    I know how to use DB connection pool and create a db control with it. In
    fact, we have created a Web Service with the db control using plain SQL
    in
    @jws:sql. However, my question here is how to use @jws tag in Weblogic
    Workshop to create a Web Services based on Sybase stored procedure orany
    Stored Proc not plain SQL.
    Thanks,
    David
    "Anurag Pareek" <[email protected]> wrote in message
    news:[email protected]..
    David,
    You can use a database control to obtain a connection from any JDBC
    Connection Pool configured in the config.xml file. The JDBC Connectionpool
    could be connecting to any database, the database control is
    independent
    of
    that.
    Regards,
    Anurag
    Workshop Support
    "David Yuan" <[email protected]> wrote in message
    news:[email protected]..
    Is there anyone know how to use @jws tag call Sybase stored
    procedure
    within
    Workshop,
    Thanks,

  • Calling stored procedure from script on remote server

    We are migrating our database to a virtual server environment. On the current dedicated environment, the database and scripts(calling stored procedures) are on the same server. In the new envoirnment, the scripts, input and output files will be on a different server. Does anyone have any examples of scripts on one server calling stored procedures on another server. Don't laugh, but the db server is currently running Oracle 9i (part of the new enviornment to move to 11g).

    brifry wrote:
    sorry my terminolgy is not correct. the stored procedure is in the database and the database is on server a. The script is on server b. In your example you show how to log onto the database. That I know. In your example your example, how would you point to server b so you can log onto the database?Do you want to mean that your procedure (location A) want to call a script from location B ?
    make the script located folder as shared and ,You may try this
    //server_name/folder_name/file_name.xxxHope this helps

  • Calling stored procedure from DAC

    Anyone has instructions on calling stored procedures from DAC. If I had a stored procedure called gary.refresh, where would I put that in the DAC. How do I specify the database that my stored procedure is in.. There doesn't seem to be any examples of this in the documentation for DAC administration
    Edited by: user8092687 on Jun 6, 2011 7:51 AM

    You have 3 options.
    Option 1:
    Create an SQL file that runs the stored proc. For instance, if
    your stored proc is called "aggregate_proc" you would create a
    file called aggregate_proc.sql that has the syntax to run the
    stored proc. Put the file in the CustomSQLs directory that hangs
    off the DAC main directory. Then, in the DAC, create a new task
    (Execution Type = SQL File). The command for Incremental Load
    would be aggregate_proc.sql.
    Option 2:
    Create an Informatica mapping (and corresponding workflow) that
    runs the stored proc. Then create a DAC task (Execution type Informatica) that runs the workflow.
    Option 3 :
    Directly mention Schema.procedure name in the DAC task
    Hope this helps,
    - Amith

Maybe you are looking for

  • Need Help in a SQL Query

    Is there any way to get all tables and the number of records present in that particular table in a database ? i.e If In my database I have only two tables. Employee and Department. Employee has 5 rows and Department has 10 rows. My Output must be Tab

  • Error Message in Premiere CS6

    [/Volumes/BuildDisk/builds/slightlybuilt/shared/adobe/MediaCore/AudioRenderer/Make/Mac/../ ../Src/AudioRender/AudioPrefetch.cpp-99] Just happened recently. Running latest mac operating system 10.8.2 and CS6 is updated. I have to force quite the progr

  • Service Billing

    Hi I am working on service order process where i need to do billing for service order items after completion. But the problem here is if i select Transaction-Related Billing After Completion for item category, it is not available in Billing due list.

  • Clone vs time machine backup

    I am hoping someone can clarify this for me. It has to do with the variations of clone vs time machine back up vs migration assistance. I currently have a mid 2009 13" MBP that I am thinking of giving to my sister and getting myself a brand new MBA 1

  • Use of unknown number only

    Sometimes when i've called on mobile phone with skype caller id show "+21" or "+12345' or "unknown number" how i can show unknown number only ? i don't want to use +21 or 12345