Result of a Query in an Excel Sheet??
Hi,
I am using sqlplus on Unix environment.
How can I get the results of a query (a multi column select query) into a excel sheet, which I can later SCP to my windows environment.
Kindly reply asap.
Thanks In Advance :)
Abhi
You might be able to use the sqlplus colsep command
http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14357/ch12040.htm#sthref2716
SQL> set colsep ','
SQL> select * from emp;
EMPNO,ENAME ,JOB , MGR,HIREDATE , SAL, COMM, DEPTNO
7369,SMITH ,CLERK , 7902,17-DEC-80, 800, , 20
7499,ALLEN ,SALESMAN , 7698,20-FEB-81, 1600, 300, 30
7521,WARD ,SALESMAN , 7698,22-FEB-81, 1250, 500, 30
7566,JONES ,MANAGER , 7839,02-APR-81, 2975, , 20
7654,MARTIN ,SALESMAN , 7698,28-SEP-81, 1250, 1400, 30
7698,BLAKE ,MANAGER , 7839,01-MAY-81, 2850, , 30
7782,CLARK ,MANAGER , 7839,09-JUN-81, 2450, , 10
7788,SCOTT ,ANALYST , 7566,09-DEC-82, 3000, , 20
7839,KING ,PRESIDENT, ,17-NOV-81, 5000, , 10
7844,TURNER ,SALESMAN , 7698,08-SEP-81, 1500, 0, 30
7876,ADAMS ,CLERK , 7788,12-JAN-83, 1100, , 20
7900,JAMES ,CLERK , 7698,03-DEC-81, 950, , 30
7902,FORD ,ANALYST , 7566,03-DEC-81, 3000, , 20
7934,MILLER ,CLERK , 7782,23-JAN-82, 1300, , 40
14 rows selected.
SQL>
Similar Messages
-
Hi Friends,
Instead of display Sheet 1 in the Excel sheet tab(Bex), is there a way we can display Query Name in the excel sheet tab? please let me know.
Thanks,
KKHi Kumar
Can you please share how it was solved ?
Ashish -
Query output to excel sheet...pls solve my problem here !
Hi all,
I have written a procedure which accepts parameters and generate a web page.
The web page generated records as fetched from cursor within procedure.
My requirement is to generate it as a excel sheet once run through url.
I am getting as a text inspite using
owa_util.mime_header('ms-excel');
within my code.....
can you pls help or send me code which could do above task...:)
Thanks in advance.
Regards
RavikanthTry this instead :
OWA_UTIL.MIME_HEADER('application/vnd.ms-excel');
Barry C
http://www.myoracleportal.com -
I have a excel with multiple
sheets with data as shown below
SHEET 1
A 1
B 2
C 3
SHEET 2
B 1
C 2
A 3
SHEET 3
C 1
A 2
B 3
My
query is splitted into 3 categories
I want to have a formula to do math calculation such that data of "A" of SHEET 1 is calculated with "A" of SHEET2 irrespective of the location of "A".
When I include SHEET3, the formula should automatically identify the location of "A" or "B" or "C" and give the result corresponding to A, B or C. Since I want to bifurcate daily report and output printed. I want to use another
excel for output. How to link multiple sheets of one excel and print the output of above in
another excel?
Assume, I have 4 SHEETS, "SHEET 1", "SHEET 2", "SHEET 3" and "SHEET 4". Math calculation need to be done using all 4 sheets. If
I include "SHEET 5", the formula should ignore SHEET 1 automatically and give the results of SHEETS 2 to 5. Similarly, if I include SHEET 6, SHEET 1 and 2 need to be ignored for further calculation and SHEET 3-6 need to be used. How to write
such formula?
How to get pop up alert for multiple rows, if a specific condition is hit?Maybe VBA Code should be a good option for you. I suggest you post you issue to
Excel for Developers forum.
The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us.
Thanks for your understanding.
Best Regards,
Wind -
Mapping query result to excel sheet
Hi Experts,
i have a requirement where in i need to map the result into particular cellls of the excel sheet, because the excel sheet acts as front end which has graphs and by just putting the result in particular cells of excel the graph is automatically generated, so is there any way where i can map the result cells into particulat cells in excel?
Thank you.Hi Shetty,
You might have stopped reading this thread since you have the answer you need for now. From experience, let me tell you what might happen next.
If the query definition is ever changed ... say, a new characteristic is added because a different user has a slightly different need ... the result table will move down by a few rows and your equation no longer works.
If you think this might happen, let me tell you a very easy way to get around it.
1. Name the range(s) you will use. If the first result is in cell B31 on Sheet1, then go to cell B31 on Sheet1 and Select Insert>>Name>>Define. Call it something you will remember, like "LastMonthSales" (no spaces, but underline is OK)
2. use the range name in your formula. This happens automatically, in fact. If you press = then click on cell B31, Excel will automatically use the range name instead of the range address. Excel LIKES names.
3. now, go to the Visual Basic Editor (Tools >> Macro >> Visual Basic Editor; or, Alt+F11). In your workbook, there should be a subroutine as follows:
Sub SAPBEXonRefresh(queryID As String, resultArea As Range)
If you do not find it, add it. This probably also means that you are using Excel 2002 or later and have not set your Macro security to "trust access to Visual Basic Project"; so, change that security setting (Tools >> Options >> Security >> Macro Settings).
The visual basic code is very simple. For each result that you need to map you will want one line of code like this one:
resultArea.Cells(4, 2).Name = "LastMonthSales"
The Cells(4, 2) are counted from the top left of the result table. So, in this case if B31 = Cells(4,2), then the top left of my result table must have been in cell A28 in Excel.
This subroutine will be run automatically every time that the query is refreshed. So, if the result table moves, the names will move with it. One less thing to worry about.
If you do not think you need to do this today, don't! No sense in doing work that is not necessary. But, save this. I suspect that some day you will need it.
- Pete -
HI All,
I need the sql query output in Excel sheet.
We use sqlunload for this.
But my requirement is to export
2 sql query in 2 tabs of a single excel sheet.
Please let m eknow how to process this.
Thanks,
LonyAny idea how to work on this one?
-
How to make a Bi Bean Export to an excel sheet
Hi, I need to export the result of my data to an excel sheet , i need more export types, how can i extend the Exporter Bean or create another bean to do this ?
Thanks...You can implement Export to Excel with BI Beans.
For an HTML client you should look at the oracle.dss.thin.beans.dataView.ExportOptions class. Also look in the BI Beans Help for the Topic "Export Options Dialog".
For a Java client application, you should look at the ExportPanel class (oracle.dss.gridView.gui.ExportPanel) in the BI Beans Javadoc. -
How to show the result of query in oracle forms 10g to Excel Sheet File
Dear All,
I have query and i want the result to be show in excel sheet file in oracle forms
for example if i have a form with search criteria and when pressed the button of ( export to excel ) the result is
excel file contains the result of the query .The only method to achieve this is with the help of Webutil. Please go through documentation for more help.
Regards,
Manoj Chakravarthy -
Problem when exporting Query from Web template to Excel Sheet.
Hello,
Im encoutering a problem when im trying to export query output from web template to excel sheet.
A popup windown appears when excel sheet opens which reads.."problem cameup in the following areas during load : Cell Value".The report layout appears to be fine but the totals shows unwanted values starting with * followed by number.
Any valuable inputs, what could be the problem. where can i rectify the same.
Regards
ElloraHello A K,
Thanks for ur time and response but the option u mentioned did not serve my purpose.
The problem seems to be only with pirticular cells.As mentioned earlier the layout appears properly..all the values are seen..but the end result..totals are disturbed.
eg: If the report shows in template the total value :20,668,554...when exported the values is shown as **668553.88000000600000.
So what could be the problem ? any template setting ? global setting to look at ?
Regards
Ellora -
Hi,
Being an experienced Excel user before Power BI, I am just starting to explore the M and Power Query capabilities, and need help already (ain't easy to google this use case somehow):
I need to import the table which sits in the Excel file with header row in the row 17 of Excel sheet, with some metadata header in the preceding rows of the columns A and B.
01: Report name, Quick Report
02: Report Date, 1/1/2014
17: Employee Name, Manager, etc...
18: John Doe, Matt Beaver, etc.
Both (a) direct attempt to load as Excel file and (b) the indirect way through [From Folder] and formula in custom column -- both lead to the same error: "[DataFormat.Error] External table is not in the expected format."
Specifically, I tried to use the [Power Query -> From File -> From Folder] functionality, select an Excel file and add a custom column to access the binary content: [Add Custom Column] with formula "=Excel.Workbook([Content])".
It looks like Power Query expects a rectangular range with headers full-width followed by a contiguous table range to import anything, and refuses to load if that is not the case...
QUESTION: Is there any way to load whatever-formatted data from Excel first, and then manipulate the overall imported range (like referring to rows starting from 17th using "Table.SelectRows" etc.) to read the actual data? Reading and using
the metadata from header would be a bonus, but that comes second... The main issue is to get something from a non-regular Excel file to later work with using M formulae ...
Thanks!
SAMFinally found the answer to this one in ():
You Cannot Open a Password-Protected Workbook
If the Excel workbook is protected by a password, you
cannot open it for data access, even by supplying the correct password with
your connection settings, unless the workbook file is already open in the
Microsoft Excel application. If you try, you receive the following error
message:
Could not decrypt file.
ANSWER: So, will have either weave in the work with temporary unprotected files or requires opening them before updating the data source (although this almost defeats the purpose of automation...)
ANSWER to ORIGINAL QUESTION: password was preventing Power Query from reading the Excel file. For solution see above.
Thanks anyway for participation and inspiration, Imke! -
How to save query result on the file server as excel file?
Hi everyone,
I need to save the the query result on the file server as excel file.
Do you have any idees how can I do it?
Regards
Erwini dont think you can save as excel file but you can save it as CSV use APD or RSCRM BAPI for this
-
Need sql query to import from excel sheet
Hey , i need sql query to import from excel sheet.
i work in a company where i need to daily update the data from excel sheet.
if i get a shortcut method i ill be very thank full to you guys to reduce my work upto 10 %.any query which can inert from excel file?
Sort of. Certainly not anything as simple as what you seem to hope for. Check out this very good PHP class:
PHPExcel - Home -
SAP Query : Excel sheet download problem
Hi,
While executing a Z SAP query in SQ01 and data is displaying fine in the ALV format. But when we export the data to excel sheet, every column is appearing twice (repeating only the header, with empty items)
something like this......
Excel sheet...
Header MATNR MATNR MATKX MATKX LIFNR LIFNR KUNNR KUNNR
Item 10 Test ABC ABC
20 Test2 XYZ XYZ
30 Test3 MNO MNO
What can be possible cause of this ? What can be the corrective step to the issue?
Thanks,
JaiHi ,
Please follow the below step .
In SQ01 --> In the List Display screen --> click on Export --> Local file --> Spread Sheet --> Give the File name and click on generate .
It s working file . and i can be able to download all the records to excel without any repeatation .
Thanks
Pavendhan -
How to spool data into multiple Excel sheet if result is more then 65k rows
Hi all,
Wann spool data into multiple excel sheet bocz my resultant no of rows are more then 65k.
Thanks to all in advance.....many choices
1) migrate to a newer version of Excel
2) split the files after spooling
for instance with split
split -l65000 file.txtor with perl, java, vb or what-so-ever
3) do more than one report by using rownum
spool f1
select empno,ename from (select rownum r,empno,ename from emp order by empno) where r<6 ;
spool off
spool f2
select empno,ename from (select * from (select rownum r,empno,ename from emp order by empno) where r<11) where r>5 ;
spool off
spool f3
select empno,ename from (select rownum r,empno,ename from emp order by empno) where r>10 ;
spool off -
Owb mapping result in excel sheet
hi ,
can anyone help me to know how i can get owb mapping running status & result in excel sheet.
I have completely forget it.
kindly help.
rgds,
pcHi,
You can view the status by qurying wb_rt_audit_map_runs from any SQL client.
From there your can copy the output to excel.
Otherwise you can use OWB repository browser to view the mapping running status report.
Regards,
Pnreddy
Maybe you are looking for
-
Creation of sales order in CRM and replicating it to Multiple ECC system.
We have a requirement for creation of sales order in CRM and replicating it to Multiple ECC system. We have checked the following standard Adapter objects in transaction R3AC1. BUS_TRANS_MSG The initial flow contexts does not support target site type
-
Remove background picture file name from my macbook pro
I have a 17" macbook pro with MAC OS 10.7.5 and was trying to access the desktop pictures to copy the images. I entered a command that I thought would reveal the hidden picture folder and instead my dispaly now not only shows the image but also its
-
Sub-selects in forms causing ora-24333
We are running in a new 11g environment and are receiving an ora-24333 from forms with sub-selects. The same form works in 10g and the sql statement, itself, works in sqlplus. The following is an example of code exec_sql.parse(oracle_handle, oracle_c
-
How to make a crystal report in labwindows?
i want to make a crystal report in labwindows ,do you know where i can get some example of crystal report?
-
Hi Guru, I am a new student of SAP, can any body help me for creating payroll area and using it. Regards, Waqas