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

  • Home
  • SEARCH
  • 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 8276545
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:24:29+00:00 2026-06-08T08:24:29+00:00

I’d like to write the data in a positional file. Only data which was

  • 0

I’d like to write the data in a positional file. Only data which was not written before in a file will be written. Obviously, there’s a column in the table to determine if the data has been written before.

In my case, say if the lenght of field is 80 but the length of data is 30 then rest of the space will be filled with spaces. For example,

----------------------------------------
|  Name    |    SSN      |  Integrated |
----------------------------------------
| Doe      |  453214     |     Y       |
| John     |  1234567890 |     N       |
| Scarlett |  123        |     N       |
----------------------------------------

The first record has been transferred/written in a previous file. Hence, it will not be transferred in the next file. The length of name is fixed 80 characters. So if a name is less than 80 characters then the rest of the space will be filled by spaces. It will look something like this. Same is true for other fields

Name           SSN         
John           1234567890
Scarlett       123

How may I do so? Thanks in advance. Iam using oracle 11g.

EDIT

Ok, I am able to write a code. However, I would like to call this code as a procedure which I can use in dbms_jobs. The problem is that I don’t know how to write a procedure.

DECLARE
    v_file UTL_FILE.file_type;
BEGIN
    v_file := UTL_FILE.fopen('DIR_VR_AD_INTEGRATION', 'HRMtoAD1_'||sysdate, 'w', 32767);

    FOR x IN (select * from (select RPAD(user_id, 7, ' ') || ' ' || RPAD(pid_company_id, 10, ' ') str from arc_hrvr.vr_ad_integration where integrated = 'N') str where rownum <= 3 order by rownum)
    LOOP
        BEGIN
            UTL_FILE.put_line(v_file, x.str);
         END;
     END LOOP;

    UTL_FILE.fflush(v_file);
    UTL_FILE.fclose(v_file);
END;
  • 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-08T08:24:30+00:00Added an answer on June 8, 2026 at 8:24 am

    This is really a different question now than what you started with, and how it’s titled. It’s good that you’ve figured out the bulk of what you need to do, but this should really have been a separate question. However that would have been rather vague, so I might as well have a go at it here instead…

    The documentation on procedure writing is fairly clear, and there are a lot of examples, such as this one which was the first hit on Google for ‘oracle create procedure’.

    At the moment you have an anonymous PL/SQL block, so you need to convert that to a stored procedure. In this case, and assuming you don’t want it to be part of a package, you just need to change the DECLARE to CREATE PROCEDURE my_procedure_name AS:

    CREATE PROCEDURE my_procedure_name AS
        v_file UTL_FILE.file_type;
    BEGIN
       ...
    END;
    /
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I would like to run a str_replace or preg_replace which looks for certain words
I am trying to render a haml file in a javascript response like so:
I want use html5's new tag to play a wav file (currently only supported
I need a function that will clean a strings' special characters. I do NOT
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I used javascript for loading a picture on my website depending on which small
link Im having trouble converting the html entites into html characters, (&# 8217;) i

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.