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 8009507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:28:15+00:00 2026-06-04T18:28:15+00:00

I had written program which copy data into txt file program is given below

  • 0

I had written program which copy data into txt file program is given below

declare
empsfile utl_file.file_type;
cursor empscur is
select * from newemp;
begin
empsfile := utl_file.fopen('DIPRJDIR','EMPS.TXT','W');
for rec in empscur
loop
utl_file.put_line(empsfile,rec.EMPNO||rec.ENAME||rec.JOB||rec.MGR||rec.HIREDATE||rec.SAL||rec.COMM||rec.DEPTNO);
end loop;
UTL_FILE.FCLOSE(empsfile );
EXCEPTION
 WHEN OTHERS THEN
   DBMS_OUTPUT.PUT_LINE( 'ERROR -->' ||  SQLERRM);
END;
/

output of the above progarm is

7839KING      PRESIDENT017-NOV-815000010
7698BLAKE     MANAGER  783901-MAY-812850.5.530
7782CLARK     MANAGER  783909-JUN-812450010
7566JONES     MANAGER  783902-APR-812975020
7654MARTIN    SALESMAN 769828-SEP-811250140030
7499ALLEN     SALESMAN 769820-FEB-81160030030
7844TURNER    SALESMAN 769808-SEP-811500030
7900JAMES     CLERK    769803-DEC-81950030
7521WARD      SALESMAN 769822-FEB-81125050030
7902FORD      ANALYST  756603-DEC-813000020
7369SMITH     CLERK    790217-DEC-80800020
7788SCOTT     ANALYST  756609-DEC-823000020
7876ADAMS     CLERK    778812-JAN-831100020
7934MILLER    CLERK    778223-JAN-821300010

Now my problem is I want display space according to data type of above field for example suppose ENAME VARCHAR2(10) than if name in data is 6 field than i have to display 4 blank space please help me in this .

  • 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-04T18:28:17+00:00Added an answer on June 4, 2026 at 6:28 pm

    Can LPAD function help you?

    utl_file.put_line(empsfile,rec.EMPNO||LPAD(rec.ENAME,10,' ')||rec.JOB||rec.MGR||rec.HIREDATE||rec.SAL||rec.COMM||rec.DEPTNO);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've written a program in Haskell which had to load and parse big text
I am trying to write a program in PHP which I had already written
I had written a program in Python 3, but now want to convert it
I had written a small utility app just for my phone, which stopped the
For example, suppose I had written my own class which allowed me to record
I had the following idea: Say we have a webapp written using django which
My code base initially was written in ruby. It had a rakefile.rb file to
EDIT I had a problem a while ago writing a program in C which
I have written a program which will serialize and de-serialize, it does this fine
I have written a C++ program that reads in a file and outputs the

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.