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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T03:54:45+00:00 2026-06-02T03:54:45+00:00

I need to make my output readable. I have succeeded in doing so, for

  • 0

I need to make my output readable. I have succeeded in doing so, for queries that I write directly.

  1. I need to do the same for queries that involve a cursor, i.e. to be specific, I need the records returned by a cursor to be formatted as well. But I am unable to do.

  2. I instead explicitly print the column names, and the print the records. Still, the same. Is there any way, I could retrieve the headers as well, and then based on their length, format the received records as well?

  • 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-02T03:54:50+00:00Added an answer on June 2, 2026 at 3:54 am

    If I understand you correctly, what you need is Dynamic Parsing and lpad-rpad functions.

    With DBMS_SQL package, you can parse a SQL statement dynamically. I threw the code block below at the top of my head so there might be syntax errors, but it should give you the idea.

    declare
      ln_cur number;
      ln_colCnt number;
      l_sqlDesc DBMS_SQL.DESC_TAB;
    begin
      ln_cur := DBMS_SQL.open_cursor;
      DBMS_SQL.parse(ln_cur, 'select * from dual', DBMS_SQL.NATIVE);
    
      DBMS_SQL.describe_columns(ln_cur, ln_colCnt, l_sqlDesc);
      DBMS_OUTPUT.put_line(l_sqlDesc(1).col_name); --First Column Name.
    
      DBMS_SQL.close_cursor(ln_cur);
    end;
    

    You also need to check the lpad-rpad functions if you want to format your output. Try this and see for yourself:

    begin
        DBMS_OUTPUT.put_line(lpad(20, "Ford"));
        DBMS_OUTPUT.put_line(lpad(20, "Prefect"));
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two textures: background and mask. I need to make output that mask
I need to make an Access query output records that were only from last
I'm trying to write a program that modifies fractions and I need to make
I need to make an array in php that will output an html table
I have a crystal report file I need make a tiny edit in. It
I need to make a poker game for school in c++. I have made
I need to make an ArrayList of ArrayLists thread safe. I also cannot have
I need to make sure that user can run only one instance of my
For my project, I need to make a program that takes 10 numbers as
I need to make a script that automates the following: Read comma or tab

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.