Hi,
I saw the same titled post but the answer given there is abt how to import data from an input file.
I know this can be done once u can get data from database in ur application using java,.net or any other language but I want to accomplish this inside the query itself.
I've found the code for the same but this query is written for mysql, I am looking for somthing on the same line in oracle.
This is the link for solution to my question, in mysql query using java language. http://www.java-tips.org/other-api-t...-csv-file.html
the query used here in mysql is: -
"SELECT id,text,price into OUTFILE '"+filename+ "' FIELDS TERMINATED BY ',' FROM testtable t"
-
-
Thanks,
Nick.
9 20819
I don't get what you mean.
Do you want to import data into Oracle from Excel, or do you want to export data from Oracle to Excel?
Do you want to do it just by using SQL or are you using PL/SQL as well?
As I mentioned I want to do this with oracle (PL/SQL).
I need the same kind of query in pl/sql which I have written in mysql.
I really don't read mySQL.
There is a difference between SQL and PL/SQL in Oracle. SQL is the query language and PL/SQL is the programming language.
If you want to get it in a query and the output is csv then the SQL query could be something like:
SELECT column_name1 || ';' || column_name2 || ';' || column_name3 etc.
FROM table.
You can replace the semicolon by any seperator you want, just make sure it is between single quotes.
Make sure the output is send to a file, and you are done.
Pilgrim.
That can be easily done by using some tools like toad,pl/sql developr or query reporter.
I really don't read mySQL.
There is a difference between SQL and PL/SQL in Oracle. SQL is the query language and PL/SQL is the programming language.
If you want to get it in a query and the output is csv then the SQL query could be something like:
SELECT column_name1 || ';' || column_name2 || ';' || column_name3 etc.
FROM table.
Make sure the output is send to a file, and you are done.
Pilgrim.
Thanks for the reply guyz.
Pilgrim333 I was really looking for something like that but can I transfer that result to a file directly from the query something like
SELECT column_name1 || ';' || column_name2 || ';' || column_name3 etc.
FROM table into outputfile "filelocation"
Hi,
You can spool the output of the query to a file. In your sqlplus window just give the following commands: - SQL> Spool on
-
SQL> Spool c:\output.csv --file you want the output generated to
-
SQL> <query>
-
SQL> Spool off
-
Pilgrim.
Hi,
You can spool the output of the query to a file. In your sqlplus window just give the following commands: - SQL> Spool on
-
SQL> Spool c:\output.csv --file you want the output generated to
-
SQL> <query>
-
SQL> Spool off
-
If I am passing the query from the java program to the database, then how that would b using spool.
Will that be something like this??
str = "Spool on
Spool c:\output.csv
SELECT column_name1 || ';' || column_name2 || ';' || column_name3 etc.
FROM table
Spool off"
Hi,
I read over the part of Java. Spool is an SQLPlus command, so i don't think you can submit it using Java.
But if you are using Java, wouldn't it be a lot easier getting the result back in Java and create your Excel file from Java?
Pilgrim.
Hi,
I read over the part of Java. Spool is an SQLPlus command, so i don't think you can submit it using Java.
But if you are using Java, wouldn't it be a lot easier getting the result back in Java and create your Excel file from Java?
Yes I already implemented that......was just curious to know if it can work this way..............But thanks for all ur help.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Chris |
last post by:
Could someone please provide me an effective means of
exporting data from a data set (or data grid) to Excel?
|
by: sridevi |
last post by:
Hello
How to export data from ms-access database to excel worksheet using ASP.
mainly i need to export data to multiple worksheets. it is very urgent to
us.
i have a sample code which works...
|
by: D |
last post by:
I've created a report with many subreports of aggregate data. I want my
client to be able to export this data to Excel to make her charts, etc. Only
one problem: one of the fields is a "SchoolYear"...
|
by: G |
last post by:
When I export data from access to excel by with "export" or "Analyze
with" I seem to loose parts of some fields (long text strings). Is
there a way to export it all to excel?
Thanks
G
|
by: pmud |
last post by:
Hi,
I am exporting data from an EDITABLE DATA GRID EXCEL. But the 1st column
in data grid is Edit Column. I want to display all columns in Excel except
for the Edit column.
The following...
|
by: bienwell |
last post by:
Hi,
I have a question about exporting data from datagrid control into Excel file
in ASP.NET. On my Web page, I have a linkbutton "Export data". This link
will call a Sub Function to perform...
|
by: Snozz |
last post by:
The short of it:
If you needed to import a CSV file of a certain structure on a regular
basis(say 32 csv files, each to one a table in 32 databases), what
would be your first instinct on how to...
|
by: Paige |
last post by:
Hi,
I use the exporting function in Oracle financials 11i, but since yesterday it has stopped working.
I get a box appearing saying that the information has been exported, but I don't get given the...
|
by: khushpin |
last post by:
I am looking for a procedure which can export data from Oracle to Excel.
|
by: leninv |
last post by:
Hi,
I have the following code where 'recs' is a record set.
For i=0 to recs.Fields.Count - 1
if i = 0 then
pindnt = string(itmlvl*2," ")
response.write pindnt &...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
| |