Calling procedure PL/SQL from OCCI passing objects

Hi all!
I need a sample from a OCCI program that call a stored pl/sql procedure and pass an IN OUT parameter of type object.
Thanks in advanced!

I don't remember how after all these years, but I remember that I made a native Informix call in a special way. So it seems logical that you should be able to do the same for Oracle...
Scott

Similar Messages

  • How to call procedure in Java from SQL Server Database

    Hello Every Body
    i Have Question about
    How to call procedure in Java from SQL Server Database
    Thanks

    Hi,
    have you tried a Google search? I just gave it a 3 second try and already found: http://stackoverflow.com/questions/6113674/how-do-i-execute-a-ms-sql-server-stored-procedure-in-java-jsp-returning-table-d
    Frank

  • Why can't we call procedure in sql stmt

    Hi,
    Why can't we call procedure in sql stmt?

    Assuming (as Billy mentioned) that the question refers to SELECT statements (also assuming that "stmt" is short for "statement", nice time-saving abbreviation, thanks for that), you cannot use procedures because there is no concept of a procedure in an SQL query, and possibly in declarative languages in general (computer scientists may correct me here).
    How would it work? Everything in a SELECT list has to return something - it's the whole point of a SELECT list. Procedures by definition do not have a RETURN clause (yes you can RETURN to end processing, yes there are OUT parameters, but that is not the same thing). Perhaps you could post an example of the syntax you have in mind.

  • Calling a PL/SQL from VB with IN argument of object type

    I need to call a PL/SQL function in Oracle 8.1.6 from VB. One of the IN arguments is an object type (TYPE). How would I instantiate the variable of Oracle object type on VB side so that it can be passed to the Oracle?
    Thank you

    You have some flaws in your code.
    First - don't use same identifier for pl sql variables ( including parameters) and column names. In your case oracle will evaluate the where clause as where column_name=column_name which is probably not what you want. The next one - you should ensure that select into yields one row , not more, not less, otherwise you 'll run into exception.
    To actually print the desired values, you have to use dbms_output aware client ( sqlplus is such one) and for sqlplus in particular you have to issue set serveroutput on
    Here is a very basic example how can you get it to work:
    SQL> SELECT * FROM V$VERSION;
    BANNER
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    SQL> CREATE OR REPLACE PROCEDURE FIND_EMPLOYEES
      2  (p_first_name IN VARCHAR2)
      3  IS
      4  LAST varchar2(10);
      5  BEGIN
      6          SELECT LAST_NAME INTO LAST FROM EMPLOYEES WHERE FIRST_NAME = p_first_name;
      7          dbms_output.put_line(LAST);
      8  EXCEPTION
      9    WHEN no_data_found THEN
    10    dbms_output.put_line('There is no one employee with such first name!');
    11    WHEN too_many_rows THEN
    12    dbms_output.put_line('There are many employees with such first name, try with another one!');
    13  END FIND_EMPLOYEES;
    14  /
    Procedure created.
    SQL> SET SERVEROUTPUT ON
    SQL> EXEC FIND_EMPLOYEES('Julia')
    There are many employees with such first name, try with another one!
    PL/SQL procedure successfully completed.
    SQL> EXEC FIND_EMPLOYEES('Eugenia')
    There is no one employee with such first name!
    PL/SQL procedure successfully completed.
    SQL> EXEC FIND_EMPLOYEES('Adam')
    Fripp
    PL/SQL procedure successfully completed.Best regards
    Maxim

  • How call procedure or package from Oracle BI Publisher 10.1.3.2.1

    Hi Gurus,
    I need to call a procedure or package from Oracle BI Publisher 10.1.3.2.1 by passing parameters, I do it because it would be easier to fill a table as the report that asks for is too complex (8 breaks, 5 dblinks, 20 tables, etc).
    I'm not using the Oracle XML. Review include the following solutions:
    Re: Stored procedures and dynamic columns
    Re: Is it possible to use Stored Procedures in BI Publisher GUI?
    Re: PL/SQL Stored Procedure w/ XML Template?
    But none of them useful for me was the level of complexity.
    Best regards.

    Hi Vetsrini,
    I write the sentence as it showed in the previous thread
    select from whc_kk_v2.whc_p_kk_publisher (pv_msgerror =>: msgerror,*
    pv_pro1 =>: prov_1,
    pv_pro2 =>: prov_2)
    run when I get the error BIP
    ORA-00933: SQL command not properly ended
    Show me I'm doing wrong, or who may be causing the error. I tried everything but does not leave, please your help.
    Best regards

  • Call to pl/sql from java event-handler

    How can I call pl/sql procedure or function from java-script event handler
    Thanks,
    Anna

    Anna,
    You cannot call any arbitrary PLSQL code from the forms, only "standard"/custom event handlers can be called through do_event Javascript fuction, syntax :
    do_event(this.form,this.name,1,'ON_CLICK,'');
    where:
    1 - button intstance, if you have more than one instance of the same button on the screen this should be 2,3,4.....
    'ON_CLICK' - is the predefined event type
    '' - the last argument is any user defined string which will passed down to the PLSQL event handler.
    Thanks,
    Dmitry
    null

  • CALL PROCEDURE IN SQL STATEMENT

    Why we cant call a procedure inside SQL statement?

    Hitesh Nirkhey wrote:
    Hi Karthick_Arp
    as you said
    The procedure that is used inside a function cannot contain DDL or DML statements or COMMIT/ROLLBACK.
    Said that it does not make much sence to use a procedure within a function.IT make sense if we DECLARE FUNCTION AS PRAGMA AUTONOMUS_TRANSACTION
    then we can execute DDL or DML statements or COMMIT/ROLLBACK in that function.
    Regards
    HiteshBut why would you do that?

  • Call procedure without specifcation from shell scrip

    I am writing shell script. In that I am calling one of the procedure lets say "ABC" from package "V".
    exec V.abc ();
    problem is that procedure ABC does not have specifications in package. It has only body defined.
    I am getting error as procedure undefined.
    Is there any way to call procedure in the BODY part without specifications.
    Problem here is package is not owned by me so I can not change anything in that .
    Please suggest.
    Thanks in advance.

    No, the procedure is private in the package body. You can't access it if it is not in the package specification.
    Ask the owner of the package to declare it in the package specification, make it public...
    How do you know that this procedure exists anyway?

  • Call procedure's package from sql query ?

    Hi,
    I've write a package. In this package there is a procedure A with this parameters (in x, in y, out z).
    In the second procedure B, i want te create a cursor like this :
    'select * from table where table.fiels in ( A.(x,y) )'
    Is it possible to do this ?
    Thanks for the answer.

    I think so. Could you flesh out your code a little more? Yes of course, this is my PLSQL code :
    /*This is the first procedure */
    procedure Get_IDGeneriques(i_idfamille in generiquesliensfamilles.idfamille%type, i_idprofil in generiqueslienslistesmono.idlisteprofil%type, i_idconstitution in generiqueslienslistesmono.idlisteconstitution%type, i_idserie in generiqueslienslistesmono.idlisteseriefraises%type, i_idpas in generiqueslienslistesmono.idlistepasfraises%type, i_idtypeattache in generiqueslienslistesmono.idlisteattache%type, i_idlisteSensISO in generiqueslienslistesmono.idlisteSensISO%type, i_idlistearrosagecentre in generiqueslienslistesmono.idlisteArrosageCentre%type, i_listematieres in varchar2, i_listemachines in varchar2,i_listeopes in varchar2, o_idgenerique out tbl_bin_int)
    is
    BEGIN
    DECLARE
    TYPE TypeCursorReq IS REF CURSOR;
              test TypeCursorReq;
    sqlstm VARCHAR2(4000);
    recordcount number default 0;
    idgenerique generiqueslienslistesmono.idref%type;
    BEGIN
    sqlstm := 'SELECT GENERIQUESLIENSLISTESMULTI.IDGENERIQUE FROM GENERIQUESLIENSLISTESMULTI, GENERIQUESLIENSLISTESMULTI GENERIQUESLIENSLISTESMULTI1, GENERIQUESLIENSLISTESMULTI GENERIQUESLIENSLISTESMULTI2
    WHERE GENERIQUESLIENSLISTESMULTI.IDGENERIQUE = GENERIQUESLIENSLISTESMULTI1.IDGENERIQUE AND GENERIQUESLIENSLISTESMULTI.IDGENERIQUE = GENERIQUESLIENSLISTESMULTI2.IDGENERIQUE AND (GENERIQUESLIENSLISTESMULTI.TYPE1 =''MT'')
    AND GENERIQUESLIENSLISTESMULTI.IDLISTE IN (' || i_listematieres || ') AND (GENERIQUESLIENSLISTESMULTI1.TYPE1 =''OP'') AND GENERIQUESLIENSLISTESMULTI1.IDLISTE IN (' || i_listeopes || ') AND GENERIQUESLIENSLISTESMULTI2.TYPE1 =''MA''
    AND GENERIQUESLIENSLISTESMULTI2.IDLISTE IN (' || i_listemachines || ')';
    OPEN test for sqlstm;
                        LOOP
                        FETCH test INTO      idgenerique;
                        EXIT WHEN test%NOTFOUND;
    recordcount := recordcount+1;
    o_idgenerique(recordcount) := idgenerique;
    END LOOP;
    END;
    end;
    /* This is the second procedure who call the first one */
    procedure Get_IDOutils(i_idfamille in generiquesliensfamilles.idfamille%type, i_idprofil in generiqueslienslistesmono.idlisteprofil%type, i_idconstitution in generiqueslienslistesmono.idlisteconstitution%type, i_idserie in generiqueslienslistesmono.idlisteseriefraises%type, i_idpas in generiqueslienslistesmono.idlistepasfraises%type, i_idtypeattache in generiqueslienslistesmono.idlisteattache%type, i_idlisteSensISO in generiqueslienslistesmono.idlisteSensISO%type, i_idlistearrosagecentre in generiqueslienslistesmono.idlisteArrosageCentre%type, i_listematieres in varchar2, i_listemachines in varchar2,i_listeopes in varchar2, o_idoutil out tbl_bin_int)
    is
    BEGIN
    DECLARE
    TYPE TypeCursorReq IS REF CURSOR;
              test TypeCursorReq;
    sqlstm VARCHAR2(4000);
    recordcount number default 0;
    idoutil outilslienslistesmono.idref%type;
    BEGIN
    sqlstm := 'SELECT * FROM OUTILSLIENSLISTESMONO,LIENSGENERIQUESOUTILS
    WHERE OUTILSLIENSLISTESMONO.IDRef = LIENSGENERIQUESOUTILS.IDRefOutilFabMati
    AND LIENSGENERIQUESOUTILS.IDRefGeneFabMati in (Get_IDGeneriques(1,232,22,47,26,210,206,50,''10444,10448,10451'',''10337'',''10319'') )';
    OPEN test for sqlstm;
                        LOOP
                        FETCH test INTO      idoutil;
                        EXIT WHEN test%NOTFOUND;
    recordcount := recordcount+1;
    o_idoutil(recordcount) := idoutil;
    END LOOP;
    END;
    end;
    END TITAN2;

  • Calling a PL/SQL from Forte code

    Hi, We are using the Sun UDS 5.1.3
    I need to call directly from the code a PL/SQL stored procedure. It is true that this would defeat the Forte layer purpose but I have a very specific case. Is there an easy way to do so?

    I don't remember how after all these years, but I remember that I made a native Informix call in a special way. So it seems logical that you should be able to do the same for Oracle...
    Scott

  • Calling Procedure or Function from Interative Report

    Hi All -
    Is it possible to call a procedure/function from "Region Source" of Interact Report page.
    Basically the report I want to show would be little difficult if I use SQL alone. So wanted to check is there is a way I can call a SQL procedure/function from Apex Interactive Report Page.
    Please share your expertise.
    Thanks,
    -Seenu

    Hi,
    These links might help
    http://www.oracleapplicationexpress.com/tutorials/71-oracle-apex-interactive-report-based-on-plsql-function
    http://sungur.wordpress.com/2009/10/11/apex-interactive-reports-with-dynamic-sql/
    Br,Jari

  • Problem calling Procedure with parameter from Dynamic Page

    I received an error saying the Page not found
    here's how to reproduce the error.
    1. Create procedure in portal30 schema.
    Create or Replace PROCEDURE PORTAL30.ADD_TWO_VALUES
    v_one IN NUMBER,
    v_two IN NUMBER,
    v_result OUT NUMBER)
    as
    begin
    v_result :=v_one+v_two;
    end;
    2. Create Dynamic Page with following code
    <ORACLE>DECLARE
    v_total NUMBER;
    BEGIN
    ADD_TWO_VALUES(:v_one,:v_two, v_total);
    htp.p('The total is => ');
    htp.p('<input type="TEXT" VALUE='||v_total||'>');
    htp.para;
    htp.anchor('http://<machine.domain:port#>/pls/portal30/PORTAL30.DYN_
    ADD_TWO_VALUES.show_parms', 'Re-Execute Procedure');
    END;</ORACLE>
    3. I clicked on Customize Link and entered 2 numbers as values for v_one and v_two.
    4. Got "The page cannot be found" error in I.E. or "The requested URL /pls/portal30/PORTAL30.DYN_SAMPLE_ADD.show was not found on this server." on Netscape
    However when I subsitute "ADD_TWO_VALUES(:v_one,:v_two, v_total);" in the dynamic page for "ADD_TWO_VALUES(3,2, v_total);", it runs just fine.
    What's wrong here? Can I not use a parameter from a dynamic page and call a procedure with it? Help is needed urgently and will be greatly appreciated.
    -Ahsun

    Hi,
    I tried with your code with few changes ,please try with them.
    Create or Replace PROCEDURE <myschema>.ADD_TWO_VALUES
    v_one IN NUMBER,
    v_two IN NUMBER,
    v_result OUT NUMBER)
    as
    begin
    v_result :=v_one+v_two;
    end;
    I created the procedure in <mySchema> and granted that to <application_schema> and made some changes
    <ORACLE>
    DECLARE
    v_total NUMBER;
    BEGIN
    <procedure_schema>.ADD_TWO_VALUES(:v_one,:v_two, v_total);
    htp.p('The total is => ');
    htp.p('<input type="TEXT" VALUE='||v_total||'>');
    htp.para;
    htp.anchor('http://<your_host>/pls/<portal_schema>/<application_schema>.DYN_FOR_OTN.SHOW_PARMS', 'Re-Execute Procedure');
    END;
    </ORACLE>
    Hope this helps.
    rahul

  • How to run @d:\emp.sql  from Oracle Procedure

    Dear All experts
    Help me in executing a sql file containing simple insert statements. This file is being run on SQL prompt
    by the flowing command.
    @d:\emp.sql;
    But i want run it through procedure.
    @d:\emp.sql
    Thanks.

    A stored procedure does not normally invoke external SQL scripts. Stored procedures run on the database server and should only be calling objects created in the database. So I would strongly suspect that you need to rethink your architecture.
    If you are determined, however, you could potentailly
    - Put the .SQL file on the database server
    - Create a Java stored procedure that calls out to the operating system
    - Have that Java stored procedure invoke SQL*Plus and pass SQL*Plus the name of your .SQL file
    - Call that Java stored procedure from your stored procedure
    This would, of course, be a highly convoluted architecture, which is why the right answer is probably to rethink things.
    Justin

  • Calling a method from a UICommand Object

    How do I call an action method from a UICommand object?
    I create a HtmlCommandLink in my backing bean, and I think I should be setting the action, but with what? The method takes a MethodBinding but I can't find much detail on how to get that. I just want to call a method like linkAction1_action() in the example below, but you cannot pass a method.
    public class Page1 extends AbstractPageBean {
      private HtmlPanelGroup panel = new HtmlPanelGroup();
      public HtmlPanelGroup getPanel() {
        return panel;
      public void setPanel(HtmlPanelGroup panel) {
        this.panel = panel;
      public Page1() {
        HtmlCommandLink link = new HtmlCommandLink();
        link.setAction(/* what do I put here */);
        this.panel.getChildren().add(link);
      public String linkAction1_action() {
        return "GoBack";
    }

    OK. A couple days later and I am able to answer my
    own question. Anyway, I will lay it out there for
    anyone interested. This worked for me...
    public class Page1 extends AbstractPageBean {
    private HtmlPanelGroup panel = new HtmlPanelGroup();
    public HtmlPanelGroup getPanel() {
    return panel;
    public void setPanel(HtmlPanelGroup panel) {
    this.panel = panel;
    public Page1() {
    HtmlCommandLink link = new HtmlCommandLink();
    link.setAction(
    FacesContext.getCurrentInstance()
    .getApplication()
    .createMethodBinding("#{Page1.linkAction1_action}",
    new Class[0]));
    this.panel.getChildren().add(link);
    public String linkAction1_action() {
    return "GoBack";
    Since you're setting the action from within the Page1 object, why don't you create a method binding manually? This will be much more performant that using the application to create and EL-based binding.
    Try:
    link.setAction(new MethodBinding()
          public Object invoke(FacesContext facesContext, Object[] objects) throws EvaluationException, MethodNotFoundException
            return linkAction1_action();
          public Class getType(FacesContext facesContext) throws MethodNotFoundException
            return String.class;
    });Note that you also avoid any naming convention - you do not require your Page1 object to be configured as a managed bean "Page1".

  • Java method call from c passing string more info

    I am trying to call a java method from c passing a String as an argument.
    my C code is as follows.
    //Initalise jstring and class (to recieve String)
    jstring textp;
    jclass texts = (*env)->GetObjectClass(env, obj);
    jmethodID text = (*env)->GetMethodID(env, texts, "texture", "([Ljava/lang/String;)V");
    //Create a new jstring from the char* texturePath (in textures)
    //call the java method with the jstring
    textp = (*env)->NewStringUTF(env,ret.textures->texturePath);
    (*env)->CallVoidMethod(env, obj, text,textp);
    //java code
    // texture which recieves a string
    public void texture(String texturePath){
    The error I get is as follows:
    SIGSEGV 11 segmentation violation
    si_signo [11]: SEGV
    si_errno [0]:
    si_code [1]: SEGV_MAPERR [addr: 0xc]
    stackpointer=FFBED790
    "Screen Updater" (TID:0x4f9060, sys_thread_t:0x4f8f98, state:CW, thread_t: t@11, threadID:0xf2d31d78, stack_bottom:0xf2d32000, stack_size:0x20000) prio=4
    [1] java.lang.Object.wait(Object.java:424)
    [2] sun.awt.ScreenUpdater.nextEntry(ScreenUpdater.java:78)
    [3] sun.awt.ScreenUpdater.run(ScreenUpdater.java:98)
    "AWT-Motif" (TID:0x40be50, sys_thread_t:0x40bd88, state:R, thread_t: t@10, threadID:0xf2d71d78, stack_bottom:0xf2d72000, stack_size:0x20000) prio=5
    [1] sun.awt.motif.MToolkit.run(Native Method)
    [2] java.lang.Thread.run(Thread.java:479)
    "SunToolkit.PostEventQueue-0" (TID:0x431950, sys_thread_t:0x431888, state:CW, thread_t: t@9, threadID:0xf2e71d78, stack_bottom:0xf2e72000, stack_size:0x20000) prio=5
    [1] java.lang.Object.wait(Object.java:424)
    [2] sun.awt.PostEventQueue.run(SunToolkit.java:407)
    "AWT-EventQueue-0" (TID:0x430ea8, sys_thread_t:0x430de0, state:CW, thread_t: t@8, threadID:0xf3071d78, stack_bottom:0xf3072000, stack_size:0x20000) prio=6
    [1] java.lang.Object.wait(Object.java:424)
    [2] java.awt.EventQueue.getNextEvent(EventQueue.java:212)
    [3] java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:100)
    [4] java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:91)
    [5] java.awt.EventDispatchThread.run(EventDispatchThread.java:83)
    Exiting Thread (sys_thread_t:0xff343db0) : no stack
    "Finalizer" (TID:0x154e98, sys_thread_t:0x154dd0, state:CW, thread_t: t@6, threadID:0xfe391d78, stack_bottom:0xfe392000, stack_size:0x20000) prio=8
    [1] java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:146)
    [2] java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:168)
    [3] java.lang.ref.Finalizer$FinalizerWorker$FinalizerThread.run(Finalizer.java:124)
    "Reference Handler" (TID:0x1506a0, sys_thread_t:0x1505d8, state:CW, thread_t: t@5, threadID:0xfe3c1d78, stack_bottom:0xfe3c2000, stack_size:0x20000) prio=10
    [1] java.lang.Object.wait(Object.java:424)
    [2] java.lang.ref.Reference$ReferenceHandler.run(Reference.java:130)
    "Signal dispatcher" (TID:0x13d180, sys_thread_t:0x13d0b8, state:MW, thread_t: t@4, threadID:0xfe3f1d78, stack_bottom:0xfe3f2000, stack_size:0x20000) prio=10
    "main" (TID:0x38918, sys_thread_t:0x38850, state:R, thread_t: t@1, threadID:0x25228, stack_bottom:0xffbf0000, stack_size:0x800000) prio=5 *current thread*
    [1] loader.Callbacks.nativeMethod(Native Method)
    [2] loader.Callbacks.main(Callbacks.java:184)
    [3] graphics.GR_MakeTrack.init(GR_MakeTrack.java:60)
    [4] graphics.GR_MakeTrack.main2(GR_MakeTrack.java:49)
    [5] graphics.GR_MakeTrack.main(GR_MakeTrack.java:41)
    [6] control.GE_main.GE_main1(GE_main.java:87)
    [7] control.GE_main.main(GE_main.java:66)
    gmake: *** [run] Abort (core dumped)

    I am trying to call a java method from c passing a
    String as an argument.
    my C code is as follows.
    //Initalise jstring and class (to recieve String)
    jstring textp;
    jclass texts = (*env)->GetObjectClass(env, obj);
    jmethodID text = (*env)->GetMethodID(env, texts,
    "texture", "([Ljava/lang/String;)V");
    Hi Pete,
    your problem is that the method texture you are trying to find does not exist. If you look carefully at your declaration of the method signature in the GetMethodID call you will see "([Ljava/lang/String;)V" which is trying to find a method that accepts a String array as its parameter. Remove the [ from the method signature and it should work ok. You might want to test text (jmethodID) for NULL or 0 before trying to call it as well.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Maybe you are looking for

  • Uploading an InDesign Document to "Issuu Online"

    I work for a small newspaper that produces a monthly catalog of homes for sale in my area. Beyond printing this free publication on a press we also upload it to the Issuu Online website so readers will have access to the homes online as well. I took

  • Save button in Maverick's Mail ?

    The older versions of Mail, previous to Mavericks (don't recall how it was in Mountain Lion), had a Save (or Save as Draft in older Mail versions) in the bar at the top of the window when composing an email. I know it appears that Mail now saves the

  • Remove symbol or stop points?

    Hello! I am currently doing game design at university and Have recently started looking at action script 3. I am not struggling too much and can usually find the answer to what I am looking for but this really has me stumped. I want to add an item to

  • Photoshop CS layered files ok in CS5?

    Does anyone know if there are problems opening layered files from Photoshop CS in CS5? I'm about to upgrade and need to know if the layered TIFFs and PSDs I created in CS will open as layers in CS5.

  • How do I change the fact that my iMessage now lists my email address to reply to instead of phone number or name?

    How do I change the fact that my iMessage now lists my email address to reply to instead of phone number or name?