Connect To Oracle DB And Write SQL Results Into Excel File

Sep 27, 2013

I would like to connect to oracle database and would like to execute series of SQLs and write those SQL results into Excel file (sheet1).

my requirement is simple :
------------------------
db_user_id scott
db_user_pwd tiger
db_sid orcl

select count(*) from emp;
select count(*) from dept;

print the same SQLs in A column and result should be in B column in excel file.

column A column B
select count(*) from emp; 14
select count(*) from dept; 4

thats it.

View 1 Replies


ADVERTISEMENT

JDeveloper, Java & XML :: How To Write Results Of Select Statement Into File

Feb 25, 2011

SQL> desc res;
Name Null? Type
----------------------------------------- -------- ----------------------------
RESULT PUBLIC.XMLTYPE

SQL> select * from res;

RESULT
--------------------------------------------------------------------------------
<fine No="2"><stdNo>2</stdNo><value>300</value><reason>breaks keyboard</reason><
date>2011-10-03</date></fine>

how can me write results of select statement into xml file instead of show them on screen?

View 20 Replies View Related

SQL & PL/SQL :: Connecting From Oracle To Excel To Copy Results In Cell Value

Aug 29, 2012

How can I connect excel from pl / sql to copy results from the query. I was trying with OLE2 but it is throwing error as "invlid Identifier". Then how to include OLE2 in oracle.

View 10 Replies View Related

Forms :: How To Connect Excel With Oracle Database Via 10g Login Screen

Jul 20, 2010

In fact I have around 50 excelbooks that are connect with oracle via ODBC/or any other way. My task is to build the login screen on form 10g. This form will validate the user via .dll after successfully validation, Form will connect to specific oracle user. This Login Screen will call the new form that will execute the query for the list of excel sheet [table that will keep the name, description and path of the excelbook]. User will select the one excelbook to open. As user will select Excelbook should be open. Now this excel book should be connected with specific oracle user.

Question 1: How to open the excelbook, that excelbook should be connected via form 10g login screen. After connection excel has its own micros to run he query from oracle database.

Question 2: How I can create the mirco into form 10g to run into excelbook/excelsheet.

Question 3: How I can pass the query or function/procedure to the excelbook/excelsheet.

View 3 Replies View Related

PL/SQL :: How To Write To Text File Using Oracle

Feb 23, 2013

How to write to text file using oracle? And how do I handle spaces/next line? (i was trying to use spaces(ch(32)), however it is just converted into squares in the text file.)

View 5 Replies View Related

Forms :: Read And Write File Using Oracle 6i?

Nov 16, 2011

I have a file studnet.txt in following order

JAMs|1231|PHYSICS
SAM|1232|PHYSICS
ALI|1233|CHEMISTRY

I want to read and write data from a file in | seprated mode. file READ and WRITE using Oracle Forms6i. I have a knowledge of file handling in C++ but not use it in Oracel Form before this.

View 5 Replies View Related

Client Tools :: Leading Zeroes Are Getting Wiped Off When Results Are Copied Into Excel

Apr 13, 2012

We wrote a query to spool the results in TAB delimited flat file, Results are ok but when copied into excel the leading zeroes are getting wiped off.

Example:

Result: 0000123 and when copied into excel the value is just 123. I need to retain the value as it is 0000123.

Can we control it in the query itself rather than correcting the excel.

View 4 Replies View Related

SQL & PL/SQL :: Single Excel File For Emp Table Department Wise In Different Sheets Of Excel

Mar 30, 2012

I need to generate a single excel file which each department details in seperate sheets of the excel file, each sheet should ne named with department no (ex :Dept_10, Dept_20,Dept_30) and the main excel should be named as Emp_details.

Header row and total row should be in bold.I have created 3 individual excels thru toad and moved them to single excel and renamed the sheets.

Can we programatically do this thru SQL or PL/SQL, does Oracle provide any build packages for excel.As excel files cannot be uploaded,I am unable to upload the excel file I generated manually.

select to_char(empno) empno,ename,job,mgr,hiredate,
nvl(sal,0) sal,nvl(comm,0) comm,nvl(sal,0) + nvl(comm,0) "Total Income" ,deptno
from emp
where deptno = 10
union all
select 'Total',null,null,null,null,sum(nvl(sal,0)),sum(nvl(comm,0)),sum(nvl(sal,0))+sum(nvl(comm,0)),null
from emp
where deptno = 10;

View 1 Replies View Related

PL/SQL :: Oracle Query Export Into Excel File

May 29, 2013

How can i automatically export oracle query result into the excel file in oracle?

View 2 Replies View Related

Getting Error While Loading Excel File Into Oracle Database

Dec 30, 2010

