PL/SQL Entity Object - How to access OUT parameters in OA Page

Hi,
I have the following pl/sql code which takes 4 input parameter and inserts values to database table.
create or replace procedure xxfwk_emp_create(p_person_id IN NUMBER, p_first_name IN VARCHAR2, p_last_name IN VARCHAR2, p_sal IN NUMBER, p_error_msg OUT VARCHAR2) is
cursor c1 is select EMPLOYEE_ID from fwk_tbx_employees;
v_status varchar2(1) := 's';
BEGIN
for v_c1 in c1 loop
if v_c1.employee_id = p_person_id then
p_error_msg:= 'Person with this id already exist';
v_status := 'e';
end if;
exit when c1%notfound OR v_status='e' ;
end loop;
if v_status = 'e' then
goto error;
end if;
INSERT INTO FWK_TBX_EMPLOYEES(EMPLOYEE_ID,
FIRST_NAME,
LAST_NAME,
     FULL_NAME,
SALARY,
CREATION_DATE,
CREATED_BY,
LAST_UPDATE_DATE,
LAST_UPDATED_BY,
LAST_UPDATE_LOGIN)
VALUES(p_person_id,
p_first_name,
p_last_name,
P_first_name||' '||p_last_name,
p_sal,
sysdate,
fnd_global.user_id,
sysdate,
fnd_global.user_id,
fnd_global.login_id);
<<error>>
null;
END xxfwk_emp_create;
I have following code in EO Impl class
public void insertRow()
try
OADBTransactionImpl oadbTrans = (OADBTransactionImpl)getDBTransaction();
String s = "begin xxfwk_emp_create(p_person_id=>:1, p_first_name=>:2, p_last_name=>:3, p_sal=>:4, p_error_msg=>:5);end;";
OracleCallableStatement oraCall = (OracleCallableStatement)oadbTrans.createCallableStatement(s,-1);
oraCall.setNUMBER(1,getEmployeeId());
oraCall.setString(2,getFirstName());
oraCall.setString(3,getLastName());
oraCall.setNUMBER(4,getSalary());
*< How to access Out Parameter from The procedure >*
oraCall.execute();
catch(SQLException sqlException)
throw OAException.wrapperException(sqlException);
catch(Exception exception)
throw OAException.wrapperException(exception);
In this insertRow i want to get the error message (out param) and throw this message as exception in OA page.
What changes i need to do in my page?
Regards,
Ram

