Call a function with variable function name

Hey guys,
I have a func_table which maintains function names (each one makes reference to a dynamically generated stored function)
I need to make a procedure that calls the functions in that table one by one using its name retrieved from SELECT func_name FROM func_table;
Thanks

929955 wrote:
I have a func_table which maintains function names (each one makes reference to a dynamically generated stored function)
I need to make a procedure that calls the functions in that table one by one using its name retrieved from SELECT func_name FROM func_table;Okay, first the bit where I, foaming at mouth and vigorously waving a well used lead pipe around, tell you that this is HIGHLY SUSPECT and likely a FLAWED DESIGN. That dynamic code is 99% of the time wrong. That dynamic code opens securities hole for code injection. That dynamic code often results in severe performance penalties as the coder is clueless about what the Oracle Shared Pool is about. And so on...
As for a basic procedure template to do this - assuming all functions get the same parameter as input and that all functions returns the same data type:
create or replace procedure FooBarFunctions( paramVal number ) is
  .. variables and types and cursor definitions..
begin
  for c in (
    select function_name from my_fubar_functions order by function_order
  ) loop
      plsqlBlock := 'begin :result := '||c.function_name||'( param => :p ); end;';
      execute immediate plsqlBlock using out funcResult, in paramVal;
      .. do something with funcResult ..
  end loop;
  .. more code..
