How to display the return value of a function in a text field

Hi,
I have 2 textfields in a page.
i> Empno
ii> Salary
The requirement is,
i. Enter an Employee No.
ii. On click of the 'SUBMIT' button a process would be executed which calls a function (or procedure with out parameter) which returns the Salary of the given Employee.
iii. Need to display the salary to the 2nd textfield (Salary).
Here is my process:
i. If procedure call-- :P2_X is a page text field and out parameter.
begin
Pri_test_PROC(:P2_EMPNO,:P2_X);
end;ii. If Function call --
begin
:P2_X:=Pri_test_PROC(:P2_EMPNO);
end;
Issue:
The process is not getting executed and returning the process error message.
Could anyone please give me a pointer, how to overcome the issue. Or if this is not the right way, then what is the work around.
Regards
Antara

Antara,
1. Clue about the error - yes, when I see the error message.
2. What happens if you try to create a procedure like this:
CREATE OR REPLACE PROCEDURE fetch_sal (in_emp IN NUMBER, out_sal OUT NUMBER)
IS
BEGIN
   FOR c IN (SELECT sal
               FROM emp
              WHERE empno = in_emp)
   LOOP
      out_sal := c.sal;
   END LOOP;
END;and then run this in SQL Plus:
DECLARE
   v_sal   VARCHAR2 (20);
BEGIN
   fetch_sal (7839, v_sal);
   DBMS_OUTPUT.put_line (v_sal);
END;What do you get displayed?
Denes Kubicek
http://deneskubicek.blogspot.com/
http://htmldb.oracle.com/pls/otn/f?p=31517:1
-------------------------------------------------------------------

Similar Messages

  • How to Access the Return Value of a Function

    Hi,
    How do I access the return value when calling an Oracle function from .NET using Oracle.DataAccess.Client? The function returns an integer of 0, 1 or 99.
    Dim db_command_oracle As New OracleCommand()
    db_command_oracle.Connection = db_connection_oracle
    db_command_oracle.CommandType = CommandType.StoredProcedure
    db_command_oracle.CommandText = "swsarsi.import_appointments"
    Dim ret_value As New OracleParameter()
    ret_value.OracleDbType = OracleDbType.Int32
    ret_value.Direction = ParameterDirection.ReturnValue
    ret_value.Size = 2
    ret_value.OracleDbType = OracleDbType.Int32
    db_command_oracle.Parameters.Add(ret_value)
    Dim IN_student_id As New OracleParameter()
    IN_student_id.OracleDbType = OracleDbType.Varchar2
    IN_student_id.Direction = ParameterDirection.Input
    IN_student_id.Size = 10
    IN_student_id.Value = student_id
    db_command_oracle.Parameters.Add(IN_student_id)
    db_command_oracle.ExecuteNonQuery()
    messagebox.show(ret_value) ?????

    Your ODP.NET code looks correct. What error are you seeing?
    One thing that will definitely generate an error is that .NET message boxes require that strings be displayed. ret_value is a parameter object. You need to access its value and convert it to a string. At a minimum, you need to change that.

  • How to get the return values from a web page

    Hi all :
       how to get the return values from a web page ?  I mean how pass values betwen webflow and web page ?
    thank you very much
    Edited by: jingying Sony on Apr 15, 2010 6:15 AM
    Edited by: jingying Sony on Apr 15, 2010 6:18 AM

    Hi,
    What kind of web page do you have? Do you have possibility to for example make RFCs? Then you could trigger events (with parameters that could "return" the values) and the workflow could react to those events. For example your task can have terminating events.
    Regards,
    Karri

  • How to display the sort value in the selection screen in the report title

    Dear All,
    How to display the sort value in the selection screen in the report title? I have selected a value in the selection screen for sorting , but i need that values by which i have sorted with in the report title. Can you please throw some light on this!!
    Good day,
    Thanks and regards
    Arun S

    Hi Arun,
    Try this.
    1, Set one dynamic parameter,
    2, Drag and drop that parameter into  your report title.
    3, Pass the value(sort value) dynamically from your application,
    4, Cheers..
    Other wise Try with Dataset, create a dataset and fill thev alue into that.. Then  set the data source from CR designer. and darg and drop that data column into the report.
    Hope this will work,
    Regards,
    Salah
    Edited by: salahudheen muhammed on Mar 25, 2009 11:13 AM

  • How to store the return value from a select list in page item ?

    I'm sorry, I'm sure you will all flame me for this (and its long too :-(. I'm still trying to pick this up and havn't had time to read manual and this forum and up against the clock (as usual), but this must be something thats simple to do, otherwise why have 2 cols on LOV (display text and return value.
    normal kind of thing - master /detail, a master table and a detail table, master.id is PK in master, master.name is the name of the master item. detail.id is pk in detail, detail.mid is foreign key to master.id. I have a tabular report that displays a join of cols from master and detail, with 2 cols being links, one is a link on master.name, that passes master.id to page P1 and it displays a row from master. The other col displays detail.name and passes detail.id to page P3, P3 displays a row of the detail table.
    I want to populate a LOV with possible master.name values, but display the name of the current P3_MID value (from detail.mid). Then a user can pick a different master and it needs to update P3_MID so on submit it updates the row.
    I just can't seem to see in the manual how you can specify where the return value on a LOV goes?
    As I said, sorry for long post and not having had time to read docs correctly - someone just point me at the subject matter somewhere, please.

    Sorry, I was trying to be to complex and obviously APEX is just too damn cleaver - I figured out how this works - basically APEX pulls the LOV and then matchs the mid to it to display the correct name - simple and easy - just me making it difficult

  • How to get the return value of a LOV item using javascript

    Hello,
    I am trying to put an onchange attribute in the HTML Form Element Attributes field of a LOV item. The javascript should access the new return value of the item. How is this done ? All the methods I have tried give only the display value, not the return value. For example $v() returns the display value.
    Tiina

    If your item is called P1_ITEM this will give you the return value of a popup (displays description,returns key value)
    alert($x('P1_ITEM_HIDDENVALUE').value)
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • How to pass the return value?

    when i call another procedure in a different vi file(xxx.sql), how am i going to pass the return value that the end user key in?
    how to Promt the message and accept the value that keyed in?
    Please help...
    this is urgent!
    Thank you.

    Use OUT paramter to pass values from called procedure.
    You can pass the values as IN / IN OUT / OUT
    parameters.
    For sample coding please mail
    null

  • How to Change the return value for the parameters

    Hi, Can anyone help me with my problem?
    I have a parameter called "P1_Projects" defined in the HTMLDB page, on the report region, there are 2 buttons, one is "Go" button to submit the report on the screen, so user can preview the report, then another button "Export to PDF" can be clicked to generate the report using Oracle Report Services. The "Export to PDF" button will use the same set of parameters submitted for the "Go" button.
    So, the parameter "P1_Projects" is being used by these 2 buttons. and I have to pass a "%" wild card for "All Projects". To make the "Export to PDF" button work, I have to safe encode the return value for "%" to "%25" in order to pass the URL formula, but now my "Go" button doesn't work with "%25", it only recognize the "%" wild card.
    Is there a way to conditionally change the value depends which button is clicked?
    Any hint or help is highly appreciated!
    Hong

    try creating a plsql process which sets the P1_Projects item as required.
    in the plsql you can do:
    if :REQUEST = 'GO' then
    xxx
    else
    xxxx
    end if;
    set the condition to plsql expression:
    :REQUEST in ('GO', 'EXPORT')
    NB. the request value is usually set to the button name when a page is submitted from a button

  • How to set the returned value of CFL in a matrix

    dear all,
    I got a matrix binded to a DataSource and two CFLs are in this matrix. The codes for handling AfterChooseFromList is as following.  It works almost fine. But when a docoment containing more than two
    rows in the matrix and I reselect the CFL cell values more than two times, an error occured sometimes, not everytime. The error message is "This entry already exists in the following tables @CYW_PRROW [Message 131-183]"
    I have tried to find out what kind of situation to cause this error, but still in the mud.
    Can anybody give me some suggestion? Thanks.
    Public Sub OnAfterChooseFromList_Matrix(ByVal pVal As SAPbouiCOM.ItemEvent)
            Dim ActionSuccess As Boolean = pVal.ActionSuccess
            Dim oform As SAPbouiCOM.Form = SBO_Application.Forms.Item(pVal.FormUID)
            Dim oitem As SAPbouiCOM.Item = oform.Items.Item("mtx_0")
            Dim omatrix As SAPbouiCOM.Matrix = CType(oitem.Specific, SAPbouiCOM.Matrix)
            Dim oDataTable As SAPbouiCOM.DataTable
            oDataTable = pVal.SelectedObjects
            Dim val As String
            Try
                val = oDataTable.GetValue(0, 0)
            Catch ex As Exception
            End Try
            omatrix.GetLineData(pVal.Row)
            oform.DataSources.DBDataSources.Item("@CYW_PRROW").Offset = pVal.Row - 1
            If pVal.ColUID = "col_0" Then
                Try
                    oform.DataSources.DBDataSources.Item("@CYW_PRROW").SetValue("U_PRItemCode", pVal.Row - 1, CStr(val))
                Catch ex As Exception
                    SBO_Application.MessageBox(ex.Message)
                End Try
            Else
                Try
                    oform.DataSources.DBDataSources.Item("@CYW_PRROW").SetValue("U_PRSupp", pVal.Row - 1, CStr(val))
                Catch ex As Exception
                    SBO_Application.MessageBox(ex.Message)
                End Try
            End If
            omatrix.SetLineData(pVal.Row)
            If pVal.FormMode = "1" Then
                oform.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE
            End If
        End Sub
    Another quesion, can I assign the returned value of CLF directly to the cell?

    Hello  Chao-Yi Wu,
    I don't have a real solution for you - just a few comments:
    1. At
            Try
                val = oDataTable.GetValue(0, 0)
            Catch ex As Exception
            End Try
    I would add
            Try
                if oDataTable Is Nothing Then Exit Sub ' If the User cancels the CFL
                val = oDataTable.GetValue(0, 0)
            Catch ex As Exception
            End Try
    2. At
       If pVal.ColUID = "col_0" Then
    I would make the branch by the pVal.ChooseFromListUID instead of the ColUID
    and the 2nd not with "Else" but with "Else If ....."
    3. It may work with EditText.String/Value of a cell but I never do that because of performance-reasons.
    I always do it the same way as you in principle - I don't really know what the problem is.
    4. Maybe some unique indexes on your table (although this should give an error at the update and not at CFL when "the unique-law is broken"...)?
    Sorry - that's all for the moment.
    Cheers,
    Roland

  • How to display the return message in popup window

    Hi Experts,
    In WDA i want to display the return message through popup window.
    Regards,
    M.Chella Meenal.

    hi Chella Meenal ,
    you can generate the popup using popup factory class also , look at the below sample code for displaying message in a popup , and you can do your own configurating like visible , enable the buttons you want ..
    data:
        lr_component type ref to if_wd_component,
        ls_conf type wdr_popup_to_confirm,
        lt_texts     type string_table.
      ls_conf-window_position = '1'.
      ls_conf-button_1-text = 'OK'.
      ls_conf-button_1-icon = 'ICON_OKAY'.
      ls_conf-button_1-enabled = 'X'.
      ls_conf-button_1-visible = CL_WD_UIELEMENT=>E_VISIBLE-VISIBLE.
      ls_conf-button_2-visible = CL_WD_UIELEMENT=>E_VISIBLE-NONE.
      ls_conf-button_cancel-visible = CL_WD_UIELEMENT=>E_VISIBLE-NONE.
      lr_component = wd_comp_controller->wd_get_api( ).
      append 'some text' to lt_texts.
      cl_wd_popup_factory=>popup_to_confirm(
          component        = lr_component
          text             = lt_texts
          CONFIGURATION    = ls_conf
          window_title     = 'some title' ).
    Regards
    Chinnaiya P

  • How to get the return value of a method

    hi there
    here is the code i write a method
    public void time(int x,int y){
    int xx;
    int yy;
    xx++;
    yy++;
    x=xx;
    y=yy;
    i want to use the return value of x and y at another place,who can tell if it is possible. thank u very much

    You declare the return type of the method, and then use the return keyword to return a value which you can assign to a variable.
    As the other respondent said, you cannot return more than one value from a function. If you need to return two related values, you may want to enclose them in a class and return an instance of that class. For instance:
    class TimeValue {
       final int x;
       final int y;
    public TimeValue(int x, int y) {
       this.x = x;
       this.y = y;
    }Then your method could create a new TimeValues and return it:
    public TimeValue time(int x,int y){
       int xx = x;
       int yy = y;
       ++xx;
       ++yy;
       return new TimeValue(xx, yy);
    }

  • How to catch the return value of ldap- bind?

    For net::ldap,
    my $ldap = Net::LDAP->new( .. );
    $ldap->bind($DN,$password);
    if the bind failed, what's the returned value for this?
    Many examples I read suggested "undef" is returned, but looks like it's not the case on Sun Solaris.
    Marg8

    somehow "undef" is not returned.
    for ldap->bind($DN,$password) or die "can't bind";
    it always continue no matter what DN or password you put in.
    So looks to me it returned something else.
    Marg8

  • How to display the dispaly-value of a static LOV in a report?

    Hi,
    I want to display the Display-Value of a lov in a report
    How can i procede?
    thanks

    ok,
    My problem is the following:
    Say that I have created a static lov 'lov_colors' with the following values:
    display-value return value
    red 1
    blue 2
    green 3
    And i have a table 'object' wich has the following fields :
    object_name varchar2(100);
    object_color number;
    I want to make a report on the table object but in stead of displaying the number of the color,
    I want to display the name of the color that is in Lov_colors
    I hope that my question is clear.
    thank you

  • How to display the current value selected in DDLB of another screen

    hi Experts
    I need some info regarding the dropdownlist in BSP.
    I have two screens . One screen contains the table view which contains a set of records.Each record has two columns.
    Second screen contains 2 drop down list.
    When i select one record and then press the submit button in the first screen .Then i want that the selected value of the selected record will display in the DDLB of the second screen. And then i can again select the value from the drop down list.
    For example:
    1st screen:
    record 1.
    col 1     col 2
    record 2
    col 1     col 2
    2nd screen
    ddlb1...........
    ddlb2...........
    So when i select the record1, then the current value of col1 and col2 should visible on the ddlbs of second screen first time. Then i choose other value from the ddlbs.....
    My Question is how to do the following
    "when i select the record1, then the current value of col1 and col2 should visible on the ddlbs of second screen".
    please provide some suggestions...
    Thanks.

    Hi,
    You can use form with post method
    like
    <htmlb:form method = "post"
                      action = "page2.htm"
                      target = "coding" >
    <htmlb:dropdownListBox id             = "labelAlignment"
                                               selection      = "<%= me->labelAlignment %>"
                                               onClientSelect = "document.forms[0].submit();" >
                          <htmlb:listBoxItem key   = "LEFT"
                                             value = "LEFT" />
                          <htmlb:listBoxItem key   = "RIGHT"
                                             value = "RIGHT" />
                        </htmlb:dropdownListBox>
    So once you select col1 and col2 in your case its value is in page attribute say hold, this attributes needs to be defined in page2.htm also with auto checked. You can get the val selected in page1.htm
    If helpful rewards point.
    Regards,
    Albert

  • LOV Displays the Return Value when Read Only

    Greetings,
    I searched for a question/answer for this, but didn't find this exact scenario mentioned, but I may have missed it. If you know of this already been asked/answered just point me to the thread.
    On APEX version - 4.1.1.00.23
    I have a LOV that is populated by a dynamic action from another LOV. That works great. Depending on the value of another page item the 2nd LOV is Editable or Read Only. The problem is that when the 2nd LOV is Read Only the result value (an ID) displays instead of the display value.
    1 - Why is this?
    2 - How do I prevent this from happening?
    Also, I don't want 2 separate page items (one for edit, one for display) for the 2nd LOV, because the 2nd LOV also has a dynamic action on it to populate a 3rd LOV. The population of the 3rd LOV works great, whether the 2nd LOV is editable or read only.
    = = = = = = = 2nd LOV SQL = = = = = = =
    select sub_com_desc||' - '||commodity_desc d, defect_code_header_id r
    from qcis_defect_code_header
    where inactive_date IS NULL and plant_id = :P10_PLANT_ID
    order by sub_com_desc
    = = = = = = = = = = = = = = = = = = = =
    Thanks, Tony
    Edited by: cloaked on May 8, 2013 12:11 PM

    I've decided to try a different approach. Since the Select List LOV was Read Only and not populating correctly it was causing a session state error when inserting the row. So, I've made the Select List LOV editable, but it shouldn't be. I now need to disable the page item using JavaScript to prevent it from being changed. I need to do so only when a page item contains a certain value.
    Will someone share an example of JavaScript snippet of code I need to use? (I'm not much of a JavaScript coder.)
    The page item I need to disable is named - P10_DEFECT_HEADER_ID
    I need to disable it when P10_MAP_TYPE = 'P'
    Thanks, Tony
    Edited by: cloaked on May 15, 2013 1:00 PM

Maybe you are looking for

  • Partner Bank type (PBT) need to be updated in Old Vendor open line items.

    Hi all, We have implemented PBT functionality in our client. We have some challenges at the time of payment run (F110). Some of the line items where PBT not updated i.e. old open items ( Before implement PBT) not picking for payment. Hence, it is cau

  • OIM 11g R1 - Modifying a Resource Erases Custom Process Task ???

    I've created a Generic Resource in OIM that uses the Database Applications Table connector 9.1.0.5.0. Then I add my own process tasks through Design Console under "Process Management -> Process Definitions". On each custom process task I've attached

  • Xperia Z1 Compact D5503 14.3.A.0.757 upgrade experience

    hi all, I just want to share my experience with the latest build version 14.3.A.0.757 which has become available in Austria on Friday, 18th of April 2014. Friday afternoon an OTU I installed the update to Android 4.4.2 which automatically was suggest

  • Flash not playing in browser

    I've only been using Flash for about a year but this is the first time I've run into this problem. I have a simple Flash file (swf) that plays fine in Dreamweaver and/or Contribute. But, when I publish it to the web, it does not appear. I've attached

  • ODAC 11.2.0.3.0 with Visual Studio 2008 SP1

    Hi, Yesterday I installed the latest version on ODAC 11.2.0.3.0 on my machine. Now when I am trying to add a new ADO.NET Entity Data Model to my project, it doesn't show me my Oracle Database there when I select "Generate from Database". Also when I