How to call a stored procedure from WorkShop

Hello Everyone .. I'm quite new with WebLogic 8.1 & WorkShop, so please bare with
me .. Today I'm simply trying to find out how to call a stored procedure from
within workshop, using any of the DB Controls .. I see workshop provides a way
create a Java Control, Rowset Control, but it wont easily allow for a stored procedured
to be entered in place of the inline query .. Perhaps I've over looked it. Any
advise on the best way to tackle this task will be appreciated.
Atahualpa

Atahualpa--
Maybe this will help:
http://edocs.bea.com/workshop/docs81/doc/en/workshop/guide/controls/database/conStoredProcedures.html
Eddie
Atahualpa wrote:
Hello Everyone .. I'm quite new with WebLogic 8.1 & WorkShop, so please bare with
me .. Today I'm simply trying to find out how to call a stored procedure from
within workshop, using any of the DB Controls .. I see workshop provides a way
create a Java Control, Rowset Control, but it wont easily allow for a stored procedured
to be entered in place of the inline query .. Perhaps I've over looked it. Any
advise on the best way to tackle this task will be appreciated.
Atahualpa

Similar Messages

  • How to call a stored procedure from EJB3/toplink essentials..?

    Hi,
    I want to call a stored procedure residing in the oracle 10 g Database from my application's data access layer, which is designed using EJB3/toplink essentials.
    I think this feature is not available right now in the EJB3 spec...any workaround with code if possible will be very help full...
    Thanks & Regards,
    Sarvesh

    This should help you....
    how to execute a stored procedure from ejb3.0 bean using entity manager

  • How to call multiple stored procedure from same DB Adapter

    Hi,
    I want to invoke 3 stored procedures from my message flow in BUS . I created a DB adapter and invoked 1 successfully . Now I don't to configure 2 other DB adapters for calling other 2 stored procedures . I want some how to be able to call the other 2 from the first DB adapter only . Somehow I need the flexibility to have procedure names as the operation names in 1 wsdl and be able to configure this in JDeveloper for this at time of DB adapter configuration . I am using 11G . Is it possible ?

    You can probably create a DB adapter with operation type selected as Execute Pure SQL and write SQL code to invoke the stored procedures depending on the procedure name (which you can get as one of the parameters of DB Adapter).
    However, Even if you were able to do it, the DB Adapter schemas are generated based on stored procedure parameter list and types. If you use Execute Pure SQL type of DB Adapter the schema will be generated based on the parameters which you are using in your custom SQL code within DB Adapter. Which means that if you want to add a new stored procedure as target which has a different name and different parameters then you will need to regenerate the DB adapter and update your custom SQL code. This also means that you will need to do regression testing interfaces to all stored procedures whenever there is any change in this DBAdapter.
    Now, my question is why do you want to invoke multiple stored procedures from same DB adapter?
    This is not a good way to design integration solutions and makes your services resistance to change as it will take more time to change and test.
    If all that you want is to have a web service which can have different operations for different stored procedures then you should create three business services and create a wrapper proxy service which has one operation for each stored procedure, within the proxy transform and call the correct backend service (you can use operational branch). This way you have a modular code where each module (read interface to one stored procedure) can be independently modified and tested.

  • How to call a stored procedure from servlet?

    Hi all
    We are developing a project in servlet which needs to call a stored procedure in oracle 8i database.How to make a call? Whether can i get any data from the database using STORED PROCEDURE
    THANKS IN ADVANCE
    kamalakannan

    Hello,
    You can do an HTTP call from a store procedure using thre UTL_HTTP package; so you should be able to call your servlet this way.
    See UTL_HTTP documentation
    Regards
    Tugdual Grall

  • How to call a stored procedure from my JSP?

    Hi to all,
              I have a very simple jsp page and a simple sql server stored procedure!
              I need to call this stored procedure by passing two parameters.
              My result set will have 4 columns.
              I would really appreciate any input on how to issue this call to a SP.
              I am new to JSP.
              Regards,
              Sam
              

              Sam,
              BEA provides examples that are shipped with the product under
              <beahome>\weblogic700\samples\server\src\examples\
              Look at the jsp directory for JSP examples that access a database and look at
              say the jdbc\oracle\storedprocs.java for an example of java code calling out to
              a stored procedure - - by combining one of the jsp database examples with this
              stored procedure example you should be 'good to go'
              Chuck Nelson
              DRE
              BEA Technical Support
              

  • How to call MSSQL stored procedure from oracle database

    MSSQL and Oracle databases are linked thru ODBC link using Oracle HSODBC.
    I can query MSSQL table or view from Oracle Database using standard notation for acessing remote objects schema.object@dblink_name...
    Can anybody give me syntax for calling MSSQL stored procedure thru ODBC database link?
    I tried syntax exec schema.stored_procedure@dblink_name but it doesn't work...i'm getting schema.stored_procedure must be declared error...
    Tnx,in advance!
    Dejan Botica

    Oracle database 10gR2.
    MSSQL2000 database.
    For example query:
    select * from dbo.Tbl_Test@kron@dw_jamnica; works fine...
    ...while for example exec dbo.Test@kron@dw_jamnica;
    reports error:
    ORA-06550: line 1, column 7:
    PLS-00201: identifier 'DBO.TEST@KRON@DW_JAMNICA' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    Table Tbl_Test and procedure Test exists in MSSQL instance.
    Regards,
    Dejan

  • How to call a Stored procedure from xsodata service?

    Hi Everyone,
    I have created an stored procedure and I'm trying to consume this store procedure from xsodata service.
    But unable to activate the service because of an error.
    Invalid procedure or parameter list in procedure "package.WebContent.src.hana.procedures::PROCEDURE
    I have activated both store procedure as well as attribute view.
    Here is my stored procedure.
    PROCEDURE "SCHEMA"."package.WebContent.src.hana.procedures::PROCEDURE" (
    IN row "SCHEMA"."package.tables::object" )
      LANGUAGE SQLSCRIPT
      SQL SECURITY INVOKER AS
      --DEFAULT SCHEMA <default_schema_name>
      --READS SQL DATA AS
    BEGIN
      Write your procedure logic
    declare shortdesc string;
    SELECT SHORT_DESCRIPTION INTO shortdesc FROM :row;
    END;
    Service:
    service namespace "package.WebContent.src.hana.service"{
    "package/OBJECT.attributeview" as "OBJECTS"
    key ("OBJECT_ID")
        create using "package.WebContent.src.hana.procedures::PROCEDURE";
    Is there anything wrong in the way i'm calling the procedure??

    Hi Arjun,
    You can expose the procedure as an Odata Service if you wrap it in a Scripted Calculation View..
    Firstly You will have to create a Scripted Calculation View from the Modeller perspective.
    Below is an example I just tried.
    Add Columns & Input Parameters
    Consume this Calc View in your Odata service :
    service namespace "services.test"
    "pda.Models::CV_TEST" as "Customer"
    keys generate local "ID"
    parameters via entity;
    Check your service by Passing the Input Parameters
    http://<host>:<port>/<>/services/test.xsodata/CustomerParameters(2)/Results?$format=json
    Hope this was Helpful
    Regards,
    Avinash Raju

  • How to call a stored procedure from jsf

    Hello everybody,
    Currently i am working on jdeveloper 10g rel 2 version and i am using adf and jsf to build my application, In one of my jsp page i need to call a plsql stored procedure.
    Please provide me the soln
    Regards
    Ahamed

    Hi,
    Although exposing the method on the binding layer is the preferred way I always end up in trouble due to the lack of support for complex datatypes and decent return values.
    The way I did this in 10.1.3 is:
    In your application module:
      private static final String STAMSAMENVOEGEN = "begin IVA_OWNER.IVA_UI_ALGEMEEN_PCK.SAMENVOEGEN_STAMMEN_GUI (P_ARRAY => :1, P_MESSAGE => :2 ); end;"; 
      public String stamSamenvoegen( Integer[] idArr ) {
        CallableStatement stamSamenvoegenSP = null;
        String ret = null;
        try {
          stamSamenvoegenSP = getDBTransaction().createCallableStatement( STAMSAMENVOEGEN, 0 );  
          Connection conn = ((DBTransactionImpl)getDBTransaction()).getPersistManagerConnection();
          oracle.sql.ArrayDescriptor arrayDesc = oracle.sql.ArrayDescriptor.createDescriptor("IVA_OWNER.IVA_VARRAY_NUMBER", conn);
          oracle.sql.ARRAY arr = new oracle.sql.ARRAY(arrayDesc, conn, idArr);
          stamSamenvoegenSP.setArray(1, arr);
          stamSamenvoegenSP.registerOutParameter(2, Types.VARCHAR);
          stamSamenvoegenSP.executeUpdate();
          ret = stamSamenvoegenSP.getString(2);     
        } catch ( Exception e ) {
          log.warning( "Call tor " + STAMSAMENVOEGEN + " failed, " + e.getMessage() );
        } finally {
          if ( stamSamenvoegenSP != null ) {
            try {
              stamSamenvoegenSP.close();
            } catch ( Exception e ) {
              log.warning( e.getMessage() );
        log.info( "Stam samenvoegen executed for " + idArr.toString() );
        return ret;
      } Now the backing bean to access it:
      <your appmodulename> chm = null;
      public BackingBean() {
        FacesContext fc = FacesContext.getCurrentInstance();
        ValueBinding vb = fc.getApplication().createValueBinding("#{data}");
        BindingContext bc = (BindingContext)vb.getValue(fc);
        //Can find this name in your databindings.cpx file in the model project
        DCDataControl dc = bc.findDataControl("<your app module>DataControl");
        ApplicationModule am = (ApplicationModule)dc.getDataProvider();
        chm = (<your app modulename>)am;
      }Hope this helps
    -Anton

  • How to call a stored procedure from a trigger

    Hi,
    Can anyone please send me sample SQL code to invoke a stored procedure inside a trigger?
    Thanks and Regards,
    Prince

    The user should have execution privilege of that procedure.Correct. The execute privilege needs to granted to the user directly, rather than through a role.
    Cheers, APC

  • 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,

  • How to call PLSQL Stored procedure in ADF?

    Hi!
    I am using adf for our development. We have existing stored packages and I want to use them. The problem is how can I call those PLSQL stored procedure in ADF.
    Thanks in advance
    alvin.

    Hi,
    a stored procedure is called by the business service. If e.g. your business service is ADF Business Components then you call a stored procedure from the Application Module's transaction. Call a PLSQL procedure using a prepared statement. Similar you call stored procedures from EJB or TopLink business services
    For ADF Business Components see
    http://radio.weblogs.com/0118231/stories/2004/09/23/notYetDocumentedAdfSampleApplications.html
    Frank

  • Calling Oracle Stored Procedure from BC4J JSP App

    I am on an extremely tight deadline and am trying to get my JSP application to use an Oracle Stored Procedure. I need to take some input from the user and send these values as parameters. Has anyone worked with Stored Procedures in JDev3.1? Please reply with some sample code if possible.
    Thanks.

    Hi,
    Someone posted a similar request the other day. Here is my response to them:
    Basically, you need to create a custom method from your JSP's ViewObject, which calls the stored procedure. You can then call the ViewObject's custom method from the JSP client.
    Here is how I have done it:
    1. Choose the ViewObject that your JSP is based on and choose 'Edit' from the context menu.
    2. On the Java tab of the ViewObject wizard, choose Generate Java File checkbox for the View Object Class and click the Finish button. A file is created under the ViewObject node in the Navigator named 'viewobjectImpl.java'.
    3. Open the viewobjectImpl.java file in the code editor and create a method to call your stored procedure (see sample code below).
    4. Compile the VOImpl.java file.
    5. Choose the view object again, and choose Edit again from the context menu.
    6. On the Client Methods tab, you should now see your method appear in the Available field. Select it and shuttle it to the Selected field.
    7. Click Finish to leave the VO wizard, and rebuild your Business Components project.
    8. In your JSP, call the custom method (see sample code below).
    sample code for custom method calling a stored procedure from VOImpl.java file:
    public int getTotalHits(String mon, String year) {
    CallableStatement stmt = null;
    int total;
    // the call to the PL/SQL stored proc
    String totalhits = "{? = call walkthru.total_hits(?,?)}";
    // use the AM conxn 2 call storedproc
    stmt = getDBTransaction().createCallableStatement(totalhits, 1);
    try
    // Bind the Statement Parameters and //Execute this Statement
    stmt.registerOutParameter(1,Types.INTEGER);
    stmt.setString(2,mon); stmt.setString(3,year);
    stmt.execute();
    total = stmt.getInt(1);
    catch (Exception ex)
    throw new oracle.jbo.JboException(ex);
    finally
    try
    stmt.close();
    catch (Exception nex)
    return total;
    sample render code for calling custom method from JSP custom bean:
    public void render() {
    int totalhits;
    try
    Row[] rows;
    // Retrieve all records by default, the qView variable is defined in the base class
    qView.setRangeSize(-1);
    qView.first();
    rows = qView.getAllRowsInRange();
    // instantiate a view object for our exported method
    // and call the stored procedure to get the total
    ViewObject vo = qView.getViewObject();
    wtQueryView theView = (wtQueryView) vo;
    totalhits = theView.getTotalHits(session.getValue("m").toString(),session.getValue("y").toString());
    out.println(totalhits);
    } catch(Exception ex)
    throw new RuntimeException(ex.getMessage());
    }

  • Calling a stored procedure from within a ViewObject

    Is it possible to make stored procedure call from within a BC4J ViewObject? Basically something like this:
    select * from table(f1(3)); where f1 is a table function. Using Oracle's pipelined table functions?
    If not, is it possible to call a stored procedure from Java and have the returned results be put back into a BC4J RowSet.
    In addition, is there a way to create a JDBC Resultset from a BC4J RowSet?
    We need to be able to dynamically create our SQL statements (the entire SQL, not just the where clause) but are required to have these sql statements generated/executed from within a pl/sql stored procedure in the database.

    Is it possible to make stored procedure call from within a BC4J ViewObject? Basically something like this:
    select * from table(f1(3)); where f1 is a table function. Using Oracle's pipelined table functions?
    Yes. Using our expert-mode query feature this is possible.
    is it possible to call a stored procedure from Java and have the returned results be put back into a BC4J RowSet.
    Yes. See this article about basing a view object on a REF CURSOR:
    http://radio.weblogs.com/0118231/2003/03/03.html
    In addition, is there a way to create a JDBC Resultset from a BC4J RowSet?
    No. Not directly. What's the business requirement here so I can understand better?
    We need to be able to dynamically create our SQL statements (the entire SQL, not just the where clause) but are required to have these sql statements generated/executed from within a pl/sql stored procedure in the database.
    REF CURSOR would work fine, or if it's just the statement that needs to be generated dynamically, you could fetch the text of the SQL statement from the stored procedure, then use createViewObjectFromQueryStmt(). Although this has runtime overhead involved with describing the query.
    The REF CURSOR based approach is probably best for this.

  • Calling a stored procedure from a url

    I am needing to call a stored procedure from a url string (or
    anchor) understand that from training to be as follows:
    http://host:port/pls/dad/package.procedure?query_string
    With that in mind, I am getting an error as follows:
    Not Found
    The requested URL /pls/portal30/at_hrfm.checkshow.showcheck was
    not found on this server.
    Here is a sample of my url
    http://servername:port/pls/portal30/at_hrfm.checkshow.showcheck
    I can see servername:port/pls/portal30, it is just the
    procedure I am having a problem with.
    Here is a sample of my source code that is created under the
    at_hrfm schema (I also tried under portal30 schema).
    package body checkshow as
    procedure showcheck as
    begin
    htp.htmlOpen;
    htp.headOpen;
    htp.title('My Check');
    htp.comment ('This should be your Check');
    htp.bodyOpen;
    htp.header (1,'Check');
    htp.print ('checkdate');
    htp.bodyClose;
    htp.headClose;
    htp.htmlClose;
    end;
    end;

    I think I figured this out. I don't think the grant to ANONYMOUS is going to work with production XE and the online documentation is in need of an update. It appears that production XE has been locked down and you will need to specify the name of each stored procedure you wish to allow to be executed by adding it to the WWV_FLOW_EPG_INCLUDE_MOD_LOCAL function. This is spelled out in more technical detail here: http://download.oracle.com/docs/cd/B25329_01/doc/appdev.102/b25309/adm_wrkspc.htm#BEJCGJFJ
    Another alternative that would work involves creating a separate DAD. Using the DAD approach with my schema made all of my stored procedures callable from a web browser, so I rejected this approach. To make this usable (secure) I would have needed to create and maintain a separate database user for the DAD and then only granted it execute for the stored procedures I wanted to be callable from a URL.
    Finally I read about using an on-demand procedure and having it invoke the desired stored procedure. While I didn't try this out, it sounds like another good approach because it maintains session security. If it can be used to return an image I do not know.
    - Jim

  • How to call a stored procedure using its package name in Oracle

    hi
    we're doing a JDBC scenario where we call a stored procedure(a.prc) using its package name(b)The stored procedure has In /Out/IN-OUT parameter.
    i have got 2 queries:
    1- How to call the stored procedure using it's package.
    2- How to capture the In/Out parameter in the response.

    hi Prateek
    thanks for the reply.
    However when i tried mapping it to Package.procedure, communication channel throws the error saying that Package.proceudre needs to be declared.
    As i said , the procedure has IN-OUT parameter too.In oracle we need to write a block if we want to read the IN-OUT parameter.
    How to get the IN-OUT parameter in XI?

Maybe you are looking for

  • Lines appear under all text when you press enter--edit?

    Hello, I have a text box, whose formatting I want to edit. When you press enter a horizontal line appears automatically before you enter in text on the new line. I want to edit this line so it is closer to the text. Where do I go to edit this feature

  • ADF calendar date cell  background color change

    Hi, I am new to jdeveloper / ADF. I coded per the below calender sample in my jdeveloper and it runs fine. http://www.oracle.com/technetwork/developer-tools/jdev/calendar-091799.html The current date cell shows in yellow color background. How/where c

  • Infinity home hub 5 dropping

    For about 2 weeks now my infinity home hub 5 keeps resetting itself. This is getting progressively worse. I'm at the stage now where it's happening every couple of minutes.

  • Incorrect number format appearing in report

    This might sound like a really silly question, but I've not had much need to faff around with changing number formats. We have a report which is taking a number column and outputting it directly, but when the number is something like 0.1234 it strips

  • Can't logic pro 8 to recognize DAE

    Hello all, Newbie here.Any suggestions how to get Digidesign 002 to be recognized by logic pro 8? thanks in advance Larry Junstrom Bass player,38 Special [email protected]