• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

how to use SELECT * INTO OUTFILE command  RSS feed

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


How to use "SELECT * INTO OUTFILE 'filepath/filename.txt' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' FROM table;" to convert and send database table details to a file
 
Rancher
Posts: 506
15
Java Notepad
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What database are you using?
 
Gouthami Peela
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SQL Developer and SQL Plus oracle(JDBC)
 
Prasad Saya
Rancher
Posts: 506
15
Java Notepad
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using SQL Developer one can export to a CSV file.

Oracle SQL Developer User's Guide: https://docs.oracle.com/cd/E39885_01/appdev.40/e38414/dialogs.htm#RPTUG30590
The topic has the details to use the wizard to do the export: 5.83 Database Export (Unload Database Objects and Data)
 
Gouthami Peela
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for that and I want to do this using Java or Eclipse or directly from SQL Developer can you please help me in this
 
Prasad Saya
Rancher
Posts: 506
15
Java Notepad
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I want to do this using Java or Eclipse or directly from SQL Developer



The URL link provided in my previous message is for Oracle's SQL Developer user guide. You may follow the instructions to export database table data to a CSV file.  I guess you have an installation of the SQL Developer; if not try to get it installed.
 
Gouthami Peela
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually my requirement is like I want to create a file by fetching the details from database table(each record one file) using eclipse IDE.please do the needful
 
Prasad Saya
Rancher
Posts: 506
15
Java Notepad
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An IDE is a development tool. For example, Eclipse or a Netbeans. One can use it to develop an application or a program using a programming language like Java or C# etc. Yes, one can write a program to read a database table and write to file.

Generally one need to decide what programming language to use (my guess is Java) to use, and then what database to read from and then write to a file. To read or query the database one uses JDBC API and IO libraries to write to a file. Also, what kind of data is in the database table and how much of it, etc.
 
Master Rancher
Posts: 3675
40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are going to do this through a JDBC call in Java, have you actually tried it?

I don't see any particular reason that it wouldn't work as is.

However, that command will produce a file on the Oracle server.
Depending on what you want ot do with that file, that might be OK.
 
Gouthami Peela
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes prasad you are correct,actually iam trying to write my java code in eclipse ide to fetch the details from oracle jdbc driver and convert into a file
 
Dave Tolls
Master Rancher
Posts: 3675
40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, so you don't actually want to do SELECT ... INTO OUTFILE then?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!