PLS-00103: Encountered the symbol “FOR” when expecting one of the following:











up vote
1
down vote

favorite












**hello I'm trying to do a FOR loop in oracle but it throws the following error



ORA-06550: line 6, column 1:
PLS-00103: Encountered the symbol "FOR" when expecting one of the following:
* & = - + ; < / > at in is mod remainder not rem
<> or != or ~= >= <= <> and or like like2
like4 likec between || multiset member submultiset
The symbol ";" was substituted for "FOR" to continue.**



DECLARE
PROV number;
RAN_PRICE NUMBER;

begin
prov := 1
for loop_one in 1..10
loop

FOR LOOP_two IN 1..5
LOOP

SELECT (1+ABS(MOD(dbms_random.random,1800)))into RAN_PRICE FROM dual;
INSERT INTO marcos.PRODUCTO
VALUES(SEQ_PRODUCTO.nextval, 'Producto_'||PROV,RAN_PRICE,PROV);
END LOOP ;

PROV := PROV+ 1;
end loop ;

commit;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('Se ha producido un error') ;
rollback;
end;









share|improve this question




























    up vote
    1
    down vote

    favorite












    **hello I'm trying to do a FOR loop in oracle but it throws the following error



    ORA-06550: line 6, column 1:
    PLS-00103: Encountered the symbol "FOR" when expecting one of the following:
    * & = - + ; < / > at in is mod remainder not rem
    <> or != or ~= >= <= <> and or like like2
    like4 likec between || multiset member submultiset
    The symbol ";" was substituted for "FOR" to continue.**



    DECLARE
    PROV number;
    RAN_PRICE NUMBER;

    begin
    prov := 1
    for loop_one in 1..10
    loop

    FOR LOOP_two IN 1..5
    LOOP

    SELECT (1+ABS(MOD(dbms_random.random,1800)))into RAN_PRICE FROM dual;
    INSERT INTO marcos.PRODUCTO
    VALUES(SEQ_PRODUCTO.nextval, 'Producto_'||PROV,RAN_PRICE,PROV);
    END LOOP ;

    PROV := PROV+ 1;
    end loop ;

    commit;
    EXCEPTION
    WHEN OTHERS THEN
    dbms_output.put_line('Se ha producido un error') ;
    rollback;
    end;









    share|improve this question


























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      **hello I'm trying to do a FOR loop in oracle but it throws the following error



      ORA-06550: line 6, column 1:
      PLS-00103: Encountered the symbol "FOR" when expecting one of the following:
      * & = - + ; < / > at in is mod remainder not rem
      <> or != or ~= >= <= <> and or like like2
      like4 likec between || multiset member submultiset
      The symbol ";" was substituted for "FOR" to continue.**



      DECLARE
      PROV number;
      RAN_PRICE NUMBER;

      begin
      prov := 1
      for loop_one in 1..10
      loop

      FOR LOOP_two IN 1..5
      LOOP

      SELECT (1+ABS(MOD(dbms_random.random,1800)))into RAN_PRICE FROM dual;
      INSERT INTO marcos.PRODUCTO
      VALUES(SEQ_PRODUCTO.nextval, 'Producto_'||PROV,RAN_PRICE,PROV);
      END LOOP ;

      PROV := PROV+ 1;
      end loop ;

      commit;
      EXCEPTION
      WHEN OTHERS THEN
      dbms_output.put_line('Se ha producido un error') ;
      rollback;
      end;









      share|improve this question















      **hello I'm trying to do a FOR loop in oracle but it throws the following error



      ORA-06550: line 6, column 1:
      PLS-00103: Encountered the symbol "FOR" when expecting one of the following:
      * & = - + ; < / > at in is mod remainder not rem
      <> or != or ~= >= <= <> and or like like2
      like4 likec between || multiset member submultiset
      The symbol ";" was substituted for "FOR" to continue.**



      DECLARE
      PROV number;
      RAN_PRICE NUMBER;

      begin
      prov := 1
      for loop_one in 1..10
      loop

      FOR LOOP_two IN 1..5
      LOOP

      SELECT (1+ABS(MOD(dbms_random.random,1800)))into RAN_PRICE FROM dual;
      INSERT INTO marcos.PRODUCTO
      VALUES(SEQ_PRODUCTO.nextval, 'Producto_'||PROV,RAN_PRICE,PROV);
      END LOOP ;

      PROV := PROV+ 1;
      end loop ;

      commit;
      EXCEPTION
      WHEN OTHERS THEN
      dbms_output.put_line('Se ha producido un error') ;
      rollback;
      end;






      oracle plsql oracle11g






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 11 at 8:46









      a_horse_with_no_name

      287k45432527




      287k45432527










      asked Nov 11 at 6:33









      marcos j

      152




      152
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote



          accepted










          You are missing a semi-colon (;) at the end of prov's initialization:



          prov := 1;
          -- Here -^





          share|improve this answer





















          • it was that; thanks and sorry for the stupid question
            – marcos j
            Nov 11 at 6:55













          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',
          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%2f53246419%2fpls-00103-encountered-the-symbol-for-when-expecting-one-of-the-following%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








          up vote
          0
          down vote



          accepted










          You are missing a semi-colon (;) at the end of prov's initialization:



          prov := 1;
          -- Here -^





          share|improve this answer





















          • it was that; thanks and sorry for the stupid question
            – marcos j
            Nov 11 at 6:55

















          up vote
          0
          down vote



          accepted










          You are missing a semi-colon (;) at the end of prov's initialization:



          prov := 1;
          -- Here -^





          share|improve this answer





















          • it was that; thanks and sorry for the stupid question
            – marcos j
            Nov 11 at 6:55















          up vote
          0
          down vote



          accepted







          up vote
          0
          down vote



          accepted






          You are missing a semi-colon (;) at the end of prov's initialization:



          prov := 1;
          -- Here -^





          share|improve this answer












          You are missing a semi-colon (;) at the end of prov's initialization:



          prov := 1;
          -- Here -^






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 11 at 6:36









          Mureinik

          175k21126193




          175k21126193












          • it was that; thanks and sorry for the stupid question
            – marcos j
            Nov 11 at 6:55




















          • it was that; thanks and sorry for the stupid question
            – marcos j
            Nov 11 at 6:55


















          it was that; thanks and sorry for the stupid question
          – marcos j
          Nov 11 at 6:55






          it was that; thanks and sorry for the stupid question
          – marcos j
          Nov 11 at 6:55




















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53246419%2fpls-00103-encountered-the-symbol-for-when-expecting-one-of-the-following%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

          List item for chat from Array inside array React Native

          Thiostrepton

          Caerphilly