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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T03:05:06+00:00 2026-05-18T03:05:06+00:00

I have a report that I need to export to a csv file for

  • 0

I have a report that I need to export to a csv file for n number of vendors. i have a feeling that I will need to run this more than once so I would like to automate it as much as possible. I wrote the sql plus needed to for one vendor, I’m wonder how can script it to run for each vendor. I have the vendor list stored in the table in the db, but knowing I can’t put spool in an pl/sql block, I’m wonder how I can loop through each vendor to create their file.

  • 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-18T03:05:07+00:00Added an answer on May 18, 2026 at 3:05 am

    I’ve done similar things by having one script generate a secondary script and then execute that script. Approximate example:

    set serveroutput on
    set termout off
    spool temp_script.sql
    Begin
        for r in (select * from vendors) loop
            dbms_output.put_line('spool '||r.vendor_name||'.csv');
            dbms_output.put_line('data is: '||r.data);
            /*feel free to put other output commands here */
            dbms_output.put_line('spool off');
        end loop;
    end;
    spool off
    @temp_script.sql
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a number of reports that need to be both run separately and
I have a number of reports that I run against my database that need
I have a script that will generate a CSV file. The purpose of the
I have a complicated report that I need to draw with GDI+ (I don't
I have a report web page that allows you to export records shown to
I have a report that need null values replaced with N/A. It works for
I have a report viewer that I am using to export to PDF and
I have a report that uses a Multi Value parameter. I have added this
We have a crystal report that we need to send out as an e-mail,
i have a crystal report that returns the records i need based on criteria

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.