Fetch all names into multi row block





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















I have tables that looks like this:



tbl1
+---------+
|c_no |
+---------+
|1 |
+---------+

tbl2
+----------+---------+
|tbl1_c_no |s_name |
+----------+---------+
|1 |A |
|1 |D |
+----------+---------+


My form:



enter image description here



◘ The 1st block's base table usage is tbl1.

◘ C_NO field is auto generated using sequence. (required).

◘ S_GR is just an unbound item. (not required).

◘ The 2nd block's base table usage is tbl2 and is multiple row.

◘ S_NAME. (required)

◘ 1st block is like the parent of 2nd block.

◘ 1st and 2nd block is linked using c_no and tbl1_c_no



For example if I wanted to add some data, it's like this:



enter image description here



Then press F10 for saving:



enter image description here



tbl1 will be:
+---------+
|c_no |
+---------+
|1 |
|2 |
+---------+

tbl2 will be:
+----------+---------+
|tbl1_c_no |s_name |
+----------+---------+
|1 |A |
|1 |D |
|2 |B |
|2 |C |
|2 |E |
+----------+---------+


And my problem is that I wanted to fetch s_names from my 3rd table into 2nd block.



tbl3
+----------+---------+
|s_gr |s_name |
+----------+---------+
|80 |F |
|85 |G |
|84 |H |
|84 |I |
|80 |J |
+----------+---------+


Like this:



enter image description here



then after leaving S_GR field, it will fetch S_NAME from tbl3 that S_GR = 80 into the 2nd block



enter image description here










share|improve this question































    0















    I have tables that looks like this:



    tbl1
    +---------+
    |c_no |
    +---------+
    |1 |
    +---------+

    tbl2
    +----------+---------+
    |tbl1_c_no |s_name |
    +----------+---------+
    |1 |A |
    |1 |D |
    +----------+---------+


    My form:



    enter image description here



    ◘ The 1st block's base table usage is tbl1.

    ◘ C_NO field is auto generated using sequence. (required).

    ◘ S_GR is just an unbound item. (not required).

    ◘ The 2nd block's base table usage is tbl2 and is multiple row.

    ◘ S_NAME. (required)

    ◘ 1st block is like the parent of 2nd block.

    ◘ 1st and 2nd block is linked using c_no and tbl1_c_no



    For example if I wanted to add some data, it's like this:



    enter image description here



    Then press F10 for saving:



    enter image description here



    tbl1 will be:
    +---------+
    |c_no |
    +---------+
    |1 |
    |2 |
    +---------+

    tbl2 will be:
    +----------+---------+
    |tbl1_c_no |s_name |
    +----------+---------+
    |1 |A |
    |1 |D |
    |2 |B |
    |2 |C |
    |2 |E |
    +----------+---------+


    And my problem is that I wanted to fetch s_names from my 3rd table into 2nd block.



    tbl3
    +----------+---------+
    |s_gr |s_name |
    +----------+---------+
    |80 |F |
    |85 |G |
    |84 |H |
    |84 |I |
    |80 |J |
    +----------+---------+


    Like this:



    enter image description here



    then after leaving S_GR field, it will fetch S_NAME from tbl3 that S_GR = 80 into the 2nd block



    enter image description here










    share|improve this question



























      0












      0








      0


      0






      I have tables that looks like this:



      tbl1
      +---------+
      |c_no |
      +---------+
      |1 |
      +---------+

      tbl2
      +----------+---------+
      |tbl1_c_no |s_name |
      +----------+---------+
      |1 |A |
      |1 |D |
      +----------+---------+


      My form:



      enter image description here



      ◘ The 1st block's base table usage is tbl1.

      ◘ C_NO field is auto generated using sequence. (required).

      ◘ S_GR is just an unbound item. (not required).

      ◘ The 2nd block's base table usage is tbl2 and is multiple row.

      ◘ S_NAME. (required)

      ◘ 1st block is like the parent of 2nd block.

      ◘ 1st and 2nd block is linked using c_no and tbl1_c_no



      For example if I wanted to add some data, it's like this:



      enter image description here



      Then press F10 for saving:



      enter image description here



      tbl1 will be:
      +---------+
      |c_no |
      +---------+
      |1 |
      |2 |
      +---------+

      tbl2 will be:
      +----------+---------+
      |tbl1_c_no |s_name |
      +----------+---------+
      |1 |A |
      |1 |D |
      |2 |B |
      |2 |C |
      |2 |E |
      +----------+---------+


      And my problem is that I wanted to fetch s_names from my 3rd table into 2nd block.



      tbl3
      +----------+---------+
      |s_gr |s_name |
      +----------+---------+
      |80 |F |
      |85 |G |
      |84 |H |
      |84 |I |
      |80 |J |
      +----------+---------+


      Like this:



      enter image description here



      then after leaving S_GR field, it will fetch S_NAME from tbl3 that S_GR = 80 into the 2nd block



      enter image description here










      share|improve this question
















      I have tables that looks like this:



      tbl1
      +---------+
      |c_no |
      +---------+
      |1 |
      +---------+

      tbl2
      +----------+---------+
      |tbl1_c_no |s_name |
      +----------+---------+
      |1 |A |
      |1 |D |
      +----------+---------+


      My form:



      enter image description here



      ◘ The 1st block's base table usage is tbl1.

      ◘ C_NO field is auto generated using sequence. (required).

      ◘ S_GR is just an unbound item. (not required).

      ◘ The 2nd block's base table usage is tbl2 and is multiple row.

      ◘ S_NAME. (required)

      ◘ 1st block is like the parent of 2nd block.

      ◘ 1st and 2nd block is linked using c_no and tbl1_c_no



      For example if I wanted to add some data, it's like this:



      enter image description here



      Then press F10 for saving:



      enter image description here



      tbl1 will be:
      +---------+
      |c_no |
      +---------+
      |1 |
      |2 |
      +---------+

      tbl2 will be:
      +----------+---------+
      |tbl1_c_no |s_name |
      +----------+---------+
      |1 |A |
      |1 |D |
      |2 |B |
      |2 |C |
      |2 |E |
      +----------+---------+


      And my problem is that I wanted to fetch s_names from my 3rd table into 2nd block.



      tbl3
      +----------+---------+
      |s_gr |s_name |
      +----------+---------+
      |80 |F |
      |85 |G |
      |84 |H |
      |84 |I |
      |80 |J |
      +----------+---------+


      Like this:



      enter image description here



      then after leaving S_GR field, it will fetch S_NAME from tbl3 that S_GR = 80 into the 2nd block



      enter image description here







      oracle oracleforms






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 7 at 7:27







      Miracle

















      asked Jan 3 at 8:25









      MiracleMiracle

      236123




      236123
























          1 Answer
          1






          active

          oldest

          votes


















          2





          +50









          You can create two blocks :




          • for the 1st one, to have a block with no base table, create manually just by touching Data Blocks node
            with mouse's cursor and then toggling the create icon (a green plus
            sign
            ) and type a name blk_no. And add a field s_no on the canvas.



          • for the 2nd one use Data Block Wizard and choose Table or View type
            for the type of the block. There select the table(tbl1)'s both columns
            (s_no and name) as Database Items.



            And then, the forms must invoke
            Layout Wizard automatically as default, where choose only name column
            as displayed and leave s_no hidden as to be . Name the block as blk_names. This is a base-table block, and Data Source Name of the block blk_names is the table tbl1.



            By the way, set Number of Records Displayed property to 10 as an example, and convert the name of the field name to snames as in your question.



            Set block's WHERE Clause (in Database node) as s_no = :blk_no.s_no at the Property Palette. After
            all, create a KEY-NEXT-ITEM trigger on s_no field with the inline
            code :



            go_block('blk_names');
            execute_query;



          At the runtime you can enter an integer value( let's give 1 as an example ) for s_no and populate the names field by pressing enter key ( the records with A and D will appear )



          A button might be added with WHEN-BUTTON-PRESSED trigger having the code :



           go_block('blk_names');
          delete tbl2;
          first_record;
          while :blk_names.s_no is not null
          loop
          insert into tbl2 values(:snames);
          next_record;
          end loop;
          commit;


          to populate and re-populate the table tbl2( in this case tbl2 is populated with the records A and D ).



          P.S. To suppress the message




          FRM-40352: Last Record of Query retrieved




          add an ON-MESSAGE trigger at the forms level wtih the code :



          if message_code = 40352 then 
          null;
          end if;





          share|improve this answer


























          • I am very sorry sir. I forgot to mention something important in my question yesterday. I already edited it. Thanks.

            – Miracle
            Jan 4 at 0:39











          • @Miracle not important dear friend. I edited.

            – Barbaros Özhan
            Jan 4 at 5:22






          • 1





            @Miracle no, not problem. Consider applying the new answer.

            – Barbaros Özhan
            Jan 7 at 5:20






          • 1





            @Miracle no :) but I need to work harder for this daunting job.

            – Barbaros Özhan
            Jan 7 at 15:30








          • 1





            @Miracle you're very welcome dear friend.

            – Barbaros Özhan
            Jan 8 at 7:30












          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54018655%2ffetch-all-names-into-multi-row-block%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          2





          +50









          You can create two blocks :




          • for the 1st one, to have a block with no base table, create manually just by touching Data Blocks node
            with mouse's cursor and then toggling the create icon (a green plus
            sign
            ) and type a name blk_no. And add a field s_no on the canvas.



          • for the 2nd one use Data Block Wizard and choose Table or View type
            for the type of the block. There select the table(tbl1)'s both columns
            (s_no and name) as Database Items.



            And then, the forms must invoke
            Layout Wizard automatically as default, where choose only name column
            as displayed and leave s_no hidden as to be . Name the block as blk_names. This is a base-table block, and Data Source Name of the block blk_names is the table tbl1.



            By the way, set Number of Records Displayed property to 10 as an example, and convert the name of the field name to snames as in your question.



            Set block's WHERE Clause (in Database node) as s_no = :blk_no.s_no at the Property Palette. After
            all, create a KEY-NEXT-ITEM trigger on s_no field with the inline
            code :



            go_block('blk_names');
            execute_query;



          At the runtime you can enter an integer value( let's give 1 as an example ) for s_no and populate the names field by pressing enter key ( the records with A and D will appear )



          A button might be added with WHEN-BUTTON-PRESSED trigger having the code :



           go_block('blk_names');
          delete tbl2;
          first_record;
          while :blk_names.s_no is not null
          loop
          insert into tbl2 values(:snames);
          next_record;
          end loop;
          commit;


          to populate and re-populate the table tbl2( in this case tbl2 is populated with the records A and D ).



          P.S. To suppress the message




          FRM-40352: Last Record of Query retrieved




          add an ON-MESSAGE trigger at the forms level wtih the code :



          if message_code = 40352 then 
          null;
          end if;





          share|improve this answer


























          • I am very sorry sir. I forgot to mention something important in my question yesterday. I already edited it. Thanks.

            – Miracle
            Jan 4 at 0:39











          • @Miracle not important dear friend. I edited.

            – Barbaros Özhan
            Jan 4 at 5:22






          • 1





            @Miracle no, not problem. Consider applying the new answer.

            – Barbaros Özhan
            Jan 7 at 5:20






          • 1





            @Miracle no :) but I need to work harder for this daunting job.

            – Barbaros Özhan
            Jan 7 at 15:30








          • 1





            @Miracle you're very welcome dear friend.

            – Barbaros Özhan
            Jan 8 at 7:30
















          2





          +50









          You can create two blocks :




          • for the 1st one, to have a block with no base table, create manually just by touching Data Blocks node
            with mouse's cursor and then toggling the create icon (a green plus
            sign
            ) and type a name blk_no. And add a field s_no on the canvas.



          • for the 2nd one use Data Block Wizard and choose Table or View type
            for the type of the block. There select the table(tbl1)'s both columns
            (s_no and name) as Database Items.



            And then, the forms must invoke
            Layout Wizard automatically as default, where choose only name column
            as displayed and leave s_no hidden as to be . Name the block as blk_names. This is a base-table block, and Data Source Name of the block blk_names is the table tbl1.



            By the way, set Number of Records Displayed property to 10 as an example, and convert the name of the field name to snames as in your question.



            Set block's WHERE Clause (in Database node) as s_no = :blk_no.s_no at the Property Palette. After
            all, create a KEY-NEXT-ITEM trigger on s_no field with the inline
            code :



            go_block('blk_names');
            execute_query;



          At the runtime you can enter an integer value( let's give 1 as an example ) for s_no and populate the names field by pressing enter key ( the records with A and D will appear )



          A button might be added with WHEN-BUTTON-PRESSED trigger having the code :



           go_block('blk_names');
          delete tbl2;
          first_record;
          while :blk_names.s_no is not null
          loop
          insert into tbl2 values(:snames);
          next_record;
          end loop;
          commit;


          to populate and re-populate the table tbl2( in this case tbl2 is populated with the records A and D ).



          P.S. To suppress the message




          FRM-40352: Last Record of Query retrieved




          add an ON-MESSAGE trigger at the forms level wtih the code :



          if message_code = 40352 then 
          null;
          end if;





          share|improve this answer


























          • I am very sorry sir. I forgot to mention something important in my question yesterday. I already edited it. Thanks.

            – Miracle
            Jan 4 at 0:39











          • @Miracle not important dear friend. I edited.

            – Barbaros Özhan
            Jan 4 at 5:22






          • 1





            @Miracle no, not problem. Consider applying the new answer.

            – Barbaros Özhan
            Jan 7 at 5:20






          • 1





            @Miracle no :) but I need to work harder for this daunting job.

            – Barbaros Özhan
            Jan 7 at 15:30








          • 1





            @Miracle you're very welcome dear friend.

            – Barbaros Özhan
            Jan 8 at 7:30














          2





          +50







          2





          +50



          2




          +50





          You can create two blocks :




          • for the 1st one, to have a block with no base table, create manually just by touching Data Blocks node
            with mouse's cursor and then toggling the create icon (a green plus
            sign
            ) and type a name blk_no. And add a field s_no on the canvas.



          • for the 2nd one use Data Block Wizard and choose Table or View type
            for the type of the block. There select the table(tbl1)'s both columns
            (s_no and name) as Database Items.



            And then, the forms must invoke
            Layout Wizard automatically as default, where choose only name column
            as displayed and leave s_no hidden as to be . Name the block as blk_names. This is a base-table block, and Data Source Name of the block blk_names is the table tbl1.



            By the way, set Number of Records Displayed property to 10 as an example, and convert the name of the field name to snames as in your question.



            Set block's WHERE Clause (in Database node) as s_no = :blk_no.s_no at the Property Palette. After
            all, create a KEY-NEXT-ITEM trigger on s_no field with the inline
            code :



            go_block('blk_names');
            execute_query;



          At the runtime you can enter an integer value( let's give 1 as an example ) for s_no and populate the names field by pressing enter key ( the records with A and D will appear )



          A button might be added with WHEN-BUTTON-PRESSED trigger having the code :



           go_block('blk_names');
          delete tbl2;
          first_record;
          while :blk_names.s_no is not null
          loop
          insert into tbl2 values(:snames);
          next_record;
          end loop;
          commit;


          to populate and re-populate the table tbl2( in this case tbl2 is populated with the records A and D ).



          P.S. To suppress the message




          FRM-40352: Last Record of Query retrieved




          add an ON-MESSAGE trigger at the forms level wtih the code :



          if message_code = 40352 then 
          null;
          end if;





          share|improve this answer















          You can create two blocks :




          • for the 1st one, to have a block with no base table, create manually just by touching Data Blocks node
            with mouse's cursor and then toggling the create icon (a green plus
            sign
            ) and type a name blk_no. And add a field s_no on the canvas.



          • for the 2nd one use Data Block Wizard and choose Table or View type
            for the type of the block. There select the table(tbl1)'s both columns
            (s_no and name) as Database Items.



            And then, the forms must invoke
            Layout Wizard automatically as default, where choose only name column
            as displayed and leave s_no hidden as to be . Name the block as blk_names. This is a base-table block, and Data Source Name of the block blk_names is the table tbl1.



            By the way, set Number of Records Displayed property to 10 as an example, and convert the name of the field name to snames as in your question.



            Set block's WHERE Clause (in Database node) as s_no = :blk_no.s_no at the Property Palette. After
            all, create a KEY-NEXT-ITEM trigger on s_no field with the inline
            code :



            go_block('blk_names');
            execute_query;



          At the runtime you can enter an integer value( let's give 1 as an example ) for s_no and populate the names field by pressing enter key ( the records with A and D will appear )



          A button might be added with WHEN-BUTTON-PRESSED trigger having the code :



           go_block('blk_names');
          delete tbl2;
          first_record;
          while :blk_names.s_no is not null
          loop
          insert into tbl2 values(:snames);
          next_record;
          end loop;
          commit;


          to populate and re-populate the table tbl2( in this case tbl2 is populated with the records A and D ).



          P.S. To suppress the message




          FRM-40352: Last Record of Query retrieved




          add an ON-MESSAGE trigger at the forms level wtih the code :



          if message_code = 40352 then 
          null;
          end if;






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jan 7 at 5:32

























          answered Jan 3 at 11:03









          Barbaros ÖzhanBarbaros Özhan

          14.9k71634




          14.9k71634













          • I am very sorry sir. I forgot to mention something important in my question yesterday. I already edited it. Thanks.

            – Miracle
            Jan 4 at 0:39











          • @Miracle not important dear friend. I edited.

            – Barbaros Özhan
            Jan 4 at 5:22






          • 1





            @Miracle no, not problem. Consider applying the new answer.

            – Barbaros Özhan
            Jan 7 at 5:20






          • 1





            @Miracle no :) but I need to work harder for this daunting job.

            – Barbaros Özhan
            Jan 7 at 15:30








          • 1





            @Miracle you're very welcome dear friend.

            – Barbaros Özhan
            Jan 8 at 7:30



















          • I am very sorry sir. I forgot to mention something important in my question yesterday. I already edited it. Thanks.

            – Miracle
            Jan 4 at 0:39











          • @Miracle not important dear friend. I edited.

            – Barbaros Özhan
            Jan 4 at 5:22






          • 1





            @Miracle no, not problem. Consider applying the new answer.

            – Barbaros Özhan
            Jan 7 at 5:20






          • 1





            @Miracle no :) but I need to work harder for this daunting job.

            – Barbaros Özhan
            Jan 7 at 15:30








          • 1





            @Miracle you're very welcome dear friend.

            – Barbaros Özhan
            Jan 8 at 7:30

















          I am very sorry sir. I forgot to mention something important in my question yesterday. I already edited it. Thanks.

          – Miracle
          Jan 4 at 0:39





          I am very sorry sir. I forgot to mention something important in my question yesterday. I already edited it. Thanks.

          – Miracle
          Jan 4 at 0:39













          @Miracle not important dear friend. I edited.

          – Barbaros Özhan
          Jan 4 at 5:22





          @Miracle not important dear friend. I edited.

          – Barbaros Özhan
          Jan 4 at 5:22




          1




          1





          @Miracle no, not problem. Consider applying the new answer.

          – Barbaros Özhan
          Jan 7 at 5:20





          @Miracle no, not problem. Consider applying the new answer.

          – Barbaros Özhan
          Jan 7 at 5:20




          1




          1





          @Miracle no :) but I need to work harder for this daunting job.

          – Barbaros Özhan
          Jan 7 at 15:30







          @Miracle no :) but I need to work harder for this daunting job.

          – Barbaros Özhan
          Jan 7 at 15:30






          1




          1





          @Miracle you're very welcome dear friend.

          – Barbaros Özhan
          Jan 8 at 7:30





          @Miracle you're very welcome dear friend.

          – Barbaros Özhan
          Jan 8 at 7:30




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54018655%2ffetch-all-names-into-multi-row-block%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          MongoDB - Not Authorized To Execute Command

          How to fix TextFormField cause rebuild widget in Flutter

          Npm cannot find a required file even through it is in the searched directory