6 Replies Latest reply: Feb 20, 2011 11:32 AM by vee RSS

    Set MRD_COUNT

    Gabriel
      Hi,
      Is there any way to set variable #MRD_COUNT# from a pl/sql process?
        • 1. Re: Set MRD_COUNT
          jariola
          Hi,


          As I know, no.

          But depending what you really like archive, there is quite possible workaround.


          Regards,
          Jari
          • 2. Re: Set MRD_COUNT
            Gabriel
            I need to set this variable when I delete some records manually in a pl/sql process, or how to show in notifications how many rows have been deleted after pl/sql process completes.
            • 3. Re: Set MRD_COUNT
              jariola
              Hi,

              Example:
              Create application or page hidden item Px_MY_DEL_ROWS.
              Process like
              DELETE from my_tbl
              WHERE col1= :PX_SOME_ITEM
              ;
              :Px_MY_DEL_ROWS := SQL%ROWCOUNT;
              Process success message like
              &Px_MY_DEL_ROWS. rows deleted.
              Regards,
              Jari
              • 4. Re: Set MRD_COUNT
                vee
                You dont need the hidden variable, You can set the Success message directly from the PLSQL block
                BEGIN
                 delete from demo_customers where 1= 2;
                 apex_application.g_print_success_message := SQL%ROWCOUNT||' rows(s) deleted';
                END;
                • 5. Re: Set MRD_COUNT
                  jariola
                  Hi,

                  That do not work if you have other processes



                  Regards,
                  Jari
                  • 6. Re: Set MRD_COUNT
                    vee
                    Jari, You were right about using this variable when using multiple process message.
                    However, I could still get it working if I concatenate the second process success message to the application variable, like
                    Process 1:
                    apex_application.g_print_success_message := 'Process message for process 1';
                    Process 2:
                    apex_application.g_print_success_message := apex_application.g_print_success_message||'Process message for process 2';
                    This ofcourse work if the message is set only using the above variable

                    It would have been much better if apex had a substitution variable(as workaround I can create an application item that can be used exclusively for this purpose), so one could refer it in the Process message section for further processes and hence not loose out previous messages set from PLSQL.