6 Replies Latest reply: Nov 16, 2012 3:49 AM by 967419 RSS

    DML on multiple tables in one Page

    JP Rao
      Hi,
      Requirement is there are 6 tables.
      Depends on the input parameter we need to perform DML operations on the tables.
      Is there any way to build VO(Based on EO) dynamically linked to a table and performs DML.

      If this is possible we pass table name as parameter, and perform DML on that Table.

      Thanks
      JP
        • 1. Re: DML on multiple tables in one Page
          keerthioaf
          Hi JP,

          While creating Entity Object EO, it will allow you to select only one data base object ( table ) at design time .
          How ever you can insert record into different tables using Prepared statement .

          Please Let us know clearly what exactly your requirement is ?

          Keerthi
          • 2. Re: DML on multiple tables in one Page
            JP Rao
            Hi Keerthi,

            Requirement is we are having 6 different tables.
            Lets suppose
            User have choices like update/delete/Insert on selected table among 6 tables.
            Depending on this user choice, we need to perform DML on the selected table.

            This is possible with single EO?

            as per your suggestion, we use the prepared statement.

            Thanks
            JP
            • 3. Re: DML on multiple tables in one Page
              Sushant Sharma
              Hi,

              You can create a PL/SQL procedure for performing DML operating and your logic inside that.
              Later you can use CallableStatement to execute that procedure.

              --Sushant                                                                                                                                                                                                                                                                                                                                                           
              • 4. Re: DML on multiple tables in one Page
                keerthioaf
                Hi JP ,

                It is not possible with a single EO , how ever from controller class you can call a Database procedure that performs
                DML operation for 6 different table .

                As shushant said you can make use of CallableStatement .

                Keerthi