Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8705223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:18:27+00:00 2026-06-13T03:18:27+00:00

Try to output some results into windows folder c:\temp. Compile and run my procedure

  • 0

Try to output some results into windows folder “c:\temp”. Compile and run my procedure without any issue, but I cannot find my output file “c:\temp\foo.log”. Here is my code:

    CREATE OR REPLACE  DIRECTORY tmp AS 'c:\temp\';


    CREATE OR REPLACE PROCEDURE write_log
    AS
       CURSOR cur
       IS
          SELECT firstname,
                 lastname
          FROM   MEMBER
          WHERE  memberid BETWEEN 2 AND 5; -- only test 3 rows.

       fname MEMBER.firstname%TYPE;
       lname MEMBER.lastname%TYPE;
       outputrecord VARCHAR2 ( 255 );
       outputfile UTL_FILE.file_type;
    BEGIN
       OPEN cur;

       FETCH cur
       INTO  fname,
             lname;

       outputfile := UTL_FILE.fopen ( UPPER ( 'tmp' ),
                                      'foo.log',
                                      'W',
                                      32767
                                    );

       WHILE cur%FOUND
       LOOP
          outputrecord := fname || ',' || lname;
          UTL_FILE.put ( outputfile, outputrecord );
          UTL_FILE.new_line ( outputfile );

          FETCH cur
          INTO  fname,
                lname;
       END LOOP;

       CLOSE cur;

       UTL_FILE.fclose ( outputfile );
    END write_log;
    /

    BEGIN
       write_log;
    END;
    /

Did I do something wrong here?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T03:18:28+00:00Added an answer on June 13, 2026 at 3:18 am

    UTL_FILE manipulates files on the database server, not on your client machine. You can only read and write files on the database server. Assuming that this code runs successfully, it would create a file on the database server named c:\temp\foo.log.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've installed gtk2hs-buildtools with no problem, but here's the output when I try to
I am developing a content management system and I have run into an issue
I want to be able to get some output from mysql stored procedure within
I have run into this issue where I needed a piece of simple medical
I try to output my .php files from the command line and I want
I have a variabla var. If I try to output its value in HAML
hello guys i am try to print the output of two element data simultaneously
I need to read the output from ffmpeg in order to even try the
Is it possbile to clear erlang shell current output for next time's try and
Im wondering if there is some means of just plopping a prepaired statement into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.