How to get two of the parameter that is used in the procedure

Hi experts,
Am on the thought, but not yet answer keep me... so am here

With the help of Jdev11.1.1.5.0 - adfbc.

I got in db procedure like this
PROCEDURE proc_find_x_cal_year_period
(
     p_bu                    VARCHAR2,
     p_date                    DATE,
     p_year           OUT          NUMBER,
     p_period             OUT           NUMBER
).................
I wrote it in my AM, procedure is executing and printing of the param values perfect
    public void ProcFindxCalYearPeriod(String pbu,
                                    oracle.jbo.domain.Date pdate)
            {
            CallableStatement st = null;
            try{
            String sql = "begin proc_find_x_cal_year_period" +
                "(:pbu," +
                ":pdate," +
                ":pyear," +
                ":pperiod)" +
                ";" +
                "end;";
            st=getDBTransaction().createCallableStatement(sql,this.getDBTransaction().DEFAULT);
            st.setObject("p_bu",pbu);
            st.setObject("pdate",pdate);
            st.registerOutParameter("pyear",Types.VARCHAR);
            st.registerOutParameter("pperiod",Types.VARCHAR);
            st.execute();
            System.out.println("pyear" +(String)st.getObject("pyear"));
            System.out.println("pperiod" +(String)st.getObject("pperiod"));
            }
            catch(SQLException e)
            {
            throw new JboException(e);
            }

            finally
            {
            if(st!=null)
            try{
            st.close();
            }
            catch(SQLException e){}
            }
            }
what I've done / my need:
I paste this ProcFindxCalYearPeriod in my EO, and so am validating one of the field, this procedure should call at the time of the call, two parameters in two corresponding setter methods.
(String) st.getObject ("pyear")
(String) st.getObject ("pperiod")
value is here, I want to set setAttributeInternal ('x', (String) st.getObject ("pyear"));
setAttributeInternal ("x 1", (String) st.getObject ("pperiod"));

I hope that you all understand.

In your procedure, you must create an object to hold out and return this object

public ProcResult ProcFindxCalYearPeriod(String pbu, oracle.jbo.domain.Date pdate)
            {
            CallableStatement st = null;
            try{
            String sql = "begin proc_find_x_cal_year_period" +
                "(:pbu," +
                ":pdate," +
                ":pyear," +
                ":pperiod)" +
                ";" +
                "end;";
            st=getDBTransaction().createCallableStatement(sql,this.getDBTransaction().DEFAULT);
            st.setObject("p_bu",pbu);
            st.setObject("pdate",pdate);
            st.registerOutParameter("pyear",Types.VARCHAR);
            st.registerOutParameter("pperiod",Types.VARCHAR);
            st.execute();
            System.out.println("pyear" +(String)st.getObject("pyear"));
            System.out.println("pperiod" +(String)st.getObject("pperiod"));
            //assuming that you are getting the desired outputs
            *ProcResult outputs=new ProcResult();*
            *outputs.setOutParam1((String)st.getObject("pyear"));*
            *outputs.setOutParam2((String)st.getObject("pperiod"));*
            *return outputs;*
            }
            catch(SQLException e)
            {
            throw new JboException(e);
            }

            finally
            {
            if(st!=null)
            try{
            st.close();
            }
            catch(SQLException e){}
            }
            }

Now, you call this procedure like this

ProcResult execProc= ProcFindxCalYearPeriod(paramValue1, paramValue2);
//you can get the proc outputs by calling
String firstOutput = execProc.getOutParam1();
String second = execProc.getOutParam2();

But the question is why you call setAttributeInternal() while you are trying to validate an attribute?
I think that is not correct.

Tags: Java

