Executing Dynamic actions in Background???

Hello Experts,
We have a requirement where we need to automate PA40. The data would be sent in csv file and we need to perform the required steps to insert data into Infotypes.
The issue is in batch mode (background mode), the dynamic actions wouldn't be called and the business wants the dynamic actions to be considered as well.
Pls let me know if there is any way we can interpret the dynamic actions dynamically; meaning the prog should be able to handle the newly created dynamic actions as well.
Any pointers to this are highly appreciated.
Regards
RK

Hello Raj;
In documentation of  Dynamic Actions it is written so:
Note on creating a batch input session:
Dynamic actions are not processed in a batch input session.
In batch input, you must specify the exact sequence of the screens. To
ensure this is the case, you must have already programmed the dynamic
action checks before you create the batch input session.
To avoid errors only the static actions are processed when you program
and process a session. Infotypes that usually only appear in the system
as a result of a dynamic action should be updated by calling up the
transaction separately.
Hope this can help you,
Regards.
Okan

Similar Messages

  • Executing dynamic action JS then plsql code with checkbox.

    All,
    I have a checkbox which when clicked i want to run javascript expression then next plsql code in that sequence. But iam getting the first issue here when i put in JS an expression like document.getElementById("P111_CHECK1").value ... or even document.getElementById("P111_CHECK1").checked i always get undefined error. So how can i determine if the checkbox is checked or unchecked in DA? thanks in advance.

    Hi,
    still stuck here on how do i check/uncheck a single checkbox in Apex i tried via dynamic action JS expression like this but doesnt work ==> document.getElementById("P111_CHECKBOX1").checked = true/false; Any help on this pls?

  • Execute javascript from plsql in a dynamic action.

    Is it possible to execute javascript with htp.p from a plsql block in a dynamic action (on change).
    I have tried it but I get a JSON error.
    The reason I want to to this is:
    I have to check something with plsql and depending on the result I want to do something in javascript.
    I now going to try it with ajax from javascript, but if somebody has a other way to do this i like to hear it.
    Thanks,
    Fred.

    Very neat, many thanks.
    I now have a 'Set Value' 'Javascript Expression' action of 'this.triggeringElement.id;' to set a hidden *but unprotected* page item. This is followed by the 'Execute PL/SQL' action which simply calls a package procedure and passes the name of the triggering item. The procedure then sets the session state(s) as required.
    Thank you!

  • Dynamic actions user execute the Hiring action, IT 0105 dynamically adjust

    Hello Any body can guid me for the below requirement..
    Whenever the user execute the Hiring action (action type: Z1-Hiring cPA) the system should adjust the infotype 0105 dynamically during executing the hiring process, in the same way the subtype (0010 : E-mail )for the userid in SAP HR should be adjusted.  The HR Services should not have to do this manually.
    The e-mail account can be composed from the fields first name, name prefix and birth name. The fields have to be separated by dots. When the name prefix contains more words they have to be separated by a dot.
    When company code is 003 the value email atthe rate xx.comhas to be adjusted at the end.
    When company code is 004 the value email atthe rate yy.com has to be adjusted at the end.

    Hello Donnie Freako
    Thanks for the the information, As i am a HR-ABAP consultent. I am not much femiler on this dynamic actions..
    for this case: the  DESCRIPTION:  In the dynamic module pool ZXXXM000 has to be changed. - so for this where exactly i need to check the transcation, i think its in SE51..
    please provide me the steps for the same... and if possible please provide the breaf detaild explination for the below code where exactly i need to place the below, i think we need to place this in T588Z table against fields and values and whatis the meaing of P and I and F and W .. as a technical person i dont know much about this please help me on the same..
    P PSPAR-MASSN=u2019Z1u2019
    P P0001-BUKRS=u2019003u2019
    I INS,0105,0010/D
    F Z_003_EMAIL (ZEMAIL)
    W P0105-USRID_LONG=RP50D-FIELD1
    P P0001-BUKRS=u2019004u2019
    I INS,0105,0010/D
    F Z_004_EMAIL (ZEMAIL)
    W P0105-USRID_LONG=RP50D-FIELD1
    clear explination would be appreciated

  • I can not execute a dynamic action if I execute a BI

    I am executing an infotype in Batch input with a call transaction and the dynamic actions don't work.
    Any ideas.
    Thank you.

    Unfortunetly dynamic actions (T588Z) are not called in batch input mode - that is standard SPA HR processing.
    The normal process is to create all the infotypes in the batch input program - even the ones that would be created by dynamic actions if running online in PA30/PA40
    hope that helps

  • Dynamic Actions: background execution

    Hi
    here below the Dynamic Action that I have customized:
    0000                   04     310     P     T001P-MOLGA='15'
    0000                   04     315     P     PSPAR-MASSN='Z1'/X
    0000                   04     316     P     PSPAR-MASSN='Z2'/X
    0000                   04     317     P     PSPAR-MASSN='Z3'/X
    0000                   04     318     P     PSPAR-MASSN='Z7'/X
    0000                   04     319     P     PSPAR-MASSN='ZC'/X
    0000                   04     320     I     INS,0016,,,(P0000-BEGDA),(P0000-ENDDA)/D
    0000                   04     325     W     P0016-EINDT=P0000-BEGDA
    The background execution works correctly for Action Types Z3 and Z7 which are not linked to Recruitment.
    The execution of Dynamic Action DOESN'T WORK in the background mode but it works in foreground (even if in the dynamic action I've wrote /D) for Z1-Z2-ZC: these actions are linked to Recruitment.
    Can you help me?
    Paola
    Edited by: Pizeta on Mar 2, 2012 10:59 AM

    All the Actions are for Personnel Administration.
    Actions:
    Z1-Z2-ZC in T529A-FUNCH are customized like "7 Initial hiring and transfer of data from Recruitment" --> the dynamic action works but in foreground
    Z3-Z7 in  T529A-FUNCH are customized like "0     Other actions"  or  "1     Initial hiring" --> the dynamic action works correctly in the background
    P.

  • Dynamic  action - execute pl/sql code

    Hi All and thanks fro any assistance.
    I am trying to Execute the following pl/sql Code in a dynamic action however get the following error - AJAX call returned server error ORA-01403: no data found for Execute PL/SQL code.
    I have all page items iin the page items to submit section.
    declare
      l_file_comments  IMM_DOCUMENTS.FILE_COMMENTS%type;
      l_file           IMM_DOCUMENTS.FILE_BLOB%type;
      l_filename       IMM_DOCUMENTS.FILENAME%type;
      l_mimetype       IMM_DOCUMENTS.FILE_MIMETYPE%type;
      l_charset        IMM_DOCUMENTS.FILE_CHARSET%type;
    begin
        select f.blob_content,
               f.filename,
               f.mime_type,
               nvl(f.file_charset, f.dad_charset)
          into l_file,
               l_filename,
               l_mimetype,
               l_charset
          from wwv_flow_files f
         where f.name = :P80_FILE;
      if l_file is not null then
        insert into IMM_DOCUMENTS
          sub_id,
          document_type_id,
          filename,
          file_blob,
          file_comments,
          file_mimetype,
          file_charset
        values
          :P80_SUB_ID,
          :P80_DOCUMENT_TYPE_ID,
          l_filename,
          l_file,
          :P80_FILE_DESCRIPTION,
          l_mimetype,
          l_charset
        delete from wwv_flow_files where name = :P80_FILE;
      end if;
    end;

    Hi Marie,
    as Matthew says, the only part of the code that could result in that error is the select into statement. This is because, in pl/sql, a select into statement is expected to return one row only. If it returns no rows it raises a no data found exception and if it returns more than one row it raises a too many rows error.
    If it is acceptable that this query may return no rows, then you have to handle this situation. The two methods that you can use would be firstly to use a named cursor and fetch a row from this, if there is no data then it does not raise an exception. The other method would be to put in an exception handler around the select statement.
    EG - prefered, mainly because I think it is better to code in a way that minimises exception handling.
    declare
       l_file_comments  IMM_DOCUMENTS.FILE_COMMENTS%type;
       l_file           IMM_DOCUMENTS.FILE_BLOB%type;
       l_filename       IMM_DOCUMENTS.FILENAME%type;
       l_mimetype       IMM_DOCUMENTS.FILE_MIMETYPE%type;
       l_charset        IMM_DOCUMENTS.FILE_CHARSET%type;
       CURSOR file_cur IS
         select f.blob_content,
                f.filename,
                f.mime_type,
                nvl(f.file_charset, f.dad_charset)
           from wwv_flow_files f
          where f.name = :P80_FILE;
    begin
       OPEN file_cur;
       FETCH file_cur INTO
                l_file,
                l_filename,
                l_mimetype,
                l_charset;
       CLOSE file_cur;
       if l_file is not null then
         insert into IMM_DOCUMENTS
           sub_id,
           document_type_id,
           filename,
           file_blob,
           file_comments,
           file_mimetype,
           file_charset
         values
           :P80_SUB_ID,
           :P80_DOCUMENT_TYPE_ID,
           l_filename,
           l_file,
           :P80_FILE_DESCRIPTION,
           l_mimetype,
           l_charset
         delete from wwv_flow_files where name = :P80_FILE;
       end if;
    end;
    OR
    declare
      l_file_comments  IMM_DOCUMENTS.FILE_COMMENTS%type;
      l_file           IMM_DOCUMENTS.FILE_BLOB%type;
      l_filename       IMM_DOCUMENTS.FILENAME%type;
      l_mimetype       IMM_DOCUMENTS.FILE_MIMETYPE%type;
      l_charset        IMM_DOCUMENTS.FILE_CHARSET%type;
    begin
      BEGIN
        select f.blob_content,
               f.filename,
               f.mime_type,
               nvl(f.file_charset, f.dad_charset)
          into l_file,
               l_filename,
               l_mimetype,
               l_charset
          from wwv_flow_files f
         where f.name = :P80_FILE;
      EXCEPTION
        WHEN no_data_found THEN
          NULL;
      END;
      if l_file is not null then
        insert into IMM_DOCUMENTS
          sub_id,
          document_type_id,
          filename,
          file_blob,
          file_comments,
          file_mimetype,
          file_charset
        values
          :P80_SUB_ID,
          :P80_DOCUMENT_TYPE_ID,
          l_filename,
          l_file,
          :P80_FILE_DESCRIPTION,
          l_mimetype,
          l_charset
        delete from wwv_flow_files where name = :P80_FILE;
      end if;
    end;Note : code is untested.
    Regards
    Andre

  • Help using a dynamic action to update tabular form items (specifically radio button) based on collection

    Hi Everyone, I have posted this question in the past and made huge progress with Denes Kubicek's help:  https://apex.oracle.com/pls/apex/f?p=31517:294:115851992029365::::: based on my earlier question posted: https://forums.oracle.com/forums/thread.jspa?threadID=2537494
    I am struggling with one item in my tabular form.  It is a radio button.  The choices all appear properly, but the value is not saved in the collection (and hence, not saved in the table).  All other items in the tabular form save properly.
    here is what I have for the query.   It is item c024 (which maps to ;'f03'), which is defined as a radio LOV based on an existing LOV.
    Currently I have:
    2 page items:
    P110_ID
    P110_VALUE
    Dynamic action called CHANGE COLUMN:
    event: CHANGE
    selection type: jQUERY Selector
    jQuery:
    jQuery Select = input[name='f03'],select[name'f08'],select[name='f09'],input[name='f10'],input[name='f11'],input[name='f12'],select[name='f40'],input[name='f21'],input[name='f22'],input[name='f23'],input[name='f50']
    event scope: Dynamic
    true action#1: set value P110_ID javascript expression this.triggeringElement.id
    true action#2: set value P110_VALUE javascript expression this.triggeringElement.value
    true action#3: execute pl/sql code
    declare
      v_member number;
      v_seq number;
    begin
      v_member := TO_NUMBER (SUBSTR (:p110_id, 2, 2));
      select ltrim(substr(:p110_ID,5,4),'0') into v_seq from dual;
      safis_collections.update_column(v_seq,
                                    v_member,
                                    :p110_value);
    true ation#4 refresh region :LANDINGS_COLLECTION
    the tabular form is based on the query:
    SELECT
    apex_item.text(1,seq_id,'','','id="f01_'||seq_id,'','') "DeleteRow",
    seq_id,
    seq_id display_seq_id,
    apex_item.text_from_LOV(c004,'SPECIES')||'-'||apex_item.text_from_LOV(c005,'GRADE')||'-'||apex_item.text_from_LOV(c006,'MARKETCODE')||'-'||apex_item.text_from_LOV_query(c007,'select unit_of_measure d, unit_of_measure r from species_qc') unit,
    apex_item.select_list_from_LOV(8,c008,'DISPOSITIONS','onchange="getAllDisposition('||seq_id||')"','YES','0','  -- Select Favorite --  ','f08_'||seq_id,'') Disposition,
    apex_item.select_list_from_LOV(9,c009,'GEARS','style="background-color:#FBEC5D; "onFocus="checkGearPreviousFocus('||seq_id||');"onchange="getAllGears('||seq_id||')"','YES','3333','-- Select Favorite --','f09_'||seq_id,'') Gear,
    apex_item.text(10,TO_NUMBER(c010),5,null, 'onchange="setTotal('||seq_id||')"','f10_'||seq_id,'') Quantity,
    apex_item.text(11,TO_NUMBER(c011),5,null,'onchange="getPriceBoundaries('||seq_id||')"','f11_'||seq_id,'') Price,
    apex_item.text(12, TO_NUMBER(c012),5,null, 'onchange="changePrice
    ('||seq_id||')" onKeyDown="selectDollarsFocus('||seq_id||',event);"','f12_'||seq_id,'') Dollars,
    decode(c013,'Y',apex_item.text(14, c014,30,null,'style="background-color:#FBEC5D;" onClick="onFocusAreaFished('||seq_id||');"','f14_'||seq_id,''),'N','N/A') Area_Fished,
    decode(c017,'Y',apex_item.text(18, c018,4,null,'style="background-color:#FBEC5D; "onBlur="setUnitQuantity('||seq_id||')"','f18_'||seq_id,''),'N','N/A') UNIT_QUANTITY,
    decode(c017,'Y',apex_item.text(19,'CN',3,null,'readOnly=readOnly;','f19_'||seq_id,''),'N','N/A') UNIT_COUNT,
    c024 hms_flag,
    decode(c050,'Y',apex_item.checkbox(21,'Y','id="f21_'||seq_id||'" style="background-color:#FBEC5D; " onClick="alterYes('||seq_id||');" onKeyPress="alterYes('||seq_id||');"',c021),'N','N/A') FinsAttached,
    decode(c050,'Y',apex_item.checkbox(22,'N','id="f22_'||seq_id||'" style="background-color:#FBEC5D;" onClick="alterNo('||seq_id||');" onKeyPress="alterNo('||seq_id||');"',c022),'N','N/A') FinsNotAttached,
    decode(c050,'Y',apex_item.checkbox(23,'U','id="f23_'||seq_id||'" style="background-color:#FBEC5D;" onClick="alterUnk('||seq_id||');" onKeyPress="alterUnk('||seq_id||');"',c023),'N','N/A') FinsUnknown,
    decode(c050,'Y',apex_item.textarea(28,c028,3,null,null,'f28_'||seq_id,''),'N','N/A') Explanation,
    decode(c024,'N',apex_item.select_list_from_LOV(29,c029,'HMSNATURE','onchange="saveNature('||seq_id||')"','YES','A','-- Select Nature of Sale --','f29_'||seq_id,''),'U',apex_item.select_list_from_LOV(29,c029,'HMSNATURE','onchange="saveNature('||seq_id||')"','YES','A','-- Select Nature of Sale --','f29_'||seq_id,''),'Y','N/A') Nature_Of_Sale,
    decode(c020,'Y',
    apex_item.select_list_from_LOV(40,c040,'HMS_AREA_CODE','style="background-color:#FBEC5D;"',null,null,null,'f40_'||seq_id,''),
    'N','N/A') HMS_AREA_CODE,
    c020,c050,
    decode(c020,'Y',
    apex_item.text(41,TO_NUMBER(c041),5,null,null,'f41_'||seq_id,''),
    'N','N/A') Sale_Price
    from apex_collections
    where collection_name = 'SPECIES_COLLECTION' order by seq_id
    I have noticed the following:
    when I change column C011 (price) the following values are set in the dynamic action:
    P110_ID = f11_1
    P110_VALUE = whatever I change the price to.
    when I change the column C024 (hms_flag), the following values are set:
    P110_ID = f03_0001
    P110_VALUE = whatever I change hms_flag to.
    the region is refreshed in my dynamic action, and the change for hms_flag does not hold.  I have tested the SQL query that generates the value for v_SEQ in the dynamic action.   In both a change to price and HMS_FLAG it appears valid
    select ltrim(substr(:p110_ID,5,4),'0') into v_seq from dual;
    if f11_1, v_seq:= 1
    if f03_0001, v_seq := 1
    thank you!

    solved.  sort of. 
    field c024 references f03.
    the Dynamic ACtion, step 4 calculates v_member by taking a substring of P110_ID...and in all other fields, the column and the field (fxx) are the same value....except for c024.
    I am not certain exactly how to resolve, but see the problem.

  • How to Handle Dynamic actions in batch mode???

    Hello Experts,
    We have a requirement where we need to automate PA40.  The data would be sent in csv file and we need to perform the required steps to insert data into Infotypes.
    The issue is in batch mode (background mode), the dynamic actions wouldn't be called and the business wants the dynamic actions to be considered as well. 
    Pls let me know if there is any way we can interpret the dynamic actions dynamically; meaning the prog should be able to handle the newly created dynamic actions as well.
    Any pointers to this are highly appreciated.
    Regards
    RK

    Hi.
    As far as i know, the limitation comes from the BDC execution itself, it doesn't really matter whether the execution is online or in batch mode.
    * dynamische Massnahme
        IF sy-binpt EQ space.
    *      befinden wir uns im ALE-Eingang ?
          CLEAR: ale_flag.                                   "XFYAHRK063273
          call function 'RHAP_ALE_FLG_GET'                   "XFYAHRK063273
            importing                                        "XFYAHRK063273
              ale_flg = ale_flag.                            "XFYAHRK063273
          IF ale_flag IS INITIAL.                            "XFYAHRK063273
            IF pspar-vinft NE space.  "infotype view         "XYLPH9K007065
              PERFORM dyn_measure IN PROGRAM (view_repid).   "XYLPH9K007065
            ELSE.                                            "XYLPH9K007065
              PERFORM dyn_measure.
            ENDIF.                                           "XYLPH9K007065
            PERFORM process_m
    One thing you could try to do to avoid this and get the dynamic measures executed is to use the NOBINPT variable of the OPTIONS structure in CALL TRANSACTION
      DATA opt TYPE ctu_params.
      opt-dismode = 'A'.
      opt-nobinpt = 'X'.
      CALL TRANSACTION 'PA30' USING bdcdata OPTIONS FROM opt.
      PERFORM close_group.

  • Dynamic Actions with Multiple Actions Capability

    Dynamic Actions with Multiple Actions Capability
    How can I get Dynamic Actions to work on Actions that are stored solely on IT0302 due to the multiple relationship to a previous Action that is stored on both IT0302 and IT0000?
    When multiple actions on a given day are executed, the dynamic action from the first action entered is executed twice - when it should only execute the first time with the second actions dynamic action triggering the second time.
    Thanks

    When there are multiple actions with the same effective date the wrong dynamic action is triggered.  For example, if I have an Expat Return To Home action followed by an Internal Move action with the same effective date the below events occur:
    1.  IT0001 is updated due to Expat Return to Home - triggering the Dynamic Action off of IT0000 which is Expat Return to Home (Correct)
                -  Action is stored on IT0000 and IT0302
    2.  IT0001 is updated due to Internal Move - triggering the Dynamic Action off of IT0000 which is Expat Return to Home (Incorrect - background processing creates data not needed)
                -  Action is stored only on IT0302
    Question:
    How can we leverage Multiple Actions with the same effective date while continuing to use Dynamic Actions?

  • Issue in execution of Dynamic action on change event

    Hi,
    Greetings.
    I have scenario, where I have one select list (P_CATEGORY) and one shuttle control (P_ROOMS) on page.
    The values of the shuttle list is being populated based on the selected value in select list.
    The left pane of shuttle control's value based on LOV and source of the shuttle item is a plsql function, which returning colon separated value list.
    So that returned values shown in the right pane of shuttle.
    The LOV values are getting being populated using cascading LOV i.e based on the of Select List item. But the Shuttle source values not getting auto refresh and for achieving that I've created a dynamic true action on change event of Select list.
    The dynamic action is with :
    Action : Set Value
    Set Type : PL SQL funciton body
    Page items to submit : P_CATEGORY (this is select list)
    Escape Special Character : Yes
    Suppress Change event : Yes
    Affected Elements -
    Selection type : Item(s)
    Item(s) : P_ROOMS
    This is perfectly working on Firefox but not working on IE9 & Google Chrome.
    I've debugged in both IE9 & Google chrome and found the dynamic action get executes ajax call and the values get back but not rendering on the screen. i.e not assigning to the item.
    So can you please advice me what will be a workaround for this issue?
    I am using Application Express 4.1.0.00.32 .
    I'll appreciate your prompt response.
    Thanks & Regards,
    Jaydipsinh Raulji

    I don't understand why this is not working withouth seeing an example, there might be multiple processes working on the item.
    Anyway if the value is returned check if the value is in the session aswell. If it is in the session but not on the page that means you will need to find a way to bring it from the DB to the page. You can do this by adding an action to your DA:
    Action: Execute PL/SQL code
    PL/SQL code: NULL;
    Page Items to Return: your shuttle item

  • Refresh report title with dynamic action

    Hi all,
    I have a report that is refreshed with an dynamic action. When the refresh is performed, first the value of two hidden variables are set (P2_ID and P2_NAME) and are submitted (using a dynamic action type 'pl/sql', with code 'null;' and page items to submit: P2_ID,P2_NAME).
    In the query of the report, i use :P2_ID in the where-clause. That's all working like a charm! The one thing that doen't work, is the title of the region: that's defined as 'Properties of &P2_NAME.', but the title isn't refreshed when the report gets refreshed.
    Is there a solution for this? I hope I'm clear enough.

    See Re: Dynamic action - Refresh
    So you are right; the native Refresh action just refreshes the report content, it does not perform &ITEM. substitutions everywhere in the region.
    What you could do is use a named SPAN as the title like <span id="my_title">&P2_NAME.</span> and add a TRUE action to your Dynamic Action to set the title using Execute Javascript code $s('my_title',$v('P2_NAME'));Hope this helps.

  • Dynamic Action with KeyCode check for ENTER button pressed

    Hi,
    I want to create a dynamic action which executes if the ENTER button of field P1_NAME is pressed.
    I thought about this type of DA:
    Event: Key Press
    Selection Type: Item(s)
    Item(s): P1_NAME
    Condition: Javascript expression
    Value: this.triggeringElement.keyCode == 13
    That unfortunately doesn't work! Dynamic action doesn't get executed...
    Hope for help! :)
    Tobias

    I found the solution in my own blog: :)
    Event: Key Press
    Selection Type: Item(s)
    Item(s): P1_NAME
    Condition: Javascript expression
    Value: this.browserEvent.keyCode == 13

  • Dynamic action with function works, doesnt refresh textfield

    Hi all,
    experimenting with dynamic actions so I got the following setup:
    I've built a screen with 2 text boxes
    P7_input
    P7_output
    The goal is to put some tet in P7 input and have it returned with additional text in P7_OUTPUT
    CREATE OR REPLACE PROCEDURE PRC_ECHO
      P_INPUT IN VARCHAR2  DEFAULT 'LEEG'
    , P_OUTPUT OUT VARCHAR2 
    ) AS
    BEGIN
      p_output := 'Ingevoerd: ' || p_input;
    END PRC_ECHO;I've created a dynamic action on the LOSE FOCUS event of item P7_INPUT.
    The true action executes PL/SQL (sequence number 10)
    Begin
    eigen_apps.uga_prc_echo (:p7_input, :P7_OUTPUT);
    end;"Page items to submit" are set to P7_INPUT, P7_OUTPUT
    (and I tried with just P7_INPUT).
    The second true action (sequence number 20) does a REFRESH on ITEM P7_OUTPUT (and I tried refresh region and other things I thought would make it work.)
    When I enter something in P7_INPUT and tab, click or enter away from the P7_INPUT field, nothing changes in my P7_OUTPUT textfield.
    Only when I hit the refresh button in my browser P7_OUTPUT is filled with 'Ingevoerd: <P7_INPUT value>.
    So. The procedure does return the value into P7_OUTPUT, but I cant get an instant refresh of the P7_OUTPUT to work.
    Can any of you help me?
    Robin

    Getting some other errors now, will look into this tomorrow.
    1 error has occurred
    ORA-06550: line 4, column 18: PLS-00382: expression is of wrong type ORA-06550: line 4, column 7: PL/SQL: Statement ignoredNeed to check my procedure...
    Robin

  • Performance issues with dynamic action (PL/SQL)

    Hi!
    I'm having perfomance issues with a dynamic action that is triggered on a button click.
    I have 5 drop down lists to select columns which the users want to filter, 5 drop down lists to select an operation and 5 boxes to input values.
    After that, there is a filter button that just submits the page based on the selected filters.
    This part works fine, the data is filtered almost instantaneously.
    After this, I have 3 column selectors and 3 boxes where users put values they wish to update the filtered rows to,
    There is an update button that calls the dynamic action (procedure that is written below).
    It should be straight out, the only performance issue could be the decode section, because I need to cover cases when user wants to set a value to null (@) and when he doesn't want update 3 columns, but less (he leaves '').
    Hence P99_X_UC1 || ' = decode('  || P99_X_UV1 ||','''','|| P99_X_UC1  ||',''@'',null,'|| P99_X_UV1  ||')
    However when I finally click the update button, my browser freezes and nothing happens on the table.
    Can anyone help me solve this and improve the speed of the update?
    Regards,
    Ivan
    P.S. The code for the procedure is below:
    create or replace
    PROCEDURE DWP.PROC_UPD
    (P99_X_UC1 in VARCHAR2,
    P99_X_UV1 in VARCHAR2,
    P99_X_UC2 in VARCHAR2,
    P99_X_UV2 in VARCHAR2,
    P99_X_UC3 in VARCHAR2,
    P99_X_UV3 in VARCHAR2,
    P99_X_COL in VARCHAR2,
    P99_X_O in VARCHAR2,
    P99_X_V in VARCHAR2,
    P99_X_COL2 in VARCHAR2,
    P99_X_O2 in VARCHAR2,
    P99_X_V2 in VARCHAR2,
    P99_X_COL3 in VARCHAR2,
    P99_X_O3 in VARCHAR2,
    P99_X_V3 in VARCHAR2,
    P99_X_COL4 in VARCHAR2,
    P99_X_O4 in VARCHAR2,
    P99_X_V4 in VARCHAR2,
    P99_X_COL5 in VARCHAR2,
    P99_X_O5 in VARCHAR2,
    P99_X_V5 in VARCHAR2,
    P99_X_CD in VARCHAR2,
    P99_X_VD in VARCHAR2
    ) IS
    l_sql_stmt varchar2(32600);
    p_table_name varchar2(30) := 'DWP.IZV_SLOG_DET'; 
    BEGIN
    l_sql_stmt := 'update ' || p_table_name || ' set '
    || P99_X_UC1 || ' = decode('  || P99_X_UV1 ||','''','|| P99_X_UC1  ||',''@'',null,'|| P99_X_UV1  ||'),'
    || P99_X_UC2 || ' = decode('  || P99_X_UV2 ||','''','|| P99_X_UC2  ||',''@'',null,'|| P99_X_UV2  ||'),'
    || P99_X_UC3 || ' = decode('  || P99_X_UV3 ||','''','|| P99_X_UC3  ||',''@'',null,'|| P99_X_UV3  ||') where '||
    P99_X_COL  ||' '|| P99_X_O  ||' ' || P99_X_V  || ' and ' ||
    P99_X_COL2 ||' '|| P99_X_O2 ||' ' || P99_X_V2 || ' and ' ||
    P99_X_COL3 ||' '|| P99_X_O3 ||' ' || P99_X_V3 || ' and ' ||
    P99_X_COL4 ||' '|| P99_X_O4 ||' ' || P99_X_V4 || ' and ' ||
    P99_X_COL5 ||' '|| P99_X_O5 ||' ' || P99_X_V5 || ' and ' ||
    P99_X_CD   ||       ' = '         || P99_X_VD ;
    --dbms_output.put_line(l_sql_stmt); 
    EXECUTE IMMEDIATE l_sql_stmt;
    END;

    Hi Ivan,
    I do not think that the decode is performance relevant. Maybe the update hangs because some other transaction has uncommitted changes to one of the affected rows or the where clause is not selective enough and needs to update a huge amount of records.
    Besides that - and I might be wrong, because I only know some part of your app - the code here looks like you have a huge sql injection vulnerability here. Maybe you should consider re-writing your logic in static sql. If that is not possible, you should make sure that the user input only contains allowed values, e.g. by white-listing P99_X_On (i.e. make sure they only contain known values like '=', '<', ...), and by using dbms_assert.enquote_name/enquote_literal on the other P99_X_nnn parameters.
    Regards,
    Christian

