-1

I am using oracle 11g with plsql developer. My requirement is that the data retrieval should be automatic. That means when query a data in oracle table , the data should be convert into .csv file and then it should send that to some specific folder.

Example:

Assume that student_sub1 table have all students subject1 data.when i write a query like select * from student_sub1 where student=1, the student1 data should convert into .csv file and then the .csv file should go to student1 folder.

Hence I am requesting you to suggest me how write a sql code to convert the data into .csv file and to create a folder to send that file using oracle.

Your inputs helps me alot.

Sathyajith Bhat
  • 21,321
  • 22
  • 95
  • 134

1 Answers1

0

see if this post helps. That solution works when you are running the query from sql developer.

EDIT: Btw, if you want this to be in a script. Then I think you can run it using spool command to output the results to a file. Something like this.

set echo off
       set feedback off
       Spool student1.csv;
       Select id||','||name||','||grade from student1;
       Spool off;

Community
  • 1
  • 1
coolpal
  • 31
  • 3