Similar Questions

  • How to get data in the procedure after CREATE TABLE table1 AS SELECT * from table2

    Hello

    can any body tell me how to get the data in the new table created in the procedure. because it gives following error.

    • Error (47,21): PL/SQL: ORA-00942: table or view does not exist

    tableName: = "BCKUP_" | TO_CHAR (sysdate, 'ddmmrrrr');

    tableDDL: = 'CREATE TABLE' | tableName. "AS SELECT * FROM Table1 where to_char(MSG_IN_TIME,''dd-mon-rrrr'') < sysdate - ' | daysNumber;

    EXECUTE IMMEDIATE backUpDDL;

    COMMIT;

    DELETE FROM Table1;

    How to select the data in the newly created table. as...

    Select * from ". tableName;

    Do not choose anything to get the number...

    Just after backupDDL EXECUTE IMMEDIATE, simply refers to SQL % ROWCOUNT - who will be the number of lines.

    Oh and DDL engages automatically, your commitment is redundant.

  • How to get rid of the new menu button on the right side of the toolbar

    Honestly, I don't know why the developers cannot offer new features that we can use or not, by choice. Instead, things are forced upon us.

    Could someone tell me please how to get rid of the new menu button on the right side of the toolbar?

    It doesn't seem to be an option to remove via the Customize Toolbars window.

    Thank you very much.

    CTR extension makes Firefox customizable menu button 3 bar, so you can drag this button in the palette to customize to remove it from the Navigation toolbar.

    Reload and stop probably combine only if you set the two buttons in the correct order (reload - Stop and non-Stop - Reload)

  • I can't use Roboform with 4.0 beta 10, so I can't use Firefox. How to get back to the beta version 9?

    I can't use Roboform with 4.0 beta 10, so I can't use Firefox. How to get back to the beta version 9?

    I think that there is a little more for it, but here's a solution that seems to work. After the installation of Roboform 7.1.7, go to: http://www.roboform.com/platforms/browsers/firefox and scroll down to a table listing the three browsers identifying the XPI file to load if it was not loaded automatically. Click the http://www.roboform.com/dist/roboform-firefox-3-4-frozen.xpilink. Firefox will ask you if you want to allow this should be installed. Let him. Finish installation, restart Firefox 4.0b10, and you'll see a Roboform 7.1.7 toolbar works. I did it on two computers, and everything seems to work.

  • Tracing a png - how to get rid of the background

    I imported a png image of a simple drawing of a man in black (as you can see on a bathroom door) with a transparent background and tried to trace it to a vector, but I can't get rid of the white background. I tried it in jpeg format to see if the route command would generate two thicknesses for the main drawing and one for the background that I could remove, but he di awaters. I tried to adjust the fuction just Trace expose but does nto work no more.

    Can someone tell me how to get rid of the background by drawing a simple image or to break the object to get the shape of the background?

    Kevin

    Use Expand in the menu object and then use the direct Selection tool to select the white and remove. You will need the transparency grid show be enabled in the view menu to see it.

  • How to get and install the file txtsetup.oem for xp

    need to know how to get and install the txtsetup.oem file to install xp

    Hello

    The easiest way would be to visit the website of the manufacturer of the motherboard. This would normally have downloads for any RAID drivers required for the loading of Windows XP. The download can be an "executable" who writes a disk for you. It can be also something like a zip file with all files inside that must be extracted and copied to a floppy disk.

    If your PC is not a floppy drive, life becomes quite complicated.

    Please mark this as useful or response if applicable.

    Tricky

  • Any ideas how to get rid of the rose?

    I just signed up for the first time today and everything on my screen that should be white is pink. I know that the monitor support always white because when I first connect there is a small screen which lights up and that switches from analog to digital and it is bright white. Any ideas how to get rid of the rose? Tried to DISPLAY on the control panel and could not fix. Thanks, people.

    Hi rutherford nbr 1.
     
    -Did you of recent changes made to your computer before this problem?
     
    Make sure that the monitor cable is correctly connected. In addition, if you have another computer, the same connect to your computer to confirm that the issue is not because of the screen.
     
    Make sure that there is no electric devices with magnets next to your screen.
     
    Follow these steps and check if it helps fix the problem.
     
    a. Click START and select control PANEL.
    b. Select and click VIEW.
    c. Select SETTINGS on the Interface of the screen and then ADVANCED.
    d. on the advance Interface, choose COLOR MANAGEMENT tab.
    e. on Interface, click on add color management. You will see a list of color profiles.
    f. choose the most appropriate to the brand of the screen / graphics card. You can choose several color profile and a default setting.
     
    For more information, see:
  • How to get and set the length and the width of the content of the layer?

    How to get and set the length and the width of the content of the layer

    All layers are packed not equal. a layer as adjustment have no limits. Layer to smart object can have two different sizes. The size of the object and the size of the object may be transformed. All smart object layers have an associated transform. To transform a smart object layers you need to work with the size of the object the generated pixels fot the layer. Text layer can be resized with a transform or by changing the font size. Pixelated layers are resize via a transformation.  The script method is resize.  When you resize the number of pixelsits made by interpolation. You can specify what method to use or set Photoshop interpolation preferably by default.

    There is also a bug in Photoshop scripts if you pause the story said make a selection and use resize. Photoshop will properly support up to a State before where you suspended history. This bug seems to be in all versions of Photoshop.

    If you look ate the script in my bug report, you should get a good idea of how to resize a layer.

    Photoshop: Bug Script resize the rear paper folded to a history State

  • How to get TableId in the Document by FDK?

    My Code getting Table, but it does not work.

    He can only get a cell contained = "Source of FrameMaker Item.

    This content does not exist in my table.


    tableId = F_ApiGetId (0, DocId, FP_FirstTblInDoc);

    While (tableId) {}

    firstrowId = F_ApiGetId (DocId, tableId, FP_FirstRowInTbl);

    so that {(firstrowId)

    Rad_error_nocontent = F_ApiGetId (DocId, firstrowId, FP_FirstCellInRow);

    so that {(Rad_error_nocontent)

    Rad_error_nocontent = F_ApiGetId (DocId, firstrowId, FP_NextCellInRow);

    }

    firstrowId = F_ApiGetId (DocId, tableId, FP_NextRowInTbl);

    }

    tableId = F_ApiGetId (FV_SessionId, DocId, FP_NextTblInDoc);

    }

    }


    How to get TableId in the Document by FDK?

    diatranthanhoa,

    I do not understand your question. But if you try to browse all the cells of each table, you have errors in your code. These are common mistakes. The errors are:

    -FP_NextTblInDoc is a property of a table object, not the document

    -FP_NextRowInTbl is a property of a line object, not the table

    -FP_NextCellInRow is a property of a cell, not the line object

    So, I have maturities adjust your code as follows, noting that I didn't test this:

    tableId = F_ApiGetId (0, DocId, FP_FirstTblInDoc);

    While (tableId) {}

    firstrowId = F_ApiGetId (DocId, tableId, FP_FirstRowInTbl);

    so that {(firstrowId)

    Rad_error_nocontent = F_ApiGetId (DocId, firstrowId, FP_FirstCellInRow);

    so that {(Rad_error_nocontent)

    Rad_error_nocontent = F_ApiGetId (DocId, Rad_error_nocontent, FP_NextCellInRow);

    }

    firstrowId = F_ApiGetId (DocId, firstrowId, FP_NextRowInTbl);

    }

    tableId = F_ApiGetId (DocId, tableId, FP_NextTblInDoc);

    }

    }

    Hope this helps,

    Russ

  • DELL Precision T7500 eSata connector on the rear of the machine - how to get power to the drive?

    Howdy,

    I have a DELL Precision T7500 with an eSata connector on the rear of the machine - all my existing SAS and SATA ports on the motherboard are taken and I want to connect an external SATA drive.  How to get power to the drive?

    Is there a map that I can buy.  I have PCI, PCI - X, 2 slots available on the motherboard PCI Express.

    Should I consider that meanders on a power cable 4 wires from inside the machine?

    Thanks in advance.  :)

    Greetings MakesOwnWeather,

    Thank you for your question.

    You need to use what we call a 'hard drive enclosure. What is the physical size of the hard drive external that you want to use? 2.5 inches? 3.5 inches?

    The device draws power eSATA or USB below don't ports so no need of an additional power cable. He receives only 2.5-inch disks.

    http://Accessories.Dell.com/SNA/ProductDetail.aspx?c=CA&l=en&s=DHS&CS=cadhs1&SKU=a3018200

  • How to get rid of the stupid list dropdown in the search box

    How to get rid of the stupid list dropdown in the search box

    If you want to restore the window previously used independently to manage search engines, you can enable or disable this pref to false with a middle-click on the topic: config page.

    • topic: config page: browser.search.showOneOffButtons = false

    Close and restart Firefox to force change.

  • How to get rid of the superdrive in menu bar?

    How to get rid of the superdrive in menu bar?

    Hold down the command key and drag it off the menu.

  • How to get rid of the photo of the sunset on the webcam?

    HI -.

    It's probaby a stupid question, but please can someone tell me how to get rid of the image of the sunset on the webcam and allow me to use the photo and video on my netbook?

    I tried to contact Toshiba online but it does not connect.

    Thank you
    Stocks

    Sorry mate but I put t understand the question
    What cell phone do you have?
    Do you mean the internal s laptop webcam?

    If this can be useful?
    http://forums.computers.Toshiba-Europe.com/forums/thread.jspa?MessageID=189664

    -Drag your mouse on your pop out where you choose to use your webcam, instead click the option at the bottom of the "Effect" in their 'net', click and click 'OFF' Tada! The now disappeared from your cam Image, +.

    Please send feedback!

  • configeration Silverlight - how to get rid of the protected mode

    How to get rid of the protected mode

    Hello Gloria,.

    Try the following site devoted to Silverlight: http://www.silverlight.net/community.

    I hope this helps.

    Good luck!

  • How to get rid of the virus of the moneyak of the fbi?

    How to get rid of the virus of the moneyak of the fbi?

    How to get rid of the virus of the moneyak of the fbi?

    http://www.bleepingcomputer.com/virus-removal/remove-FBI-monkeypak-Ransomware

Maybe you are looking for

  • Recovery media

    I'm putting in place 10 identical HP touchsmart tm2 computers laptops.  I need to create recover media sets for every laptop or can I create 1 game and use it as needed.  It is the system repair disc, should I create 1 or 1 for each laptop.

  • HP Officejet 4630 does not print color

    I am trying to print photos colors from my mac to my wireless printer. The computer and the printer register that there is a color ink cartridge in the printer, but it will just print colored picures. I downloaded and redownloaded the driver, y at -

  • MSXML 4.0 sp2 (kb973688) ruined my PC!

    Nothing opens once updated widows installed MSXML 4.0 sp2 (kb973688) 11/25/09. Unable to open Windows Update, network and sharing Center, Control Panel(sometimes in classic view it comes up), Microsoft OneCare, MSCONFIG... Tried UN-installing but jus

  • How can I find my files to my e-mail account (some missing)

    We had trouble with our mail account a few months ago and to bring us to the top and they are past us at an account with the same e-mail hotmail address, but now we cannot access our files which I had moved some of our emails that we didn't delete an

  • Catylist control center has stopped working

    Pop - up said ccc has stopped working, Aproblematique he did stop working. Does not say what kind of trouble caused this