Maybe you are looking for

  • Oracle 10g Express edition,can't visit database homepage

    I have installed Oracle 10g Express edition without error meggage, It seems goes well ,but when I want to visit my database_homepage on http://127.0.0.1:8080/apex, I see this: The page cannot be displayed There is a problem with the page you are tryi

  • Problem using SQL-LOADER and Unique Identifiers

    I'm trying to load a fixed-length records file containing people names and phone numbers. Data is specified as follows Toni Tomas66666666669999999999 Jose Luis 33333333330000000000 Notice that a maximum of 2 numbers can follow a person name, and 0000

  • Sorting albums within an artist

    Okay so I used to be able to sort my different albums by the same artist within the order that I set by going into "get info" and saying the albums were disc 1 through 10 or what have you. For example, if I had Linkin Park in my iTunes, I could say h

  • Multi-camera edit question: end clips cannot be separated from audio

    I have a synced three camera project that I have almost finished editing. I want to select the last video clip in my sequence and roll it back, while keeping the audio in place.  The idea is to fade the picture to black while the synced audio continu

  • Export O7.3 / Import 9i problem...

    Hello all, I hope that someone can help me on this. I have an Oracle 7.3 database which I want to export (just a specific user's tables) and I then I need to import into an Oracle 9i database. I thought that I was doing this correctly, but on import