I am loading a Excel file into oracle database using a ORACLE form 6i and i am getting an ORA-302000. This Form run and load database file into database in many pc.

But One of the PC COuld not loading a Excel file into oracle database. Also i can't Create Excel file Database Through form 6i.

View 1 Replies View Related

SQL & PL/SQL :: Procedure To Load Data In Oracle Table Into Excel File

Dec 29, 2010

send me the procedure for loading the data in an oracle table into an excel file.

View 5 Replies View Related

SQL & PL/SQL :: Email Excel File As Attachment In Mail Through Oracle Procedure?

Mar 3, 2011

I need to email an excel file as an attachment in the mail through oracle procedure. I am using UTL_TCP option.

The remote_host i use in test environment is the 'name of the test server'. This test server is a oracle10g database on AIX server.In the test environment the mail works fine.

utl_tcp.open_connection(remote_host => 'test server',
remote_port => 25,
tx_timeout => null);

The same thing if i use in production environment, it does not work. The production server is a 9i database on a unix server.

utl_tcp.open_connection(remote_host => 'prod server',
remote_port => 25,
tx_timeout => null);

Does the 10g has option to host SMTP service as apposed to 9i?

View 12 Replies View Related

Open Excel File From Oracle Directory On Local Machine

May 31, 2013

I have an application where I generate a excel using data in a table and write excel file in oracle directory.Now my requirement is to open that file from local machine .How can i achieve it.I am using Apex 4.2,Oracle 10g .

View 1 Replies View Related

Reports & Discoverer :: REP-50127 / Cannot Write To File When Trying To Save A Report To A File

Sep 17, 2010

I am receive the REP-50127 error, cannot write to file when trying to save a report to a file on the network via report parameters.

I am guessing the rwserver does not have permissions to the network drive.

Will the SERVER_IN_PROCESS=NO run the rwserver process as the user executing the report?

View 1 Replies View Related

SQL & PL/SQL :: Exporting Oracle Data Into Excel File With Auto Column Size

Nov 7, 2007

I want to export the oracle data into an excel sheet. I have written the code by using UTL_FILE package. but i am getting the output as shown in the screen shot(without formatting the column size as the width of the data it has). But I want the output column width to be set according to the size of the data automatically.

View 5 Replies View Related

Client Tools :: Export Data From Oracle Database To Excel File?

Aug 21, 2012

I am using SQLTools 1.5 for writing Oracle SQL scripts.

I have to import data from excel file to oracle database. How can I do it?

Also how can I export data from Oracle database to Excel file?

View 2 Replies View Related

Restore Control File To Connect With Oracle

May 13, 2011

I deleted the control file using $rm control01.ctl. But i perform the back up

rman> backup incremental level 0 database;

i have no any backup

so how can i recover the my lost control file to connect with oracle instance.

View 1 Replies View Related

SQL & PL/SQL :: Connect To Oracle Database From Log4net.config File?

Apr 26, 2012

Need to know how to connect to Oracle (11g) database from Log4net.config file. As I need to wright the logs to the Oracle (11g) database when any user logon to the web application.

Note: I am succesfully able to wright the logs to the text files but not able to wright the logs to the Oracle (11g) database.

View 6 Replies View Related

PL/SQL :: Write Clob Or Xml To A File?

Jul 9, 2013

I have read the following article:[URL] 11070I want to know wherer if there exists a possibility of write a clob or an xml into a file on disk, if we do not have the CREATE ANY DIRECTORY privilege. Many functions, like UTL_FILE.FOPEN, or dbms_xslprocessor.clob2file, or dbms_xmldom.writetofile, need an Oracle directory to be created (with CREATE OR REPLACE DIRECTORY...). But if we don't have this privilege, is there a possibility to export a clob into a file as xml (the clob contains 100% xml, but this is the column data type, CLOB) if we don't have that privilege?The clob data contains 48200 characters.

View 8 Replies View Related

Run Same SQL Statement Twice And Save Results In Same File

Feb 3, 2011

I am running Oracle 10.2.0.4 and I want to run the same sql statement twice and save the results in the same file.Here is my setup

cat x.ksh
-----------
sqlplus ' / as sysdba ' <<EOT
@x.sql;
@x.sql;
exit;
EOT
[code]....

what I am doing wrong with the append option as it is not working as I would have expected it too.This is the desired result I am looking for.

cat x.log
----------
1
----------
1
1
----------
1

View 2 Replies View Related

Multiple Processes To Write File?

Sep 10, 2012

In PL\SQL program, I am writing information from one table to file. In my current architecture, I am writing the information to approximately 1000 files.

If I put the database write operation in another package and in another method and call this method from my PL\SQL program asychronously, can that increase performance?

View 1 Replies View Related

