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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:15:23+00:00 2026-05-26T05:15:23+00:00

I am trying to send output of an query through mail. I am using

  • 0

I am trying to send output of an query through mail. I am using following command.

FOR i IN emp_cur LOOP
   e_fullname := i.full_name;
   UTL_SMTP.WRITE_DATA(v_connection_handle,
                        e_fullname || ' - ' || i.ID ||' - ' || i.location_city ||' - ' || i.job ||' - ' || i.supervisor_name || UTL_TCP.CRLF|| UTL_TCP.CRLF);

  END LOOP;

Output looks like this:

Pandyan - 12312 - Williamsburg - Developer - Pieterson

Bowaris - 98615 - Ohio - Spec - Pieterson

Perry, Steven W (Steve) - 11111 - Ohio - Analyst - Pieterson

Praveerarajan - 44444 - Williamsburg - Engineer - Pieterson

Now, how can I make my output look good(streamlined). So that all emp names have right spacing and IDs are displayed one below the other in a straight line, and the same for the other columns.

Thanks
venkat

  • 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-05-26T05:15:24+00:00Added an answer on May 26, 2026 at 5:15 am

    Use the RPAD and LPAD functions to make the columns take up the same amount of space, regardless of the length of the content. Use RPAD to align strings on the left-hand side, and LPAD to align numbers on the right.

    Eg.

    rpad(e_fullname, 15) || ' - ' || lpad( i.ID, 10) ||' - ' || rpad(i.location_city, 30) ||' - ' || rpad(i.job,10) ||' - ' || rpad(i.supervisor_name,15) || UTL_TCP.CRLF|| UTL_TCP.CRLF);
    

    The default padding character is space, which is probably what you want in this case.

    Of course, this is only going to make things line up nicely in a fixed size font (like Courier New). If your email is going to use some easy reading font like Arial you’ve got problems.

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

Sidebar

Related Questions

I`m trying to send e-mail via c# and use the following code: public static
I am trying to send the output from the find command to OpenSSL in
On Windows 7, I am trying to send the output of a maven-3 command
I am trying to send mail using below snippet with the zip file as
I am trying to send some very large files (>200MB) through an Http output
Im trying to send a command through telnet to my computer which then sends
am trying send an array to php file using $_POST ,still always getting an
I am trying to send emails from smtps (secure smtp) using Indy and the
I have a php file that I am trying to send the output in
I am trying to send audio file from one computer to other using socket

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.