end;
{code}
Looks not like a sensible approach though - and begs for justification as to why this approach is needed. What justification do you have?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • Combing rounding functions with other functions

    I am using hyperion reports. Is it possible to combine a rounding function with another function? Specifically, I am taking a variance of actual vs budget where actual and budget are % of total functions. The variance I am getting is off (see ex. below.) I need to keep the actual and budget at 1 decimal point. To correct this problem in excel I am able to round the numbers pulled in by essbase. The ex. below illustrates my problem. Actual .2% Budget .2% Variance .1%

    You may want to make a 'Scenario' for rounding that is rounding the input data. If you make it (variance) 2pass, it will show the difference of the rounded numbers (ie. 0%)Rich [email protected]

  • I am trying to use IMAQ acquire and other IMAQ functions with Queue functions.

    i am trying to use IMAQ acquire and other IMAQ functions with Queue functions.
    i mean i would like to acquire the image in a queue and deque it afterwards. would be the queue function accept the IMAQ data type?

    Refer posting, http://exchange.ni.com/servlet/Redirect?id=8879554

  • Calling an SWF with variables

    Is there a way to call an swf with variables, like we do
    dynamic web pages? Like this example:
    somedomain.com/some.swf?var1=whatever&var2=somethingelse
    I am trying to make a starting point for about 30 swfs and
    wanted a single logo starter for them all without having to include
    it in all the rest of the files. I wanted to call it, with 2
    variables, one just plain text to be displayed at the bottom right
    above a button, and the other was the filename of the next swf to
    load. I am doing this in a learning environment and the logo intro
    was to be used for all the lessons.
    Thanks.

    Hallo everyone,
    Since my initial posting, I have made good progress and have managed to split out my scripts so that one master-script calls the others passing various parameters. That's a great help.
    However, I have now come up against a problem which I am finding difficult to solve:
    In my main script I need to calculate the dates for each calling of the sub-scripts. I have experimented and have come up with several variations of date formatting. For example:
    TO_DATE('01.' || TO_CHAR(ADD_MONTHS(SYSDATE,-1), 'MM.YYYY'))
    I have tested the date formatting in a little test table to prove that the process runs correctly (i.e. valid dates are produced) and now I would like to move this syntax to my SQL*PLUS scripts to pass the dates as parameters to my other scripts.
    First I tried:
    PARAMETER xStartDate = TO_DATE('01.' || TO_CHAR(ADD_MONTHS(SYSDATE,-1), 'MM.YYYY'))
    &xStartDate
    ... but this didn't work as the processor interpreted the literal string.
    Next I tried:
    VARIABLE xStartDate1 DATE
    BEGIN
    :xStartDate1:=TO_DATE('01.' || TO_CHAR(ADD_MONTHS(SYSDATE,-1), 'MM.YYYY'))
    END
    :xStartDate
    ... but here too the literal value was passed.
    Can anyone help me with this? I need to set and change parameters/variables as my SQL*PLUS script is executed and then send these to other scripts.
    Or maybe I should first write the values (in this case Start- and End- Dates) to a table and then read the table and use the retrieved values to pass as arguments to the other scripts? Is this possible? Can it be done easily?
    Or maybe SQL*PLUS isn't designed for this (i.e. dynamic variables) and I should instead be using PL/SQL?
    I hope this isn't another false alarm (I don't believe it is) and am sure that you guys will be able to point me in the right direction.
    Many thanks,
    Alan Searle.
    Message was edited by:
    Alan____alse

  • How to use analytic function with aggregate function

    hello
    can we use analytic function and aggrgate function in same qurey? i tried to find any example on Net but not get any example how both of these function works together. Any link or example plz share with me
    Edited by: Oracle Studnet on Nov 15, 2009 10:29 PM

    select
    t1.region_name,
    t2.division_name,
    t3.month,
    t3.amount mthly_sales,
    max(t3.amount) over (partition by t1.region_name, t2.division_name)
    max_mthly_sales
    from
    region t1,
    division t2,
    sales t3
    where
    t1.region_id=t3.region_id
    and
    t2.division_id=t3.division_id
    and
    t3.year=2004
    Source:http://www.orafusion.com/art_anlytc.htm
    Here max (aggregate) and over partition by (analytic) function is in same query. So it means we can use aggregate and analytic function in same query and more than one analytic function in same query also.
    Hth
    Girish Sharma

  • CPI-C calling a report with long report name

    Hi there,
    we are communicating to a SAP System with CPI-C.
    My question:
    How can I call a report with CPI-C which has a name with more than 8 characters?
    (I am using SAP_CMLOGON2 of CPI-C SDK for C++)
    I want to use namespaces and 8 Characters are too short for this.
    Any Ideas?
    Thx,
    Andi

    Hi Scott,
    According to your description, you want to call the report which contains subreports in asp.net.
    Based on my research, when we call the report which contains subreports in asp.net, we should attach a handler to the SubReportProcessing event of the report. For more information, please refer to the similar thread: Running
    Reports SubReports and parameters from Asp.net. Besides, you could also refer to this
    article to render the main report and sub report in ReportViewer control.
    If you have any question, please feel free to ask.
    Best regards,
    Qiuyun Yu
    Qiuyun Yu
    TechNet Community Support

  • Creating a form with variable table name(s)

    Hi,
    I am building a form that will allow user(s) switch to other user
    (s) dynamically. I have been able able to do this by creating a
    non-database table and use record group to read from the base
    table of each user.(All the tables in question have the same
    structure).
    Record group is a read only, and I want to be able to do data
    maninpulation with this form.
    The questions are
    (1) It possible to do data manipulation with record group and if
    it is, how?
    (2) Is it possible to build a form with a variable table name?
    if possible, how?
    Somebody pls help.
    Thanks,
    Olutunde.
    null

    Olutunde Babarinsa (guest) wrote:
    : Hi,
    : I am building a form that will allow user(s) switch to other
    user
    : (s) dynamically. I have been able able to do this by creating a
    : non-database table and use record group to read from the base
    : table of each user.(All the tables in question have the same
    : structure).
    : Record group is a read only, and I want to be able to do data
    : maninpulation with this form.
    : The questions are
    : (1) It possible to do data manipulation with record group and
    if
    : it is, how?
    : (2) Is it possible to build a form with a variable table name?
    : if possible, how?
    : Somebody pls help.
    : Thanks,
    : Olutunde.
    Hi,
    you can create and manipulate record groups at runtime(see Forms
    Reference 'Create_Group' and 'Add_Group_Row') don't use
    Create_Group_from_Query. For your purpose it's better to build a
    cursor loop on your Query and add your datas after
    manipulating with 'Add_Group_Row' to your Record Group.
    It's possible to SET_BLOCK_PROPERTY(QUERY_DATA_SOURCE_NAME) but
    it's not possible to change the item property 'Column Name'.
    Therefor I would suggest to build a non database block and
    populate these block by a programm unit, which works with a
    pl/sql cursor loop and the 'create record' to populate these
    block.
    null

  • Is it possible to call a function with the same name from 2 different dll's at the same time.

    I'm trying to call a function ( F ) form 2 different libraries ( A.dll and B.dll ) at the same time. The first lib loaded determines the function F. A->F and B->F have same interface and name but different implementation.

    Hi,
    I tried it with two dll's, both with the same interface, and at the same
    time, in the same VI. The popups even appear at the same time.
    But now I understand the problem... Both dll's are created by LabVIEW! If
    they are not (or one is not, and the other is), this is no problem.
    And VI's in memory cannot have the same name. LabVIEW doesn't care if VI's
    are in a dll or not.
    This might not help, but if you want to make some sort of "plug in" system,
    you might consider using llb's. By loading VI's dynamically, you can select
    the path from which they are loaded. You must unload (close all references)
    one before the loading the other, or the same problem will occur. If you go
    this way, I consider a different approach. Make on
    e library (or even a dll)
    that has the interface you like, this is the "loader". Now make several
    "plug in"'s, with the same interfaces. The name of each function in a plug
    in is a concatenation of the library name and the function name. The loader
    has one extra function, that loads (and unloads, when done) references to
    all desired libraries to use (the names of the functions can be figured out
    easily). All that the loader functions do is dynamically call the library
    functions. You can use a call by reference node for this (you can use the
    connector pane or the loader vi, since the interface must be the same!).
    If you go this way, I guess the loader library can be converted to a dll...
    Hope this helps.
    Wiebe.
    "rsam" wrote in message
    news:[email protected]..
    > Thx Wiebe,
    >
    > did you load both dll at the same time? For example in 1 vi. Somehow
    > the first loaded function keeps to overrule the second. Notice that
    > the interface is
    exactly the same.
    >
    > I loaded 2 dll created in Labview with results described above.
    >
    > Regards Ruud

  • Extended Rebate Functionality with Variable Keys

    Hello All,
    I am trying to find information on extended rebate functionality in 4.7. I have looked though white pages G72, G63, and G64 but have yet to find what I am looking for.
    Basically I want to be able to spread a rebate settlement (credit memos) to multiple partners in a customer hierarchy evenly based on their individual sales volume (instead of one Rebate recipient per agreement I want many based on customer hierarchy node).
    I also would like to spread the settlement against multiple materials.
    I have heard this is may be possible using the variable keys and structure S469 but for the life of me I cannot figure out if it is possible to do what I am asking.
    I really appreciate any help that can be extended to me.
    Thanks,
    Lance

    Hi Lance,
    thr price-conditions ( values or rabates ) are stored in Tables like S+++ ( S469).
    You want to have an access to a pricing table with other keys as you found in the standard system.
    Therefor : make you own S9++.
    there are the following steps:
    Check, if your key is in the selected keys for pricing - if not, add it there.
    The field must be in an apend of structure KOMG ( generally ) and KOMP ( for position fields ) or KOMK ( for header fields ).
    Create your own S9++ -- ( in Pricing, i have about 150 own pricing tables ).
    Next : go to the Customizing of the ?? German = Zugriffsfolge ?? for the condition.
    Here you can add up to 99 Zugriffe to get the condition. Here you need your new S9++ and you have to connect it with the fields.
    ( i have had problems with the 'little' number of 99. for one Condition i need up to 160 Zugriffe - i have split it up into 2 Conditions ).
    In one S9++ you can connect several fields to one Condition table.
    The customer - numer and the hierarchi - number and the recipienst-number - all fields are of the sae kind.
    In the Zugriffsfolgen, you can do  several Zugriffe for the same Table S9++ - but in the connection of the fields, you can variate the souce fields -- first Zugriff : Customer - number / secons Zugriff : Hierarchy 1 / ....
    With this method, you can also add customer fields of VBAP or VBAK into your pricing module.
    I hope, youve got an idea, where t go. see also in the SAP documentation - in german, i have picked many things out of the documentation.
    Hans

  • @RETURN function with variables

    Hello all:
    I've been doing some testing with the @ERROR function and have had no luck getting it to error out when using it within an IF statement that uses a variable (of any kind). All of the following examples validate and run, but none stop the script.
    Assume VAR QUIT = 1, SubVar QUIT2 is set to 1 and there is an environment variable named QUIT3 is set to 1;
    These all don't stop the script (or put the expected ERROR in the app log):
    "Actual"(
         IF(QUIT==1)
              @RETURN("Error!), ERROR
         ENDIF)
    "Actual"(
         IF(&QUIT2==1)
              @RETURN("Error!), ERROR
         ENDIF)
    "Actual"(
         IF($QUIT3==1)
              @RETURN("Error!), ERROR
         ENDIF)
    It seems like IF can't evaluate a numeric value in a variable.
    Your thoughts?

      Use technical account (or slice ) for storing variables values.
    For native using variables u need to do technical settings
       1)  turn off CPU Hyper Threading
       2)  turn calculation to  serial mode
    And all of this don't guarantee what calc will be correct.
    p..s
    ("Error!), or  ('Error!')

  • Can we write function with variable number of argument

    Hi
    Can anybody tell that can we pass variable number of arguments to a function in oracle 10gR2.
    As in function decode we can pass variable no. of arguments upto 255 arguments, similarly can we creat a function which accept any no. of variables.

    I'm not sure that this is what you were asking about, but depending on the logic you want to implement, you can declare the maximum possible number of parameters to your function, give them default values, and then pass to your func as many parameters as you want:
    SQL> create or replace function test(p_a number:=null, p_b number:=null) return varchar2 is
      2    Result varchar2(100);
      3  begin
      4    result:='a='||p_a||', b='||p_b;
      5    return(Result);
      6  end test;
      7  /
    Function created
    SQL> select test() from dual;
    TEST()
    a=, b=
    SQL> select test(1) from dual;
    TEST(1)
    a=1, b=
    SQL> select test(1,2) from dual;
    TEST(1,2)
    a=1, b=2
    SQL> drop function test;
    Function dropped
    SQL>

  • Dynamic creation of table with variable field-names

    HI
    I am looking for a way in order to create a table during runtime. The problem is that the field names of the table are provided in another table.
    TO illustrate the case at hand, an example:
    The initial table contains the fields
    UserID - attribut_name - attribute_value
    Example Data
    d00587 - first_name    - Jon
    d00587 - last_name     - Smith
    d00587 - age           - 48
    d00127 - first_name    - Jack
    d00127 - last_name     - Daniels
    d00127 - position      - Manager
    Now I need to create a table per User that looks as follows:
    for user d00587
    first_name  -  last_name  -  age
    **Values
    Jon         -  Smith      -  48
    for user d00127
    first_name  -  last_name  -  positioin
    Jack        -  Daniels    -  Manager
    I split the initial table by sorting it according to userID and then looping into an itab with an AT END OF userid, thus I receive the table per user:
    Example iTab
    UserID - attribut_name - attribute_value
    Example Data
    d00587 - first_name    - Jon
    d00587 - last_name     - Smith
    d00587 - age           - 48
    However I have no clue on how to create a new internal table with field-names = attribute_name.
    Does anybody have an idea or example code for this?
    Thanks a lot for your help,
    Kind regards,
    Mingolo

    Hello Minima
    Here is some sample coding:
    DATA:
      gt_fcat  type lvc_t_fcat,
      gdo_data TYPE REF TO data.
    FIELD-SYMBOLS:
      <gt_itab> TYPE table.
    CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
      EXPORTING
    *     I_BUFFER_ACTIVE              =
        i_structure_name             = 'MARA'
    *     I_CLIENT_NEVER_DISPLAY       = 'X'
    *     I_BYPASSING_BUFFER           =
      CHANGING
        ct_fieldcat                  = gt_fcat
      EXCEPTIONS
        inconsistent_interface       = 1
        program_error                = 2
        OTHERS                       = 3
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL METHOD cl_alv_table_create=>create_dynamic_table
      EXPORTING
    *      I_STYLE_TABLE             =
        it_fieldcatalog           = gt_fcat
      IMPORTING
        ep_table                  = gdo_data
    *      E_STYLE_FNAME             =
      EXCEPTIONS
        generate_subpool_dir_full = 1
        OTHERS                    = 2.
    IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ASSIGN gdo_data->* TO <gt_itab>.
    In your case, you would call the function module with your tables (D00587, D00127). Remove all fields from the fieldcatalog that you do not need before calling the static method.
    Regards
      Uwe

  • Problem in calling abap editor with the program name in Web Dynpro ABAP

    Hi,
    I have to caal ABAP Editor screen with the display of program after clicking a button from web dynpro abap application.
    I am able to call the ABAP Editor initial screen, but i want the editor display screen with a program.
    How to do that?
    Please find my code below:
      DATA : FINAL_URL TYPE STRING,
             URL TYPE STRING.
      DATA: LV_HOST TYPE STRING,
            LV_PORT TYPE STRING.
    DATA V_TCODE TYPE TCODE.
      DATA:  LO_WINDOW_MANAGER TYPE REF TO IF_WD_WINDOW_MANAGER.
      DATA:  LO_API_COMPONENT  TYPE REF TO IF_WD_COMPONENT.
      DATA:  LO_WINDOW         TYPE REF TO IF_WD_WINDOW.
      DATA:  LD_URL TYPE STRING.
    V_TCODE = 'SE38'.
    *Call below method to get host and port
      CL_HTTP_SERVER=>IF_HTTP_SERVER~GET_LOCATION(
         IMPORTING
           HOST = LV_HOST
           PORT = LV_PORT ).
      CONCATENATE 'http'
      '://' LV_HOST ':' LV_PORT '/sap/bc/gui/sap/its/webgui/?sap-client=&transaction=' V_TCODE '&OKCODE=SHOW'
      INTO URL.
      LO_API_COMPONENT  = WD_COMP_CONTROLLER->WD_GET_API( ).
      LO_WINDOW_MANAGER = LO_API_COMPONENT->GET_WINDOW_MANAGER( ).
      LD_URL = URL.
      CALL METHOD LO_WINDOW_MANAGER->CREATE_EXTERNAL_WINDOW
        EXPORTING
          URL    = LD_URL
        RECEIVING
          WINDOW = LO_WINDOW.
      LO_WINDOW->OPEN( ).
    Now, how to pass my Zprogram name into the URL.
    I need to get the editor screen with the display of the program.
    Thanks,
    Radhika

    Hi Kiran,
    Please find my code below:
    DATA :   URL TYPE STRING.
      DATA: LV_HOST TYPE STRING,
            LV_PORT TYPE STRING.
      DATA:  LO_WINDOW_MANAGER TYPE REF TO IF_WD_WINDOW_MANAGER.
      DATA:  LO_API_COMPONENT  TYPE REF TO IF_WD_COMPONENT.
      DATA:  LO_WINDOW         TYPE REF TO IF_WD_WINDOW.
      DATA:  LD_URL TYPE STRING.
    *Call below method to get host and port
      CL_HTTP_SERVER=>IF_HTTP_SERVER~GET_LOCATION(
         IMPORTING
           HOST = LV_HOST
           PORT = LV_PORT ).
      CONCATENATE 'http'
    '://' LV_HOST ':' LV_PORT '/sap/bc/gui/sap/its/webgui/?&transaction=se38&RS38M-PROGRAMM=Y2PSOLTREE&~okcode=shop'
      INTO URL.
      LO_API_COMPONENT  = WD_COMP_CONTROLLER->WD_GET_API( ).
      LO_WINDOW_MANAGER = LO_API_COMPONENT->GET_WINDOW_MANAGER( ).
      LD_URL = URL.
      CALL METHOD LO_WINDOW_MANAGER->CREATE_EXTERNAL_WINDOW
        EXPORTING
          URL    = LD_URL
        RECEIVING
          WINDOW = LO_WINDOW.
      LO_WINDOW->OPEN( ).
    Here,, Y2PSOLTREE is the program, that should show in SE38 screen.
    I used the above code, but still it is showing the SE38 initial screen.
    Thanks,
    Radhika

  • In Design Data merge into separate pdf files with variable data name

    Hi all, thank you for taking the time to read this.
    Here's what I have.
    I've created a file in indesign using a 65 page document.
    With this document I've set it up to have specific data in certain areas with data merge.  I have that part setup and it works fine. 
    When I go to export PDF it creates one massive pdf document with all the variable data in it.  However here is the scenario I would like.
    1. Indesign to create a separate pdf file for each record.  So in this example it would be 100 different 65 page pdfs since it should have different pdfs for each record and there are 100 records in the csv.
    2. The pdf should be named after each variable record.  For example record one says name "Joe", record 2 name "Frank".  So it should create joe.pdf, frank.pdf etc.
    How can I accomplish this?

    I don't know if this script works in CS4 or not:
    http://indesignsecrets.com/page-exporter-utility-peu-5-script-updated-for-cs3.php

  • Calling SQL Loader with Dynamic file names

    HI all
    I woul like to know if I can call sql loader as below
    $ sqlldr userid=uname/pwd control=new.ctl, data=$1
    I have to schedule my loader 3 times a day and each time my file names are different(AAA_BBB_timestamp)
    Thanks

    I have found a solution myself and if any one is interested its like this
    for file in `ls -1 /opt/user/from/`
    do
    sqlldr userid=user/pwd@connect_string control=control_file.ctl data="/opt/user/from//$file"
    done
    Ramu

Maybe you are looking for

  • Not able to print reader file

    When I convert MS Word files to Adobe Reader files, some people are not able to print them. Some of the content prints for instance, but some is missing. The graphics may print, but the text is missing. Any ideas? Thanks, Brian

  • ORA 54668

    Hello, Thanks in advance for your willingness to help me on this difficult issue. I get this error message: Invalid geometry for table TEST.BUILDING, column SDO_GEOMETRY.54668 ORA-54668: a 2D SRID cannot be used with a 3D geometry Irreparably invalid

  • N80: how i can send SMS Picture?

    hi i have new N80, and i want send SMS Picture. how i can do that?

  • IPhoto hangs when trying to set places

    so far iPhoto 09 is a complete bust for me. Among other things iPhoto is unusable if i try to set places. after typing in a location the pinwheel of death comes up and stays. anyone else seeing this? any fixes?

  • Trying to update "Pages" from App Store. An old email address shows up and am unable to delete.

       I am able to purchase a new app from Apple App store using my current email address and password. I am not able to update a previously purchased app (for instance "Pages") that I purchased some time ago when I had a different email address. When I