How To Control File Parallel Write

Mar 2, 2011

We have a database that is accessed by ArcSDE, a product to modify maps. It uses BLOBs to store those maps.

We ran a load on the server and the response time was slow. By running the following query:

select event, total_waits, time_waited, avg_ms, round(ratio_to_report(time_waited) over () * 100) percent
from (select substr(event, 1, 30) event, total_waits, time_waited, round(time_waited_micro / total_waits / 1000, 2) avg_ms
from v$system_event
where wait_class in ('System I/O') union
select 'CPU' event, NULL, value, NULL
from v$sysstat
where statistic# = 12
order by 3 desc)
where rownum <= 10;

I get

EVENT TOTAL_WAITS TIME_WAITED AVG_MS PERCENT
--------------------------- -------------- ------------- -------- ---------
control file parallel write 127187 6354909 499.65 70
CPU 988274 11
db file parallel write 20461 886442 433.23 10
log file parallel write 14987 870672 580.95 10
log archive I/O 1557 18094 116.21 0
control file single write 149 10590 710.71 0
control file sequential read 136502 5219 .38 0
log file single write 56 2511 448.41 0
log file sequential read 489 492 10.05 0

BUG: 733426 says to change the event="10359 trace name context forever, level 1"

View 2 Replies View Related

SQL & PL/SQL :: How To Write Text At Specified Position In File

Apr 11, 2013

suppose i have a file named chk.txt and I have write 10 line in that file and i just want to write some text at line 5 or line first then how we can do this ?

View 3 Replies View Related

Server Utilities :: How To Write CTL File

Jun 10, 2013

How to write the CTL file for this kind of situation.

a.txt
id name subject
12aaaHistory
23bbbScience
45cccZoology

b.txt
idlayerLayerNo
12xxx121
23yyy232
23lll233
45xxx451
45yyy452
45lll453

i have files a.text which is parent file and another one is child one called file b.txt . Both files are linked together by common field called "id". Interesting part child file have multiple layers name associated with ids. (we are only aware that in b.txt for each id there could be max 3 layers)

So they needs to get loaded into Table called PARENT_TBL

So PARENT_TABLE looks like
ID NAME SUBJECT LAYER LAYERNO

How I'm going to achieve this ?

View 3 Replies View Related

PL/SQL :: Read Byte Array And Write It Into File

Sep 19, 2013

I have a web service which gives me the response in Byte array.write this byte array into a binary file? .

View 2 Replies View Related

Write Shell Script To Parse Parameter File

Mar 29, 2013

I'm working on trying to write a shell script to parse a parameter file, but at the same time I want to be able to overwrite the parameter file settings with other command line settings. For instance if my par file had export/import settings for the username, password, schema, etc;

I wanted to run the same export/import with those settings for a different schema. I want to be able to put the schema=<different_than_par_file> after the parfile=<parfile.par and have the parfile be read and applied for everything except the different schema.

Right now I'm storing the cmd line and parsing it again looking for other parameters besides the parfile.

View 4 Replies View Related

PL/SQL :: Read  Long Raw data And Write To A File

Sep 17, 2012

So we need an mechanism to read data from LONG RAW and convert into actual file.

View 1 Replies View Related

SQL & PL/SQL :: Generate A Select Query In Runtime And Store Results Of It Into A File?

Aug 15, 2011

I need to generate a select query in runtime and store the results of it into a file.Each time the column name and table name in the query will differ.Now im able to generate the select query through for cursor but problem is to store the results to the file.I tried using plsql table,im able to get the values to that table and store the results to a file,but the results of the query is more then 10000 lines (it might increase also)where only 4000 characters where able to store in the plsql table.so rest of them are not stored in the file.

View 3 Replies View Related

SQL & PL/SQL :: Write A Dynamically Changing Filename - Code Not Producing Any File?

Jul 19, 2011

I tried to write a dynamically changing filename and file type so that i can dump some data. But the code I wrote is not producing any file at all even though it compiles with no errors. I run this code at XE database which comes free from the oracle website. I did all the directory settings. No problem with it because I can produce file with different codes. The code is as following:

CREATE OR REPLACE PROCEDURE dump_csv_file IS

TYPE number_array IS VARRAY(10000) OF NUMBER;
TYPE string_array IS VARRAY(10000) OF VARCHAR2(100);
TYPE date_array IS VARRAY(10000) OF DATE;
TYPE v_file_array IS VARRAY(10000) OF UTL_FILE.FILE_TYPE;

[code]...

View 11 Replies View Related

Client Tools :: Connect Oracle Developer 6i Without Connect String

Aug 17, 2010

I have installed oracle developer 6i. in sqlplus i want to put my username and password but nothing in the connect string field.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved