Calling value from function

is there a way to call or print the value returned by a function/dbExecute?
<database:dbSetParam name="n" value='<%=request.getParameter("n")%>' scope="page" />
<database:dbSetParam name="final" value="dann" scope="page" />
<database:dbExecute connId="conn" scope="page" output="yes" bindParams="final n">
begin ? := trunc(crbcis.p_session.open_session_from_nonce(?)/100000); end;
</database:dbExecute>

No, this does not appear to be possible. Probably becuase the setParams is expecting an
in parameter, but the function return is an out. The only alternative I have is for your function to insert the result into a table, then use the dbQuery tag to retrive the result. Please let us know if you think this is worth creating an enhancement request to support this.

Similar Messages

  • IR report value from function error

    i have ir report and one column value coming from function,when open the IR report its giving error..
    IR report code
    SELECT CS_ID ,CS_NAME, Util_func(PASS_ID) as "ALERT_DAYS"   from "CSD_MASTERS" Function code
    FUNCTION  Util_func(PASS_ID NUMBER) RETURN number
      IS
    ALERT_DAYS NUMBER:=0;
      BEGIN
       select TO_DATE(CDS_DATE,'DD-MM-YYYY') - TO_DATE(SYSDATE,'DD-MM-YYYY')  
      INTO ALERT_DAYS
       from   CDS_TABBLE
    where   CDS_ID=PASS_ID AND 
    CDS_DATE   between
       sysdate and sysdate+15
       group by  CDS_DATE  HAVING COUNT(*)  <=1  ; 
         IF RECCOUNT>0 THEN
            RETURN ALERT_DAYS;
         ELSE
           RETURN 'null';
         END IF;
      END;function calling CDS_TABBLE value
    CDS_ID -- CDS_DATE
    123 -- -- 4/23/2013
    124 -- -- 4/24/2013
    125 -- -- 4/25/2013
    Thanx,
    Ram
    Edited by: Ramani_vadakadu on Apr 11, 2013 8:56 PM

    FUNCTION  Util_func(PASS_ID NUMBER) RETURN number
    IS
        ALERT_DAYS NUMBER:=0;
        CURSOR lcsr_GetAlertDayCount IS
             select TO_DATE(CDS_DATE,'DD-MM-YYYY') - TO_DATE(SYSDATE,'DD-MM-YYYY')   
            from   CDS_TABBLE
            where   CDS_ID=PASS_ID AND 
                    CDS_DATE   between sysdate and sysdate+15
            group by  CDS_DATE  HAVING COUNT(*)  <=1;         
    BEGIN
        OPEN lcsr_GetAlertDayCount;
        FETCH lcsr_GetAlertDayCount INTO ALERT_DAYS;
        CLOSE lcsr_GetAlertDayCount;
        RETURN ALERT_DAYS;
    END;

  • Error getting return value from function

    Hello
    I'm getting a error calling a function with ODP.NET from C#
    Code:
    OracleCommand oraCom = new OracleCommand("NORMALIZACION.nif",oraCon);
    oraCom.CommandType = CommandType.StoredProcedure;
    OracleParameter param1 = new OracleParameter("numnif",OracleDbType.Varchar2);
    param1.Value= "73667866A";
    param1.Direction = ParameterDirection.Input;
    OracleParameter param2 = new OracleParameter("nif",OracleDbType.Varchar2);
    param2.Size = 10; //FIXME line
    param2.Direction = ParameterDirection.ReturnValue;
    oraCom.Parameters.Add(param1);
    oraCom.Parameters.Add(param2);
    oraCom.ExecuteNonQuery();
    nif_norm = oraCom.Parameters["nif"].Value.ToString();
    if i write the FIXME line i get a error (ORA-06502) complaining about the size, no matter the value i wrote.
    If i don't write the FIXME line, it works but nif_norm is always empty, although the function i call is a single return 'Hello';
    Where am I wrong??
    Any help, examples with varchar2 as return value???
    BTW: the same code with the MS provider for Oracle works fine.

    Good point -- i shall do so.
    What I think I'm missing, in my quest for ODP.NET competence, is a solid set of example code. I've searched around and found various fragements here and there, but when it comes to data access from .NET there must surely be some finitie set of possibilities (if we can discount bad practices like building dynamic SQL statements without bind variables).
    For example, possibly in increasing order of complexity ...
    * Read a single value from a SQL statement ... "select emp_name from emp where rownum < 2"
    * Read a single value by passing in a parameter ... "select emp_name from emp where user_id = :?"
    * read multiple values ... "select emp_name from emp where user_id in (:?,:?)"
    * execute a stored procedure with no in or out parameters
    * retreive a value from a function with no parameters
    * pass a parameter to a stored procedure
    * read an out parameter from a stored procedure
    Then work with in and out ref cursors, blobs, whatever.
    Thoughts?

  • How to get the returned value from Functions with Callable statement?

    I was glad to find that stored procedures can be invoke with Java class code by the object of Callable statement like :
    String stmt = "BEGIN departments_pkg.do_select(?,?,?); END;";
    and getting the output variables by
    populateAttribute(DEPARTMENTNAME,st.getString(2),true,false);
    But i would like to get values returned from FUNCTION other than stored procedure, how can i achieve it? Thanks a lot!

    Here is  my code
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_1202.
      MODULE subscreen_find.
      CALL SUBSCREEN SUBSEARCH INCLUDING sy-cprog dynnr.
    PROCESS AFTER INPUT.
      MODULE USER_COMMAND_1202.
      CALL SUBSCREEN SUBSEARCH.
    MODULE subscreen_find.
      case sy-ucomm.
        when 'SELECTED'.             "fcode
          case 'ZSKILL_SEARCH'.     "data element
            when '01'.                       " value range
              dynnr = 0110.
            when '02'.
              dynnr = 0111.
          endcase.
      endcase.
    ENDMODULE.
    kindly tell me what is wrong
    Edited by: Raji Thomas on Feb 8, 2010 10:20 AM

  • Adding Additional Columns in LOV,That column capturing values from function

    My requirement:
    Adding Additional Columns in LOV,That column values capturing values returned by function.....
    Give me the ides to achieve this...

    Hi Subramaniam,
    If your requirement is to call a Database function then please make use of the below code ,
    import java.sql.CallableStatement;
    import java.sql.SQLException;
    import oracle.apps.fnd.framework.server.OADBTransactionImpl;
    OAApplicationModule oaapplicationmodule = oapagecontext.getApplicationModule(oawebbean);
    OADBTransactionImpl txn = (OADBTransactionImpl)oaapplicationmodule.getOADBTransaction();
    CallableStatement cs = txn.createCallableStatement ("begin :1 := xxpackageName.xxfunctionname(:2,:3); end;",-1);//Replace your function Name
    try
    cs.registerOutParameter(1, Types.VARCHAR);
    cs.setString(2,InputParam1); // InputParam1 is the name of variable captured from the OAF page and passed into function as input parameter
    cs.setString(3,InputParam2); //InputParam2 is the name of variable captured from the OAF page and passed into function as input parameter
    String outParamValue = null; // outParamValue will capture the value returned by function .
    cs.execute();
    outParamValue = cs.getString(1);
    catch(SQLException sqle)
    throw new RuntimeException(sqle);
    finally
    cs.close();
    Let me know if its not clear .
    Keerthi
    Edited by: keerthioaf on Nov 23, 2012 5:17 AM

  • Call BEx from function modules.

    Hi,
    I'm trying to run BEx (Excel) from an abap Exit. Using the debugger I have observed that it is necessary to call the rsah_launch_excel function module passing some parameter (i.e. workbook id) but don't know if it is necessary to copy and modify the called program ( RRMX_START_EXCEL).
    Any suggestion about the coding will be well appreciated.
    Thanks in advance.
       Giovanni

    Use SUBMIT Program statement ... i.e,
    http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/submit.htm

  • Call layout from function

    Hi ,
    i have a function that call to a layout.
    my problem is that when i ran the function, the layout not get the parameters that i pass to her.
    how can i pass a parameters from function?
    thanks,
    dana.

    Hi Sanjiv!
    of course... but I don't remember now exactly the final code, but the problem was in the code lines:
    i_program_name = sy-cprog
    i_inclname = sy-cprog
    I had to 'play' with this parameters to get the correct results because I had my report like an include... and then the parameters were different (I hope to explain it well!)

  • Return value from function within package

    Hi,
    There is a function within a pl/sql package that I am trying to get data from. The problem is that the data returned can be up to 32,767 chars (varchar2 limit).
    It accepts 3 input parameters and returns on varchar2.
    The only way I can get it to work is using this syntax:
    ==================================
    variable hold varchar2(4000);
    call TrigCodeGenerator.GenerateCode(VALUE1', 'VALUE2','VALUE3') into :hold;
    print hold;
    =====================================
    However, if the data returned is greater than 4000 then I get this error:
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at line 1
    I can't increase the size of the variable (hold) as there seems to be a limitation on this type of variable.
    Also, I am running this in sql plus worksheet. Will it limit the display of the data (assuming, that someone can get the whole 32,767 chars displayed back) ?
    Thanks in advance,
    Ned

    Never mind,
    I declared the variable hold as clob and set the long and longchunksize parameters to 100,000 and it seems to work.

  • Getting value from Function stored in a schema and Watching the value of objects

    hi
    i'd like to display a labelA which is from a query -> (SELECT NAME FROM TABLE1 WHERE NAME = GetA). GetA is a function which I created in SchemaA. GetA returns a varchar2. In this case.. how can i do that ?
    should i write the PL/SQL in the format trigger of this labelA ? if yes, then what should i write in the PL/SQL format trigger ? or should i create another query in Data Model ?
    And how do get hold of this labelA's value(or the result returned by the query) in the parameter form?
    And lastly is there a way to trace the value of some report objects ?
    should i use SRW.MESSAGE ? to print out the 'watched' value ? or any other alternatives ?
    what is the url that takes me to learn all these ?
    I got this error "REP-1401: 'beforepform': Fatal PL/SQL error occurred." when i initialize the bind variable to a function (GetA)stored in Schema A ---> :P_A := GetA in the before_parameter_form of report trigger;
    anything wrong with the above assignment ?
    are there any difference between stored procedure like function, package in the database and those in in PL/SQL Library of report builder ???
    null

    hi
    i'd like to display a labelA which is from a query -> (SELECT NAME FROM TABLE1 WHERE NAME = GetA). GetA is a function which I created in SchemaA. GetA returns a varchar2. In this case.. how can i do that ?
    should i write the PL/SQL in the format trigger of this labelA ? if yes, then what should i write in the PL/SQL format trigger ? or should i create another query in Data Model ?
    And how do get hold of this labelA's value(or the result returned by the query) in the parameter form?
    And lastly is there a way to trace the value of some report objects ?
    should i use SRW.MESSAGE ? to print out the 'watched' value ? or any other alternatives ?
    what is the url that takes me to learn all these ?
    I got this error "REP-1401: 'beforepform': Fatal PL/SQL error occurred." when i initialize the bind variable to a function (GetA)stored in Schema A ---> :P_A := GetA in the before_parameter_form of report trigger;
    anything wrong with the above assignment ?
    are there any difference between stored procedure like function, package in the database and those in in PL/SQL Library of report builder ???
    null

  • Passing values from function to unbound field on report

    i've created a function to calculate certain values. i would like those values to be assigned to fields i've put on the report (these fields have no source) at runtime. how is this done. i've tried the ':' used for binding variables (parameters)...but in this case, it's not a 'parameter' in that sense.

    How about using placeholders? Take a look at the online help for placeholders as it sounds like it should fit your needs. You can have a formula column that calls the function and sets the values of the placeholders. However, please note that if the function sets the placeholders directly, the placeholders will have a indirect dependency on the formula column and this could cause problems at run time. You will need to use srw.reference to establish a direct dependency in that case. srw.reference is also in the online help. If you run into problems, Support should be able to assist you with this.
    Hope that helps, Toby

  • Call program from function

    Hallow I build a function in se37 ,and in the function I wont to delete file from server now I have  a program
    in se 80 that can do that (YHR_DELETE_FILE_FROM_SERVER)the program have just one parameters  (the path of the file I wont to delete )
    How I can call to this program in my function.
    regards
    did some one now  about function that can delete file from server?

    Hi antonio,
    1.in se 80 that can do that (YHR_DELETE_FILE_FROM_SERVER)t
    2. use like this in your FM
    <b>SUBMIT YHR_DELETE_FILE_FROM_SERVER
    WITH
    parameter1 = myfilename.</b>
    regards,
    amit m.

  • Call value from jsp

    Hi all
    I have 3 jsp's. The first one look a little like this:
    first.jsp:
    <%String productDesc ="";
    session.setAttribute("productDesc",productDesc);
    String productlist="";
    session.setAttribute("productlist",productlist);
    %>
    <!--Here I call another jsp, and get values for productlist-->
    <table width=50% height=50 border=0>
    <form name="matchForm" action="second.jsp" method="post">
    <input type="hidden" name="action" value="MATCH">
    <tr>
    <td width=150>Product Description</td>
    </tr>
    <tr>
    <td class="formlabel"><input type="text" name="productDesc" maxlength="100" size="50" value="<%=productDesc%>"/>�</td>
    </tr>
    <tr>
    <td><input type="submit" class="formbutton" value="Find Product" />�</td>
    <tr>
    <td width=150>Product List:</td>
    </tr>
    <tr>
    <td>
    <input type="hidden" name="productlist" value="<%=request.getParameter("productlist")%>"><%=request.getParameter("productlist")%></td>
    </tr>
    </form>
    </table>
    <table cellspacing="0" cellpadding="0" height=50 border="0" width="70%">
    <form name="confirm" action="third.jsp" method="post">
    <input type="hidden" name="action" value="CONFIRM">
    <tr>
    <td class="formlabel"><input type="submit" value="Submit" name="Submit"/></td>
    </tr>
    </form>
    </table>
    second.jsp:
    <%
    String productlist = (String)session.getAttribute("productlist");
    String prod = (String)request.getParameter("productlist");
    %>
    <%String temp =somevalue+prod;%>
    <td width=250><a href="AssignProducts.jsp?productlist=<%=temp%>">whatever<a></td>
    My problem is, how do I call productlist in my third jsp?
    </a>

    I assume they click on the href, then you would use request.getParameter("productlist");
    Request.getParameter always returns strings, no need change the type like you are doing in the second JSP.
    HTH,
    J.Clancey

  • How to call PL/SQL function inside column in entity

    Hello,
    How can I do next:
    - Crete entity from existing table in database, but one column in the table gets value from function. Function is written in oracle PL/SQL language and it is located inside some package on database.
    Application should run LCDS3 and tomcat.
    All help is appricitated

    Anil,
    I'm using LCDS3, and here is what I trying to do (for example):
    - I have on Oracle DB table REGION, with columns: Code, State, Population.
    - I want to create entity that contains same columns as table REGION (Code, State, Population) and to have addition column RegionName witch get value from PL/SQL function (loacated in package "common" on DB) "common.fgetRegionName(Code)".
    Can you explain me how to create that entity.
    Thanks
    Almir

  • Getting values from a function module called in a WDA method

    Friends,
    I am trying to execute a function module from WDA.
    I have created a service call for the function module. The function module takes values from the user, looks up the corresponding values of another field and returns the values in an internal table.
    I am using the "Method Call in Used Controller" of WD Code wizard to call the function module.
    When the event handler method containing the call to the function module is executed, nothing happens.
    I am not sure how to pass values to the function module and to get the return values from the function module.
    I am new to using function modules from WDA. Please help me out.
    Thanks and Regards.

    Rashmi,
    Is the function module intended to collect input data from the UI and process it? - Yes
    If yes, then the input (importing parameter) to the Function Module is a table of values (which should be ideally from the context mapped to the Table UI Element). - The importing parameter is a single value NOT a table and is mapped to the view context.
    Now this table UI Element is bound to the view controller context , which in turn is mapped to the component controller context. And you are indeed being able to read the value of this internal table in the component controller method where the function module is being called by means of get_static_attributes_table (Is this right? - Yes, I am able to read the table of values that is passed from the component controller view to form view context by using get_static_attributes_table.
    Or are you being able to read it in the event handler method of the view controller and not being able to read it in the component controller method) -
    The function module takes a single value as import parameter and returns a table of values as return value.
    It works fine when no importing parameter is being used and returns the table of values that is getting passed from component controller context to form view context when i am able to read it using get_static_attributes_table.
    Now the question is: how to pass the import parameter value to the function module. I assumed since the importing parameter is a context node (like the return values are), i should set the value ( captured when the user enters the value in the form) to the importing parameter context attribute using set_attribute method. Since it is mapped to the component controller context, i assumed it will get passed and the method will take it as input parameter.
    Let me know if my assumptions are correct regarding passing the import parameters and what is missing here.
    Thanks and Regards.

  • Getting Return values from RFC function call with visual basic

    Hi,
    I am creating a sample app to connect to a SAP system which call its RFC functions created with ABAP. It was known that the function will return more than 1 return values.
       SAP Function name ==> "ZFMTP_RFC_GET_RESULT"
            Export parameters (to SAP):
                    - Student Name [char 10]         ==> "STUNAME"
                    - Student ID         [char 20]        ==> "STUID"
           Return values (From SAP):
                    - Results [char 10]        ==> "RESULT"
                    - Remarks [char 200]        ==> "REMARKS"
    i have managed to get sample codes for connecting and call a RFC function with vb but they only get a return value. How do i retrieve multiple return values like the above function "RESULT" and "REMARKS"?
    Here's my vb code to accessing the function
            Dim R3 As Object
            Dim FBFunc As Object
            Dim returnFunc As Boolean
            Dim connected As Boolean
            R3 = CreateObject("SAP.Functions")
            R3.Connection.Client = "000"
            R3.Connection.User = "BCUSER"
            R3.Connection.Password = "minisap"
            R3.Connection.Language = "DE"
            R3.Connection.System = "dtsystem"
            R3.Connection.Applicationserver = "xxx.xxx.xxx.xxx" 
            connected = R3.Connection.Logon(0, True)
            If connected <> True Then
                MsgBox("Unable to connect to SAP")
            End If
            FBFunc = R3.add("ZFMTP_RFC_GET_RESULT")
            FBFunc.exports("STUNAME") = "Jonny"
            FBFunc.exports("STUID") = "12345"
            returnFunc = FBFunc.Call() <<== How do i get the return value? or RESULT and REMARKS of the RFC Function?
    thanks alot.
    Edited by: Eugene Tan on Mar 4, 2008 7:17 AM

    Hi Gregor,
    Thanks for the link....i am having some doubts with the codes, hope you can clarify them for me if you know the codes..
    Below is the code snippet.
    Set impReturn = CHPASS_FN.Imports("RETURN")  <<=== is RETURN the standard keyword to get a                                                                                return object?
      expPassword.Value = currpass
      expNewPass.Value = newpass
      expFillRet.Value = "1"
    ''' Call change password function
      If CHPASS_FN.Call = True Then
        outFile.Write (", Called Function")
        Message = impReturn("MESSAGE") <<==== So if i have 3 return values..i just replace with the return                                                               value variable names?
        outFile.WriteLine " : " & Message
      Else
        outFile.Write (", Call to function failed")
      End If
    thanks alot...all your help is very appreciated.

Maybe you are looking for

  • Upgraded to iPhoto 9 and now it is crashing every few minutes

    I installed iLife and upgraded to iPhoto 9, now my iPhoto keeps crashing. Does anyone have any idea how to fix this?! (Also, I can't see any of the thumbnails for my photos, they are just empty boxes--yet if you right click and choose Show File it br

  • Ipod nano wont turn on!!! Please help I'am desperate! :(

    By mistake, i dropped my ipod on the floor and seconds later i tried turning it on and it wont turn on at all. I tried restoring it by pressing the menu and select button and i toggeled with the hold button for several minutes. I got this ipod a year

  • Referencing External Data in an InfoPath Form

    Hi all, I am using SharePoint 2013, Designer 2013 and InfoPath 2013. I am working on a a system that allows us to book a field support analyst for a particular site at my company on a given day. I have built a custom list that holds all the data and

  • Dual boot Arch and Windows XP (arch installed first) [solved]

    I recently moved over to arch from Ubuntu, and would like to install Windows XP so that I can dual-boot between the two. However, my arch install created four partitions on my disk, and I can not create another one. I would rather not have to reinsta

  • JHeadstart Designer Generator not in JHeadstart 10.1.3

    What is the reason that JHeadstart 10.1.3 does not include the JHeadstart Designer Generator (JDG)? Why is JDG in 10.1.3 under consideration? Are there any better alternatives to migrate Designer applications to JEE applications? Regards, Rik