Calling Stored function and showing returned value on the UI screen

I am calling a stored function by using the following steps mentioned as per the below link. The stored function returns a single scalar value
http://download.oracle.com/docs/cd/E1790401/web.1111/b31974/bcadvgen.htm#sm0297_
Please verify if I am putting the code in the classes as required by the ADF framework.
* 1) In class CustomApplicationModuleImpl extends ApplicationModuleImpl*
// Some constants
public static int NUMBER = Types.NUMERIC;
public static int DATE = Types.DATE;
public static int VARCHAR2 = Types.VARCHAR;
protected Object callStoredFunction(int sqlReturnType, String stmt,
Object[] bindVars) {
CallableStatement st = null;
try {
// 1. Create a JDBC CallabledStatement
st = getDBTransaction().createCallableStatement(
"begin ? := "+stmt+";end;",0);
// 2. Register the first bind variable for the return value
st.registerOutParameter(1, sqlReturnType);
if (bindVars != null) {
// 3. Loop over values for the bind variables passed in, if any
for (int z = 0; z < bindVars.length; z++) {
// 4. Set the value of user-supplied bind vars in the stmt
st.setObject(z + 2, bindVars[z]);
// 5. Set the value of user-supplied bind vars in the stmt
st.executeUpdate();
// 6. Return the value of the first bind variable
return st.getObject(1);
catch (SQLException e) {
throw new JboException(e);
finally {
if (st != null) {
try {
// 7. Close the statement
st.close();
catch (SQLException e) {}
With a helper method like this in place, calling the func_with_no_args procedure shown in Example 37-7 would look like this:
*2) In class CustomServiceImpl extends CustomApplicationModuleImpl*
public String callEnvironmentName(){
return (String) callStoredFunction(VARCHAR2, "CAR_UTIL_PK.get_environment_name()", new Object[] {});
3) If I have the first two steps correct, I was to display the value returned by method callEnvironmentName() with scalar values like (Development, Production etc) at the footer of each JSFX page. What is the flow I should follow, should I call callEnvironmentName() from some managed bean? Also I want to store it once on first call to some application variable and use that to populate the JSFX pages. Is there a working example. What is the best practice?
Thanks
Edited by: user5108636 on Apr 5, 2011 11:58 PM

Hi John,
Duplicate alerts are coming for BP_Confirmed as well as one custom event. Earlier I thought there is some issue with my custom event, but when it came for BP_Confirmed also, then i have a doubt something is wrong with the application.
I have also checked that BP_Confirmed is being raised only once inside the method-BP_CONFIRM of class-cl_crmcmp_b_cucobupa_impl.
raise event BPConfirmed
  CLASS cl_crm_ic_services DEFINITION LOAD.
  CREATE OBJECT event.
  event->set_name( if_crm_ic_events_con=>gc_bpconfirmed ).
  event_srv = cl_crm_ic_services=>get_event_srv_instance( ).
  event_srv->raise( event ).
Are you aware of any other place from where this event is getting triggered?
Thanks for your help!
Regards,
Rohit

Similar Messages

  • I just bought a MacBook Pro, and need to d/l my photos from my memory card reader.  iphoto keeps coming up as the app to use, but the column on the left says "No name, and shows 0 photos on the black screen.  How do I view the photos on the reader?

    I just bought a MacBook Pro, and need to d/l my photos from my memory card reader.  iphoto keeps coming up as the app to use, but the column on the left says "No name, and shows 0 photos on the black screen.  How do I view the photos on the reader?

    Did it...  When I clicked on "No name", a file folder came up and, I forgot to put MacBook Pro in the name bar... That was it!  Maybe someone else can use this post Hopefully...

  • I have OSX 10.5.7 on my Intel Mac. When I try to login using the correct password the screen goes white and just returns back to the login screen. It does not jiggle like when you enter the wrong password.

    I have had a number of issues with my Intel Mac recently and had to reboot using disk utilities, safe mode, OSX recovery, but always come back to the login screen but when I type my password the screen goes white and returns to the login screen. My password is correct and the login does not jiggle as it would if the password was wrong. Please advise,

    Back up all data if you haven’t already done so. There are ways to back up, even if you can’t log in. Before proceeding,you must be sure you can restore everything to the state it’s in now. If you’re not sure you can do that, STOP.
    The procedure below may spare you the need for a clean reinstallation of OS X. If you don't feel comfortable carrying it out, don't. try.
    Briefly, you need to delete the following file:
    /var/audit/current
    If you already know how to do that, you can skip the rest of this message. Do it, and try again to log in.
    Boot in single-user mode by holding down the key combination command-S at the startup chime. If you’re using an external USB keyboard, it must be plugged directly into a built-in port on the Mac, not into a hub. Release the keys when you see a black screen with scrolling white text. In this mode, there’s no graphical interface; just a command line. Initially, you can’t make any changes to files.
    When the text stops scrolling, and you see a line ending in a pound sign (“#”), type the following command:
    mount -uw /
    You must type the command exactly as given, with no mistakes. If you don’t feel able to do that, STOP. At this stage, no harm will be done if you make a mistake, but later, it will be. Press the return key.
    Next, type the following command:
    rm -i /var/audit/current
    Press return. You should get the following output:
    remove /var/audit/current?
    If that's not what you get, STOP. Type the single letter N, press return, and try again. Otherwise, type the single letter Y and pressreturn.
    Finally, enter the command:
    exit
    Press return. The text will start scrolling again, and then the system will reboot. Try again to log in.
    Credit for this solution to ASC user AnthonyTW.

  • Transaction Launcher : calling URL and fill return values in the UI

    Hi SDN,
    We have a requirement, I am putting an example of it below:-
    1. Call URL www.bank.com/branchlocator.htm?postcode=???????
    2. pass postcode of confirmed BP to the branchlocator field postcode
    3. the website will return nearest branch post code.
    4. Return this postcode from the bank website, back into the webui address field.
    Is it possible to achieve the above scenerio? if yes then any guidelines on how to achieve this?
    Hope I am clear in the requirement. Any inputs/suggestion will be helpful.
    Thanks,
    Pankaj

    Hi Shai,
    the webservice is working well, trying to test it with webservice navigator.
    He also returns the correct number of rows (because there appears slider beneath the table output and I also counted the rows), but there is no data displayed in visual composer.
    I have got no further ideas, what the problem is...
    THank you for your support.
    Kind regards, PAtrick.

  • Call Web Service and display return values in table

    Hi all,
    I am calling a self-implemented web service with visual composer. The webservice returns the following data shown below.
    Each item like carID, carBrand etc. should be displayed in an output table.
    The problem is, that he doesn't display any data at all. Is there a problem with the webservice data which is returned or do I have to do some further settings in visual composer?
    Thank you for your help! Kind regards, Patrick.
      <?xml version="1.0" encoding="utf-8" ?>
    - <ArrayOfCar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://IBM-W2003-EAI/GetCarList">
    - <Car>
      <CarID>A-471</CarID>
      <CarBrand>Alfa</CarBrand>
      <CarModel>156</CarModel>
      <Kw>100</Kw>
      <Ps>136</Ps>
      <Km>79000</Km>
      <Year>1998</Year>
      <Price>7500,0000</Price>
      <Url />
      <Status>Available</Status>
      </Car>
    - <Car>
      <CarID>A-736</CarID>
      <CarBrand>Audi</CarBrand>
      <CarModel>A4</CarModel>
      <Kw>110</Kw>
      <Ps>150</Ps>
      <Km>87000</Km>
      <Year>2000</Year>
      <Price>15780,0000</Price>
      <Url />
      <Status>Reserved</Status>
      </Car>
    </ArrayOfCar>

    Hi Shai,
    the webservice is working well, trying to test it with webservice navigator.
    He also returns the correct number of rows (because there appears slider beneath the table output and I also counted the rows), but there is no data displayed in visual composer.
    I have got no further ideas, what the problem is...
    THank you for your support.
    Kind regards, PAtrick.

  • My iphone3gs shuts off when i jump between apps or run certain apps...  even with 90 percent it will shut down and shows vertical lines through the black screen...  any ideas what this could be?

    My iphone 3gs shuts off when flipping to different apps or running certain apps.  If it crashes badly I need to plug power to the device to bring it up.  This happens whether i have even 90 percent battery life.  Any idea as to what this may be? 

    Sounds like a major hardware problem.
    If no change after restoring your iPhone as a new iPhone or not from your iPhone's backup, there is a hardware problem.

  • Mountain Lion Desktop crash? Randomly it returns me to the login screen and I have restart all my apps

    So after install of Mountain Lion (never happened before) my desktop crashes and it returns me to the login screen.  After I login I have to restart all my apps.
    One morning this happened 5+ times in under an hour.  So my productivity has gone down :-(
    I work around this by only running three apps (finder, terminal & firefox), and then it sees to only happen 2-3 times a day...sigh.
    The only other odd thing and have no idea if it is related is that firefox was showing some animated image from the olympics and when I had it on one screen it was fine, when I had the window on the other screen, the image was not the right image, it looked like it had reached into the screen buffer of other applications and was displaying that (e.g. where there was a scrolling flame for the right image, there was some scrolling upside down text from my terminal when I had it on the other screen where the flame was supposed to be).
    An help on how to debug/solve would be helpful.

    You're welcome. If you use Zoom often try the new show controller feature. It's below where you turned zoom off. Once you turn it on you can use it to turn Zoom on and off. Plus you can use zoom as a magnifying glass instead of full screen.

  • Calling Oracle Functions and Procedures in Java

    I've looked online for a blurb on using Oracle SQL functions and
    procedures in Java, but I haven't found anything. Can someone
    either give me a quick crash course on this, or point me to the
    best source of information for this?

    From the SQLJ FAQ.
    http://otn.oracle.com/tech/java/sqlj_jdbc/htdocs/faq.html#sqljplsql
    Within your SQLJ statements, you can use PL/SQL anonymous blocks
    and call PL/SQL stored procedures and stored functions, as in the
    following examples: Anonymous
    block:
    #sql {
    DECLARE
    n NUMBER;
    BEGIN
    n := 1;
    WHILE n <= 100 LOOP
    INSERT INTO emp (empno) VALUES(2000 +
    n);
    n := n + 1;
    END LOOP;
    END
    Stored procedure call (returns the maximum
    deadline as an output parameter into an output host expression):
    #sql { CALL MAX_DEADLINE(:out maxDeadline) };
    Stored function call (returns the maximum
    deadline as a function return into a result expression):
    #sql maxDeadline = { VALUES(GET_MAX_DEADLINE)
    Of course, you can also use JDBC code to achieve the same - the
    standard JDBC escape sequences for stored function and procedure
    calls are supported, using for example:
    "{? = CALL GET_MAX_DEADLINE}"
    or:
    "{call MAX_DEADLINE(?)}"
    and for the rest of the details, get that JDBC crash course...

  • How to call a dialog program with return value in another dialog program

    Dear All,
    How can I call a dialog program with return value from another dialog program?
    Regards,
    Alok.

    Hi Alok,
    You can you SET/GET parameters to do this.
    This is some information about this.
    To fill the input fields of a called transaction with data from the calling program, you can use the SPA/GPA technique. SPA/GPA parameters are values that the system stores in the global, user-specific SAP memory. SAP memory allows you to pass values between programs. A user can access the values stored in the SAP memory during one terminal session for all parallel sessions. Each SPA/GPA parameter is identified by a 20-character code. You can maintain them in the Repository Browser in the ABAP Workbench. The values in SPA/GPA parameters are user-specific.
    ABAP programs can access the parameters using the SET PARAMETER and GET PARAMETERstatements.
    To fill one, use:
    SET PARAMETER ID pid FIELD f.
    This statement saves the contents of field f under the ID pid in the SAP memory. The ID pid can be up to 20 characters long. If there was already a value stored under pid, this statement overwrites it. If you double-click pid in the ABAP Editor, parameters that do not exist can be created as a Repository object.
    To read an SPA/GPA parameter, use:
    GET PARAMETER ID pid FIELD f.
    This statement places the value stored under the pid ID into the variable f. If the system does not find any value for pid in the SAP memory, sy-subrc is set to 4. Otherwise, it sets the value to 0.
    Thanks,
    SriRatna

  • Oracle stored functions and where clauses

    Hello everybody,
    I need to call an Oracle stored function and at the same time do a select on
    the result of the query, it works well except when I use a where clause. I
    am connecting to Oracle 8.1.7 through OLEDB using the Oracle provider for
    OLEDB distributed with this Oracle version.
    Here is the query I am doing:
    select * from {call MC.SEC.QryTermbases(?, ?) where ID = ?}
    If I remove the where clause it works well but I need to use the where. I
    know that I could pass the parameter to the procedure instead of doing that
    in the select but there are places where I can not do that since the SQL
    query is generated dynamically. The code above is just a demo.
    Thanks very much for your help,
    Jose.

    Thanks for answering, it is actually possible to do a select on the return of a function, I have tested it with other than "select *" and it has worked well. What has not worked for me is using a "where" clause. That is "select" without "where" has worked but not with the "where".
    I also suspect that it does not work but similar queries work well in MSSQL 2000 and Interbase 6.0 so I thought may be there was a way to do that with Oracle. That is in MSSQL I can treat the result of a function as a normal table and I can do the same thing with a stored procedure that returns a recordset in Interbase.
    Thanks again for answering,
    Jose.

  • How to call stored function in my jsp

    how to call stored function in my jsp?
    please give me a example.

    Hi,
    think we need mor einformation, like JDeveloper release and the how you do access the database (JDBC, BC4J, EJB,ADF...)
    Frank

  • Please Help regard function that will return values of each JComboBox items

    I'd like to create a function that will return values of each item on the JComboBox at a time when
    I click on each item of a comboBox. I had this following codes, but didn't work.
    Please help me !!!Please correct it... thanks a million
    String wp;
    String text;
    String A[] = {"WARNIGNS","CAUTIONS","NOTES"};
    JComboBox ABC = new JComboBox();
    for (int i=0;i<A.length;i++) {
    ABC.addItem (A);
    text = Get_It(); //assigns each value of JComboBox's item to variable text when clicks at each item
    //of a comboBOx
    private String Get_It(){
    ABC.addActionListener(new ActionListener (){
    public void actionPerformed(ActionEvent e){
    wp = (String)CBweapon.getSelectedItem() ;
    return wp;

    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    public class AlertFrame extends JFrame {
    String s_alert[] ={"WARNIGNS","CAUTIONS","NOTES"};
    JComboBox CBweapon;
    String wpText;
    public AlertFrame() {
    super("Alerts");
    Container contentPane = getContentPane();
    contentPane.setLayout(null);
    setSize(600,600);
    CBweapon = new JComboBox();
    for (int i=0;i<s_weapon.length;i++) {
    CBweapon.addItem (s_weapon);
    contentPane.add(CBweapon);
    CBweapon.setActionCommand("");
    //set position for components
    CBweapon.setBounds(370 + insets.left,295+ insets.top, 150,30);
    System.out.println(getit()); //calling getit() function
    //this function will be return a String of JcomboBOx value if click on each item of combobox
    private String getit(){
    CBweapon.addActionListener( new ActionListener (){
    public void actionPerformed(ActionEvent e){
    wpText = (String)CBweapon.getSelectedItem() ;
    return wpText;
    public static void main(String args[]) {
    AlertFrame af = new AlertFrame();
    af.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.exit(0);
    **I have no errors on compile or run, but it didn't return a string value to System.out.println(getit());
    It maybe because of the "void" of public void actionPerformed(ActionEvent e){
    wpText = (String)CBweapon.getSelectedItem() ;
    Please help me

  • How to create a procedure function with a return value of ref cursor?

    Can anybody provide a sample about how to create a procedure function with a return value of REF CURSOR?
    I heard if I can create a function to return a ref cursor, I can use VB to read its recordset.
    Thanks a lot.

    http://osi.oracle.com/~tkyte/ResultSets/index.html

  • Difficulty in creating a chart by using a function with a returned value

    Hi,
    I am having a problem in using own function to create chart a with a returned value as the chart. If not using the returned value, it works fine.
    Is this a known issue?

    If you share some code, we might be able to help you.

  • Urgent! Display lookup value and return value at the same time.

    We are using pop up lov.
    How can we display lookup value and return value at the same time. let me claer..
    Our lov query is like fallowing
    select dname, deptno from dept
    we want to return deptno column into a database bind text item and dname column into a display item (look up)
    can we do it (we need to do)
    thanks for your help.

    We did it .
    But pop up key lov (display description return value ) property doesn't appear for tabular forms item.
    (Report Attributes pages Tabular Form Element section display As property list)
    can we set or not.
    Thank you.

Maybe you are looking for