Remove text file using Oracle Forms












2















I tried to remove text file in Oracle Forms 6i (DB 9i) using TEXT_IO Package (TEXT_IO.FREMOVE('C:out_file.txt')).



But I encountered this error:




FREMOVE MUST BE DECLARED!




How can I fix this problem.



My Code:



DECLARE
outf TEXT_IO.file_type;
...
BEGIN
outf := TEXT_IO.FOpen('C:out_file.txt', 'w');
...
IF condition THEN
RAISE remove_file;

EXCEPTION
WHEN remove_file THEN
TEXT_IO.FCLOSE('C:/out_file.txt');
TEXT_IO.FREMOVE('C:/out_file.txt');
END;









share|improve this question





























    2















    I tried to remove text file in Oracle Forms 6i (DB 9i) using TEXT_IO Package (TEXT_IO.FREMOVE('C:out_file.txt')).



    But I encountered this error:




    FREMOVE MUST BE DECLARED!




    How can I fix this problem.



    My Code:



    DECLARE
    outf TEXT_IO.file_type;
    ...
    BEGIN
    outf := TEXT_IO.FOpen('C:out_file.txt', 'w');
    ...
    IF condition THEN
    RAISE remove_file;

    EXCEPTION
    WHEN remove_file THEN
    TEXT_IO.FCLOSE('C:/out_file.txt');
    TEXT_IO.FREMOVE('C:/out_file.txt');
    END;









    share|improve this question



























      2












      2








      2








      I tried to remove text file in Oracle Forms 6i (DB 9i) using TEXT_IO Package (TEXT_IO.FREMOVE('C:out_file.txt')).



      But I encountered this error:




      FREMOVE MUST BE DECLARED!




      How can I fix this problem.



      My Code:



      DECLARE
      outf TEXT_IO.file_type;
      ...
      BEGIN
      outf := TEXT_IO.FOpen('C:out_file.txt', 'w');
      ...
      IF condition THEN
      RAISE remove_file;

      EXCEPTION
      WHEN remove_file THEN
      TEXT_IO.FCLOSE('C:/out_file.txt');
      TEXT_IO.FREMOVE('C:/out_file.txt');
      END;









      share|improve this question
















      I tried to remove text file in Oracle Forms 6i (DB 9i) using TEXT_IO Package (TEXT_IO.FREMOVE('C:out_file.txt')).



      But I encountered this error:




      FREMOVE MUST BE DECLARED!




      How can I fix this problem.



      My Code:



      DECLARE
      outf TEXT_IO.file_type;
      ...
      BEGIN
      outf := TEXT_IO.FOpen('C:out_file.txt', 'w');
      ...
      IF condition THEN
      RAISE remove_file;

      EXCEPTION
      WHEN remove_file THEN
      TEXT_IO.FCLOSE('C:/out_file.txt');
      TEXT_IO.FREMOVE('C:/out_file.txt');
      END;






      file oracleforms oracle9i






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Sep 1 '16 at 4:53









      Huy Nguyen

      1,42231422




      1,42231422










      asked Aug 31 '16 at 23:04









      GoldrayGoldray

      289




      289
























          2 Answers
          2






          active

          oldest

          votes


















          1














          There is no function Text_IO.FREMOVE in Oracle Forms 6i. Use d2kwutil.pll and Win_Api_Utility.Delete_File or use operating system command using HOST built in:



          HOST('del c:out_file.txt');





          share|improve this answer
























          • Host sentence does not work. I mean: it's executed but with no effect and no error. So the only way to get the file deleted is using win_api_utility or deleting it outside the form.

            – EAmez
            Nov 20 '18 at 10:54



















          0














          I had the same problem: needed to delete a file I was using only to create a directory if directory didn't exist previously. TEXT_IO doesn't have any option, and I didn't want to add d2kwutil to my form. I ended up with this:



          DECLARE
          v_texto varchar2(3200);
          v_templatePath varchar2(256); v_testFile varchar2(256); v_reportFile varchar2(256);
          BEGIN
          --First part: copy file to dest directory. If directory does not exist, xcopy creates it
          v_templatePath := '\serverreportstemplates';
          v_testFile := 'test.txt';
          v_reportFile := '\serverreports<folder_with_date>test.txt';
          v_texto := 'XCOPY '||v_templatePath||v_testFile||' '||v_reportFile || '* /Y';
          message(v_texto); --so you can see what is going to be executed
          HOST(v_texto, NO_SCREEN);

          --Second part: delete dummy file
          v_texto := 'cmd /C DEL '||v_reportFile;
          message(v_texto);
          host (v_texto);
          EXIT_FORM(NO_VALIDATE);
          END;





          share|improve this answer

























            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%2f39260340%2fremove-text-file-using-oracle-forms%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            There is no function Text_IO.FREMOVE in Oracle Forms 6i. Use d2kwutil.pll and Win_Api_Utility.Delete_File or use operating system command using HOST built in:



            HOST('del c:out_file.txt');





            share|improve this answer
























            • Host sentence does not work. I mean: it's executed but with no effect and no error. So the only way to get the file deleted is using win_api_utility or deleting it outside the form.

              – EAmez
              Nov 20 '18 at 10:54
















            1














            There is no function Text_IO.FREMOVE in Oracle Forms 6i. Use d2kwutil.pll and Win_Api_Utility.Delete_File or use operating system command using HOST built in:



            HOST('del c:out_file.txt');





            share|improve this answer
























            • Host sentence does not work. I mean: it's executed but with no effect and no error. So the only way to get the file deleted is using win_api_utility or deleting it outside the form.

              – EAmez
              Nov 20 '18 at 10:54














            1












            1








            1







            There is no function Text_IO.FREMOVE in Oracle Forms 6i. Use d2kwutil.pll and Win_Api_Utility.Delete_File or use operating system command using HOST built in:



            HOST('del c:out_file.txt');





            share|improve this answer













            There is no function Text_IO.FREMOVE in Oracle Forms 6i. Use d2kwutil.pll and Win_Api_Utility.Delete_File or use operating system command using HOST built in:



            HOST('del c:out_file.txt');






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Sep 1 '16 at 9:21









            Petr PribylPetr Pribyl

            2,8921521




            2,8921521













            • Host sentence does not work. I mean: it's executed but with no effect and no error. So the only way to get the file deleted is using win_api_utility or deleting it outside the form.

              – EAmez
              Nov 20 '18 at 10:54



















            • Host sentence does not work. I mean: it's executed but with no effect and no error. So the only way to get the file deleted is using win_api_utility or deleting it outside the form.

              – EAmez
              Nov 20 '18 at 10:54

















            Host sentence does not work. I mean: it's executed but with no effect and no error. So the only way to get the file deleted is using win_api_utility or deleting it outside the form.

            – EAmez
            Nov 20 '18 at 10:54





            Host sentence does not work. I mean: it's executed but with no effect and no error. So the only way to get the file deleted is using win_api_utility or deleting it outside the form.

            – EAmez
            Nov 20 '18 at 10:54













            0














            I had the same problem: needed to delete a file I was using only to create a directory if directory didn't exist previously. TEXT_IO doesn't have any option, and I didn't want to add d2kwutil to my form. I ended up with this:



            DECLARE
            v_texto varchar2(3200);
            v_templatePath varchar2(256); v_testFile varchar2(256); v_reportFile varchar2(256);
            BEGIN
            --First part: copy file to dest directory. If directory does not exist, xcopy creates it
            v_templatePath := '\serverreportstemplates';
            v_testFile := 'test.txt';
            v_reportFile := '\serverreports<folder_with_date>test.txt';
            v_texto := 'XCOPY '||v_templatePath||v_testFile||' '||v_reportFile || '* /Y';
            message(v_texto); --so you can see what is going to be executed
            HOST(v_texto, NO_SCREEN);

            --Second part: delete dummy file
            v_texto := 'cmd /C DEL '||v_reportFile;
            message(v_texto);
            host (v_texto);
            EXIT_FORM(NO_VALIDATE);
            END;





            share|improve this answer






























              0














              I had the same problem: needed to delete a file I was using only to create a directory if directory didn't exist previously. TEXT_IO doesn't have any option, and I didn't want to add d2kwutil to my form. I ended up with this:



              DECLARE
              v_texto varchar2(3200);
              v_templatePath varchar2(256); v_testFile varchar2(256); v_reportFile varchar2(256);
              BEGIN
              --First part: copy file to dest directory. If directory does not exist, xcopy creates it
              v_templatePath := '\serverreportstemplates';
              v_testFile := 'test.txt';
              v_reportFile := '\serverreports<folder_with_date>test.txt';
              v_texto := 'XCOPY '||v_templatePath||v_testFile||' '||v_reportFile || '* /Y';
              message(v_texto); --so you can see what is going to be executed
              HOST(v_texto, NO_SCREEN);

              --Second part: delete dummy file
              v_texto := 'cmd /C DEL '||v_reportFile;
              message(v_texto);
              host (v_texto);
              EXIT_FORM(NO_VALIDATE);
              END;





              share|improve this answer




























                0












                0








                0







                I had the same problem: needed to delete a file I was using only to create a directory if directory didn't exist previously. TEXT_IO doesn't have any option, and I didn't want to add d2kwutil to my form. I ended up with this:



                DECLARE
                v_texto varchar2(3200);
                v_templatePath varchar2(256); v_testFile varchar2(256); v_reportFile varchar2(256);
                BEGIN
                --First part: copy file to dest directory. If directory does not exist, xcopy creates it
                v_templatePath := '\serverreportstemplates';
                v_testFile := 'test.txt';
                v_reportFile := '\serverreports<folder_with_date>test.txt';
                v_texto := 'XCOPY '||v_templatePath||v_testFile||' '||v_reportFile || '* /Y';
                message(v_texto); --so you can see what is going to be executed
                HOST(v_texto, NO_SCREEN);

                --Second part: delete dummy file
                v_texto := 'cmd /C DEL '||v_reportFile;
                message(v_texto);
                host (v_texto);
                EXIT_FORM(NO_VALIDATE);
                END;





                share|improve this answer















                I had the same problem: needed to delete a file I was using only to create a directory if directory didn't exist previously. TEXT_IO doesn't have any option, and I didn't want to add d2kwutil to my form. I ended up with this:



                DECLARE
                v_texto varchar2(3200);
                v_templatePath varchar2(256); v_testFile varchar2(256); v_reportFile varchar2(256);
                BEGIN
                --First part: copy file to dest directory. If directory does not exist, xcopy creates it
                v_templatePath := '\serverreportstemplates';
                v_testFile := 'test.txt';
                v_reportFile := '\serverreports<folder_with_date>test.txt';
                v_texto := 'XCOPY '||v_templatePath||v_testFile||' '||v_reportFile || '* /Y';
                message(v_texto); --so you can see what is going to be executed
                HOST(v_texto, NO_SCREEN);

                --Second part: delete dummy file
                v_texto := 'cmd /C DEL '||v_reportFile;
                message(v_texto);
                host (v_texto);
                EXIT_FORM(NO_VALIDATE);
                END;






                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Nov 21 '18 at 7:55

























                answered Nov 20 '18 at 11:48









                EAmezEAmez

                521516




                521516






























                    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%2f39260340%2fremove-text-file-using-oracle-forms%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

                    Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

                    ComboBox Display Member on multiple fields

                    Is it possible to collect Nectar points via Trainline?