简体   繁体   中英

Oracle view result export as csv file

i am not expert in sql query in oracle but i got a task to export view result as csv file. i was instructed to create a materialized view to export. i have been google it for past two days but i have no luck.

are we able to export as csv file by using materialized or which way(procedure or function) to export as csv?

thanks all

"I was instructed to create a materialized view to export"

This is very important. If you were told to build a MV to get the data out, then this indicates that the data is slow to gather.

In other words, the query you would use to get the data ready to export to CSV would take a very long time.

Materialized Views are performance features of the database where you can take a query result and save that as a permanent object in the database, so querying it is very fast.

You have to the decide how often you want to refresh those results - is it OK if the query is fast but the data is 5 minutes old?

Once you have the MV created, getting the data from it to CSV becomes a known exercise, as @kris-rice indicates in his comment above.

I will say, what makes the most sense will be determined in large part by how much data you are talking about, and what you want to do with it when you're done. Provide this data i your question, and we'll give you a better answer.

Creating a MV is on the surface, quite simple, but due to the numerous refresh options, you'll need to know a good bit about your biz requirements so you can make the right decisions.

Once you know that, building one can be done quite easily using the dialog in SQL Developer if you want a GUI.

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM