Stored Proc to create .csv file from table

Advertisement

Hi all,
I have a table with 4 columns and 10 rows. Now I need a stored proc to create a .csv file from the table data. Here the scripts to create a table and insert the row's.
Create table emp(emp_id number(10), emp_name varchar2(20), department varchar2(20), salary number(10));
Insert into emp values ('1','AAAAA','SALES','10000');
Insert into emp values ('2','BBBBB','MARKETING','8000');
Insert into emp values ('3','CCCCC','SALES','12000');
Insert into emp values ('4','DDDDD','FINANCE','10000');
Insert into emp values ('5','EEEEE','SALES','11000');
Insert into emp values ('6','FFFFF','MANAGER','90000');
Insert into emp values ('7','GGGGG','SALES','12000');
Insert into emp values ('8','HHHHH','FINANCE','14000');
Insert into emp values ('9','IIIII','SALES','20000');
Insert into emp values ('10','JJJJJ','FINANCE','21000');
commit;
Now I need a stored proc to create a .csv file in my local location. Please let me know If you need any other details....

Advertisement

Some pointers:
http://www.oracle-base.com/articles/9i/GeneratingCSVFiles.php
http://tkyte.blogspot.com/2009/10/httpasktomoraclecomtkyteflat.html
also, doing a search on this forum or http://asktom.oracle.com will give you many clues.
.csv file in my local location.What is your 'local location'?
A client machine? The database server machine?
What database version are you using?
(the result of: select * from v$version; )

October 11, 2015

Stored Proc to create .csv file from table

Hi all, I have a table with 4 columns and 10 rows. Now I need a stored proc to create a .csv file from the table data. Here the scripts to create a table and insert the row's. Create table emp(emp_id number(10), emp_name varchar2(20), department varc

How to create .csv file from ABAP report

Hi We have a requirement to generate .csv file from abap report. Currently user saves data from abap report to spreadsheet(.xls format) in desktop.  Then opens excel file and save as .csv format.  Need option to save directly in .csv format instead o

Create XML file from table data

Dear All, with dataservice 4.0, I want to create an XML file from a table data. Table have a single column but more record, for example: 0001000488;100;EUR; 0001000489;200;EUR; 0001000450;300;EUR; My desired XML output: <Data>   0001000488;100;GBP;

How to create xml file from original

I have this complicated xml and I want to search through it and make a new xml with only element I find that match. what is the best way to do this? the file is about 6mb and I want to read the whole file easily..should i load to database table and c

Howto make created folders/ files from one teacher, read only for other teachers?

Hello there, as an admin @ school I was wondering how to make created folders/ files from one teacher, read only for other teachers?  - In a 2008domain, created a group "teachers"  - created a folder "teacher data" where all teachers h

Creating PDF Files from Microsoft Office | Learn Acrobat X | Adobe TV

This video explains how to create PDF files from Microsoft Office products including Office 2010 in Acrobat X Std. or Pro. http://adobe.ly/w5Vsg9I have used Print to PDF from the File Menu in Office many times. Normally it works fine, but for whateve

I am unable to create adobe file from attached document from email

I am unable to create adobe file from attached document from email. No 'open in' link is available as given in directions. What to do?Because there is no abode on the IOS.  you'll need to do a search in the app store to resolve your issue.Read other

Can not open JPEG files and can not create JPEG files from other software

Can not open JPEG files and can not create JPEG files from other software (For example from Solidworks). When I try to right click on a JPEG, a notice window appears written: "Windows Explorer has stopped working - Windows is checking for a solution

Creating stored procedure to import csv data into tables

I am trying to create a stored procedure to import data from a csv file into a table. I tried using sqlldr but could not run it at school due to access permissions that they will not change. So I looked at the utl_package and from what I can see it r

Please Help. Trying to create XML file from 2 tables.

Step1: Target XML format Created an XML <DEPART> <DEPARTMENT_ID>10</DEPARTMENT_ID> <DEPARTMENT_NAME>Administration</DEPARTMENT_NAME> <MANAGER_ID>200</MANAGER_ID> <LOCATION_ID>1700</LOCATION_ID> <EMP

How to create xml file from relational tables in 10gR2

Hi, I am very new to XML and was wondering how to create an XML file from querying relational tables. Some child tables may contain multiple rows that need to be returned in certain instances. Other queries will just be single or multiple rows from o

Problem in Creating excel file from internal table

Hi Experts,             here iam having a proble with creating an excel file from an internal table which is having around 15 records, when iam generating an excel file, its getting only upto 255 chars, after that its breaking and new record is being

Issuse in Uploading a .CSV file from AL11 to Database table.

Hi All, I have a .CSV file (UTF-8 format) which contains Chinese Characters. I uploaded the file to AL11 and it shows that all teh data is correct in AL11. Now i am using a program to Read file from AL11 and update a ztable but some of the characters

Generating Text file from table using Shell script

I am using KSH for generating and FTPing a text file from a table. While generating Text file I am not getting my Column names in orderly manner. q2="select COLUMN1||' '||COLUMN2||' '||COLUMN3 from table1;" set pagesize 0 set head off set trimsp

Cannot extract dimension .csv files from HFM to be able to use maploader

Hi All! We are in the middle of implementing FDM at a financial consolidation project. During this build we would like to use FDM to load HFM with data. To help the users we would like to offer them the Maploader.xml which is provided in the mapping

Read the csv file from plsql

Hi, I have data in csv file. I need to read the data from that file and at the same time i need to omit first row(ie column header). How can i do this...? Please help me....asap Thanks in advance....BluShadow wrote: Nuerni wrote: Just read-in the csv

Stored procedure with database link with "from table(...)"

Hi guys, I've been told I can't create views on a database by the design team and so have to use this stored procedure to obtain the values. select HAN_ID, HAN_DS, GLOBAL_IN, LOCAL_IN from table(cast([email protected](11312,'EN

Uploading Large csv file from Local File

I have a 6GB csv file which I created on my local machine which is named TrainDF.csv.  I can't upload it directly as it exceeds the 1.95GB size limit uncompressed.  However, I tried saving it as an RData file (as well as a zip file of the RData file)

Can I create a foreign key when creating Business Components from Tables

Hi, I would like to use ADF and JSF to create an application on our database. My problem is our database does not "conform". i.e. there are no foreign key constraints. When I create a "Business Component from Tables" view, can I put in

Creating help files from PDF

I am evaluating RoboHelp as a possible way to create help files (probably will end up being .CHM files). We'd like to be able to go from the files used for our printed documentation, which are generated using LaTeX and output as PDF files. We use LaT