You can use this code...
String current_value=null;
OracleCallableStatement st1=null;
try {
String stmt = "begin xxfwk_emp_create(:1,:2,:3,:4,:5); end;";
OADBTransaction oadbTransaction1 = am.getOADBTransaction();
st1 =(OracleCallableStatement)oadbTransaction1.createCallableStatement(stmt,1);
          st1.setNUMBER(1,getEmployeeId());//or you can use st1.setInt(1,getEmployeeId())
          st1.setString(2,getFirstName());
          st1.setString(3,getLastName());
st1.setNUMBER(4,getSalary());
          //Define Out parameter...
st1.registerOutParameter(5,OracleTypes.VARCHAR);
     st1.executeUpdate();
          //Access out parameter value
     current_value=st1.getString(5);
catch (SQLException s) {
throw new JboException(s);
finally {
try {
if (st1 != null) st1.close();
catch (SQLException s) { }
}

Similar Messages

  • PL/SQL Entity Object - Accessing Out parameter values in insertRow method

    Hi,
    I have the following pl/sql code which takes 4 input parameter and 1 out parameter.
    create or replace procedure xxfwk_emp_create(p_person_id IN NUMBER, p_first_name IN VARCHAR2, p_last_name IN VARCHAR2, p_sal IN NUMBER) is
    cursor c1 is select EMPLOYEE_ID from fwk_tbx_employees;
    v_status varchar2(1) := 's';
    BEGIN
    for v_c1 in c1 loop
    if v_c1.employee_id = p_person_id then
    p_error_msg:= 'Person with this id already exist';
    v_status := 'e';
    end if;
    exit when c1%notfound OR v_status='e' ;
    end loop;
    if v_status = 'e' then
    goto error;
    end if;
    INSERT INTO FWK_TBX_EMPLOYEES(EMPLOYEE_ID,
    FIRST_NAME,
    LAST_NAME,
    FULL_NAME,
    SALARY,
    CREATION_DATE,
    CREATED_BY,
    LAST_UPDATE_DATE,
    LAST_UPDATED_BY,
    LAST_UPDATE_LOGIN)
    VALUES(p_person_id,
    p_first_name,
    p_last_name,
    P_first_name||' '||p_last_name,
    p_sal,
    sysdate,
    fnd_global.user_id,
    sysdate,
    fnd_global.user_id,
    fnd_global.login_id);
    <<error>>
    null;
    END xxfwk_emp_create;
    I have following code in EO Impl class
    public void insertRow()
    try
    OADBTransactionImpl oadbTrans = (OADBTransactionImpl)getDBTransaction();
    String s = "begin xxfwk_emp_create(p_person_id=>:1, p_first_name=>:2, p_last_name=>:3, p_sal=>:4, p_error_msg=>:5);end;";
    OracleCallableStatement oraCall = (OracleCallableStatement)oadbTrans.createCallableStatement(s,-1);
    oraCall.setNUMBER(1,getEmployeeId());
    oraCall.setString(2,getFirstName());
    oraCall.setString(3,getLastName());
    oraCall.setNUMBER(4,getSalary());
    *< How to access Out Parameter from The procedure >*
    oraCall.execute();
    catch(SQLException sqlException)
    throw OAException.wrapperException(sqlException);
    catch(Exception exception)
    throw OAException.wrapperException(exception);
    In this insertRow i want to get the error message (out param) and throw this message as exception in OA page.
    What changes i need to do in my page?
    Regards,
    Ram

    Thanks sumit..
    I changed the code as below still i am not getting the error message on the page.
    In jdeveloper i am successfully printing the error message.
    here is the code..
    try
    OADBTransactionImpl oadbTrans = (OADBTransactionImpl)getDBTransaction();
    String s = "begin xxfwk_emp_create(p_person_id=>:1, p_first_name=>:2, p_last_name=>:3, p_sal=>:4, p_error_msg=>:5);end;";
    OracleCallableStatement oraCall = (OracleCallableStatement)oadbTrans.createCallableStatement(s,-1);
    oraCall.setNUMBER(1,getEmployeeId());
    oraCall.setString(2,getFirstName());
    oraCall.setString(3,getLastName());
    oraCall.setNUMBER(4,getSalary());
    String p_error_msg = null;
    System.out.println("Error message before call "+p_error_msg);
    Types OracleTypes;
    oraCall.registerOutParameter(5,OracleTypes.VARCHAR);
    if (p_error_msg!=null)
    throw new OAException(p_error_msg,OAException.ERROR);
    oraCall.execute();
    p_error_msg = oraCall.getString(5);
    System.out.println("Error message after call "+p_error_msg);
    catch(SQLException sqlException)
    throw OAException.wrapperException(sqlException);
    catch(Exception exception)
    throw OAException.wrapperException(exception);
    Regards,
    Ram

  • How to retreive out parameters from function in sql statement

    hi dear,
    Suppose i have a fuction with two "out" parameters, i want to show the values of these paramenters in sql stm.
    like
    select my_function() from dual;
    Thanx

    Can't be done. To use a function in SQL it can only have a single return value.
    Try something like this changing the data types appropriately.
    var x number
    var y number
    var z number
    exec :x := my_function(:y, :z)
    print

  • How to access another control in a page in another xaml file?

    I have a XAML page name GameMainSP.xaml. Can I access a control in that page from a module in the project? I was only trying to change a text block controls Text property. Is this possible?
    Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth. - "Sherlock holmes" "speak softly and carry a big stick" - theodore roosevelt. Fear leads to anger, anger leads to hate, hate leads to suffering
    - Yoda. Blog - http://www.computerprofessions.co.nr

    I have a XAML page name GameMainSP.xaml. Can I access a control in that page from a module in the project? I was only trying to change a text block controls Text property. Is this possible?
    Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth. - "Sherlock holmes" "speak softly and carry a big stick" - theodore roosevelt. Fear leads to anger, anger leads to hate, hate leads to suffering
    - Yoda. Blog - http://www.computerprofessions.co.nr
    Nevermind, I managed to figure out what was the problem. I needed to provide a reference to the page.
    Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth. - "Sherlock holmes" "speak softly and carry a big stick" - theodore roosevelt. Fear leads to anger, anger leads to hate, hate leads to suffering
    - Yoda. Blog - http://www.computerprofessions.co.nr

  • How to access GET-parameters in portal url

    Is it possible to access GET-parameters in a bsp application in an iview in the enterprise portal, and if so, how do I do it?
    If you look at the url of this post (/message/1514719#1514719 [original link is broken])
    I would like to have the value of "forumID" in the bsp application in the iview with shortlink "thread".

    Raja,
    your solution is what I was initially looking for, so thank you.
    Can you also supply a link to the article you refer to?  I can't find it:-)
    But while looking for this I found something even better, a way to pass parameters to an iview without having to define them in the iview ApplicationParameter-property.
    Apparently the trick is to add the parameter "DynamicParameter" to the url, that translates to different parameters in your bsp application(iview).
    So if you want your bsp application to have the parameters "roomid=555&date=01.01.2007" your url should be
    http://bla/irj/portal/rooms?DynamicParameter=roomid%3D555%26date%3d01.01.2007
    where %3D is the ascii representation of "=" and %26 is the ascii representation of &.
    I found this here : /message/529588#529588 [original link is broken] , but in this thread they say to separate the parameters by a ";", whereas for me it only works when i use %26 (&).
    Message was edited by: Dries Horions

  • How to Access User Parameters in Web Reports

    Hi Friends,
    I am working on Oracle Reports 9i. I am able to access user parameters in Paper Layout by using :user_param1 or &User_param1. But when i am using the same to access user parameters in web source i am not able to access these.
    Actually inside a report i want to create a hyperlink for executing an another report. In this hyperlink i need to pass some user parameters too. But when i am using web source i am unable to access user parameters. Can Somebosy help me on that.
    Thanka in advance
    Regards
    Kamal
    [email protected]

    Hi Kamal,
    For you requirement, the following chapter in the 'Building Reports manual' should help you. Go through the chapter-" Building a Simple Parameter Form for a JSP-based Web Report'. This will help you on how to create a parameterform and to run the report based on the parameter value.
    You can download this manual from the location http://download.oracle.com/docs/html/B10602_01/toc.htm.
    Thanks,
    Vidya

  • How to find out what version of pages is running. I don't see get info link?

    how do i find out what version of pages is operating. i have updated but see no get info link?

    When Pages is running, select Pages > About Pages.  The latest version that only runs on OS X Mavericks is 5.0.1.

  • How to access BSP-Parameters in the URL in view "ICCMP_BTSHEAD/BTSHeader"?

    Dear Expert,
    I have the foloowing links:
    <Server>:Port/sap/bc/bsp/sap/crm_ui_frame/default.htm?crm-object-type=BT116_SRVTK&crm-object-action=B&crm-object-value=<GUID>&sap-client=200&sap-language=DE.
    I would like to access the parameter value "crm-object-value=<GUID>" in the view "ICCMP_BTSHEAD/BTSHeader" to do some checks before loding the view?
    How to do that?
    Is there a method or attributes of the view implementation class to do that?
    Best regards
    Ahmed Hadi

    Hi,
    You can read URL query parameters in your view(.htm) as like below:
    data: lv_guid type string.
    lv_guid = request->GET_FORM_FIELD( name = 'crm-object-value' ).
    regards
    Ismail

  • How to access module parameters?

    Hi,
    I'm developing own module for XI File Adapter.
    I found in the weblogs how to get source file name. Thanks.
    But how do I get custom parameter specified for the module?
    Where could I check all readable parameters, apart from source file name? For instance source dir?
    Thanks.

    Hi
    The parameter "moduleContext" in the process (moduleContext,inputModuleData) method has a method getContextData(String name)....
    This can be used to read the module configuration parameters.
    For the filename, i believe you are doing the following:-
    using the getSupplementalData(String param) of inputModuleData with the value for param being 'module.parameters' to get a hashtable and out of the hash table you are reading an entry for "FileName"
    So let me suggest you a wild try...Did you try checking for "SourceDirectory" in the hashtable?
    You could also get all the keys/values in this hashtable and put it somewhere in the xml and see what all parameters are there in message monitoring(This is just a suggestion for a simple debugging...).
    Thanks & Regards,
    Renjith

  • How to access Outlook Express from home page

    How can I add access to email on my home page?

    Outlook Express is a separate program from Firefox, and all Firefox can do is allow you to set your home page. Customizing your home page depends on what your home page is set to.
    See [[How to set the home page]].
    What is the address of your home page?

  • How to access class method in jsp page

    hi ,
    I am new to JSP . I want to access a method returning an arraylist
    of a class.
    this class i saved in WEB-INF>classes folder > where other classes like logonform , etc. are saved ....
    import stmt is <%@ page import="java.io.*, java.util.*, readXml " %>
    <% readXml rd= new readXml();
    Arraylist list=rd.parseDoc();
    %>
    It is not recognizing readXml class......
    Can any body help me in this regard......
    plz help .... i m in urgent need
    thanks in advance.......

    better to put class in a pkg inside webinf> classes folder ...
    but in my case constructor was not public......
    public readXml(){}
    now it works fine...... :)

  • How to access url parameters in query builder side

    I call a report via url and it works fine but now i want to use lexical parametrs.
    I create a lexical parameter in the report but how can i establish relation between url parametrs and lexical parametrs from report?
    Example
    URL: report1.rtf?PUser=1&PCity=2
    REPORT: P_WHERE lexical parameter
    How can i define that something like P_WHERE -> "where user=PUser and city=PCity"
    Please give me a hand, its urgent
    Thanks

    Hi,
    do this in the after paramform trigger:
    :p_where := 'where user='||PUser||' and city='||PCity;
    Regards
    Rainer

  • How to access Print Dialog boxe's "Pages" property

    Hi,
    I am using the following line to populate the Print dialog box.
    xfa.host.print(1, "0", (xfa.host.numPages-1).toString(), 0, 1, 0, 0, 0)
    Is there any way that I can access Pages option using JavaScript with Adobe LiveCycle Designer 8.0 where I can show the page range to print?
    I want to print 3 copies of 1st Page and then the one copy of full PDF. So in the Pages option of Print dialog box I want to display 1,1,1,1-9. Is there any way to accomplish this programmatically?
    Or is there any better way to print 3 copies of 1st page and then 1 copy of whole pdf?
    Thanks.
    Niketa Parekh

    Hi,
    I am using the following line to populate the Print dialog box.
    xfa.host.print(1, "0", (xfa.host.numPages-1).toString(), 0, 1, 0, 0, 0)
    Is there any way that I can access Pages option using JavaScript with Adobe LiveCycle Designer 8.0 where I can show the page range to print?
    I want to print 3 copies of 1st Page and then the one copy of full PDF. So in the Pages option of Print dialog box I want to display 1,1,1,1-9. Is there any way to accomplish this programmatically?
    Or is there any better way to print 3 copies of 1st page and then 1 copy of whole pdf?
    Thanks.
    Niketa Parekh

  • How to find out in which items, pages a function/procedure,.. will be used?

    I'm searching for the answer for:
    Are there any script tools which find all place in apex , where functions/ packages/ procedures be used ?
    -> want find where p_my_function is using. (Item level, page level, ....)
    Thank in advanced
    Hendrik
    Edited by: Hendrik Schmidt on Dec 13, 2010 12:46 AM

    Based on the APEX views (*Home > Utilities > Application Express Views*) I've been using this, run in the parsing schema for the application. It's set up to look at one application at a time as this is the best fit for our requirements:
    with search as (
          select :search_term search_term from dual)
      , app_source as (
          select
                    'Application Computation' component
                  , null                      page_id
                  , null                      sequence
                  , aac.computation_item      name
                  , null                      point
                  , aac.computation_type      type
                  , to_clob(aac.computation)  source
                  , s.search_term
          from
                    apex_application_computations aac
                  , search                        s
          where
                    nvl(aac.condition_type, 'None') != 'Never'
          and       (   aac.computation_type like 'SQL%'
                     or aac.computation_type like 'PL/SQL%')
          and       regexp_like(aac.computation, s.search_term, 'ni')
          union all
          select
                    'Application Process'
                  , null                
                  , aap.process_sequence
                  , aap.process_name    
                  , aap.process_point   
                  , aap.process_type    
                  , aap.process         
                  , s.search_term
          from
                    apex_application_processes  aap
                  , search                      s
          where
                    aap.application_id = :app_id
          and       nvl(aap.condition_type, 'None') != 'Never'
          and       regexp_like(aap.process, s.search_term, 'ni')
          union all
          select
                    'Application Tree'
                  , null
                  , null
                  , aat.tree_name
                  , null
                  , null
                  , to_clob(aat.tree_query)
                  , s.search_term
          from
                    apex_application_trees  aat
                  , search                  s
          where
                    aat.application_id = :app_id
          and       regexp_like(aat.tree_query, s.search_term, 'ni')
          union all
          select
                    'LOV'
                  , null
                  , null
                  , aal.list_of_values_name
                  , null
                  , null
                  , to_clob(aal.list_of_values_query)
                  , s.search_term
          from
                    apex_application_lovs aal
                  , search                s
          where
                    aal.application_id = :app_id
          and       aal.lov_type = 'Dynamic'               
          and       regexp_like(aal.list_of_values_query, s.search_term, 'ni')
          union all
          select
                    'Page Process'
                  , aapp.page_id
                  , aapp.execution_sequence
                  , aapp.process_name     
                  , aapp.process_point    
                  , aapp.process_type     
                  , aapp.process_source   
                  , s.search_term
          from
                    apex_application_page_proc  aapp
                  , search                      s
          where
                    aapp.application_id = :app_id
          and       nvl(aapp.condition_type, 'None') != 'Never'
          and       regexp_like(aapp.process_source, s.search_term, 'ni')
          union all
          select
                    'Page Region'
                  , aapr.page_id
                  , aapr.display_sequence
                  , aapr.region_name     
                  , aapr.display_position
                  , aapr.source_type     
                  , aapr.region_source   
                  , s.search_term
          from
                    apex_application_page_regions aapr
                  , search                        s
          where
                    aapr.application_id = :app_id
          and       aapr.source_type in ('Report', 'PL/SQL', 'Tabular Form', 'Tree')
          and       nvl(aapr.condition_type, 'None') != 'Never'
          and       regexp_like(aapr.region_source, s.search_term, 'ni')
          union all
          select
                    'Page Item'
                  , aapi.page_id
                  , aapi.display_sequence
                  , aapi.item_name
                  , aapi.region
                  , aapi.item_source_type
                  , to_clob(aapi.item_source)
                  , s.search_term
          from
                    apex_application_page_items   aapi
                  , apex_application_page_regions aapr
                  , search                        s
          where
                    aapi.region_id = aapr.region_id
          and       aapr.application_id = :app_id
          and       nvl(aapi.condition_type, 'None') != 'Never'
          and       nvl(aapr.condition_type, 'None') != 'Never'
          and       (   aapi.item_source_type like 'SQL%'
                     or aapi.item_source_type like 'PL/SQL%')
          and       regexp_like(aapi.item_source, s.search_term, 'ni')
          union all
          select
                    'Page Computation'
                  , aapc.page_id
                  , aapc.execution_sequence
                  , aapc.item_name
                  , null
                  , aapc.computation_type
                  , to_clob(aapc.computation)
                  , s.search_term
          from
                    apex_application_page_comp  aapc
                  , search                      s
          where
                    aapc.application_id = :app_id
          and       nvl(aapc.condition_type, 'None') != 'Never'
          and       (   aapc.computation_type like 'SQL%'
                     or aapc.computation_type like 'PL/SQL%')
          and       regexp_like(aapc.computation, s.search_term, 'ni')
          union all
          select
                    'Page Validation'
                  , aapv.page_id
                  , aapv.validation_sequence
                  , aapv.validation_name
                  , null
                  , aapv.validation_type
                  , to_clob(aapv.validation_expression1 || '/' || aapv.validation_expression2)
                  , s.search_term
          from
                    apex_application_page_val  aapv
                  , search                     s
          where
                    aapv.application_id = :app_id
          and       nvl(aapv.condition_type, 'None') != 'Never'
          and       (   aapv.validation_type like 'SQL%'
                     or aapv.validation_type like 'PL/SQL%')
          and       regexp_like(aapv.validation_expression1 || aapv.validation_expression2, s.search_term, 'ni'))
    select
              page_id
            , component
            , sequence
            , name
            , point
            , type
            , search_term
            , count(*) over (partition by search_term) func_use_count
    from
              app_source
    where
              search_term is not null
    order by
              page_id nulls first
            , component desc
            , sequence
            , name
            , point
            , type;Edited by: fac586 on 13-Dec-2010 09:14
    Note that this is on an APEX 3.0 installation. There may be more potential locations to be checked in later versions.

  • How to find out if the "Services" page is shown on the phone?

    Hello! I have a application that pushes a page(which is actually a picture) to the user's Cisco phone, at certain time, I'll need to remove that page from the screen. To push a "Key:Services" works, but only when the page is currently displayed. If the page is pushed back, or if the page has already been removed (by user select a "Clear" soft button), then pushing "Key:Services" from server will cause strange and inconsistent behavior. Bascially I'll need to know if the "Services" page is shown on the phone screen, probably by visiting the phone's web server somewhere(just don't know where).
    I managed to get around a problem like this a while back but not that lucky this time... Any ideas? Thank you very much for your help!

    alright, this is the url I had in mind: http:/IP_PHONE_ADDRESS/CGI/ModelInfo
    See http://forums.cisco.com/eforum/servlet/NetProf?page=netprof&forum=IP%20Communications%20and%20Video&topic=IP%20Phone%20Services%20for%20Developers&CommCmd=MB%3Fcmd%3Ddisplay_location%26location%3D.1ddb6101 for a discussion.

Maybe you are looking for