Export Query records to CSV in Excel automatically
Hi Experts
I have a query, where by my queries dont output to CSV automatically, even when I save as .csv it still doesn't work. I found SAP Note 1248146 but it's not very clear... I can not find the 'edit' 'export to excel' you help a bit more please?
Many thanks,
Caroline
Hi Gordon,
Many thanks for this.
My customer wants to be able to export directly into CSV format though, is this possible please?
Many thanks,
Caroline
Similar Messages
-
Export query result to csv using Export Wizard
Been a decade since I last used Oracle and related tools.
I had to use Oracle server again, I have a query over multiple tables, I am to run a scheduled script that will spit out the query result as a csv file.
I started with SQL Developer Export wizard, in step "Specify Data", I am at a loss, where to specify the query itself? I see a Name,Schema,Type input, a text area below, Up,UpAll,Down,DownAll buttons etc etc. Where do I specify my query here? Can someone please help?
Is this the best way to go about to schedule a data export (query to csv) daily?To export a user query rather than a whole table, run it in a worksheet and export using the context menu on the result grid. However none can be scheduled.
Instead you can look at the SPOOL command and schedule it through SQL*Plus. Any questions can go to the iSQL*Plus and/or SQL And PL/SQL forum.
Have fun,
K. -
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 -
Want to export output of alv grid to excel automatically
hi friends.............
i want to export output of alv grid without displaying on screen to excel file .......................
how i m able to do it ..............................
in the same way as after alv grid display click on LOCAL FILE-> SPREADSHEET-> ........................
plz rply me soon if anyone of u know abt that.................
thanks allot.............actually in output through 'REUSE_ALV_GRID_DISPLAY' some title is also there through TOP_OF_PAGE how can download it also and data table in excel sheet ...................
actually when an alv output is displayed then some title data is also displayed in alv grid then we can download it by clicking on icon 'local file--> spreadsheet........and soon ' ..........
my req. is download it automatically without doing this process and without displaying it on screen......... it means i want to interrupt to alv grid output to only download without displaying it in output screen............
if u clear my question then reply me............. -
Export query results into .csv file?
Hello I have a T-SQL script that gets row counts for a specified date range and then needs to loop (by incrementing +1 day to get the next day's counts) for a large date range. I'm aiming to output & append each query results day counts
into a .csv file via a SQL Agent job since this will take quite a while to complete.
Would using the following as an example template...
INSERT INTO OPENROWSET('Microsoft.ACE.OLEDB.12.0','Text;Database=D:\;HDR=YES;FMT=Delimited','SELECT * FROM [FileName.csv]')
SELECT Field1, Field2, Field3
FROM DatabaseName
...be the method or something else?
If this is good to use I've tried running this but get the following error:
Msg 7357, Level 16, State 2, Line 76
Cannot process the object "SELECT * FROM [FileName.csv]". The OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)" indicates that either the object has no columns or the current user does not have permissions
on that object.
Thanks in advance.Hi Techresearch7777777,
The error in your post says that the file FileName.csv has to be created with the column names in the first row. Like:
Field1,Field2,Field3
Either you can create a schema.ini file under the same folder:
[FileName.csv]
Format=CSVDelimited
ColNameHeader=False
Col1=Field1 [DataType]
Col2=Field2 [DataType]
Col3=Field3 [DataType]
For the [DataType],you can reference
Schema.ini File (Text File Driver)
If you have any question, feel free to let me know.
Eric Zhang
TechNet Community Support -
How to Export BW Query Report to .csv file
I try to export BW QueryReport to .csv file using ReportAgent and URL command in WEB Template:
<SAP_BW_URL DATA_PROVIDER='VIEW1' CMD='EXPORT' FORMAT='CSV'>
but can't find the result file.
Is someone have experience in exporting BW Reports to file in automatic way?Another way to do it would be to use transaction RSCRM_BAPI.
Not ideal for large volumes but allows you to extract from a query.
Regards,
Mike -
Hi all,
I am currently planning to develop a program that does the following things:
1. Connects to the Oracle database
2. Runs a query
3. Export the results of the query to a CSV file in a folder
If theres anyone out there who has experienced in similliar work, please explain to me with codes as example or point to me tutorials.
cheers
SIjwenting wrote:
johndjr wrote:
jschell wrote:
johndjr wrote:
DrClap wrote:
Of course there are people who can't tell the difference between a CSV file and an Excel spreadsheet.And a good thing I say. I deal with a number of people who love their spreadsheets. I can create a simple CSV file and when they double click on it on Windows, Excel opens a spreadsheet and we are both happy.I bet they would be happier if it was a real spreadsheet.You would almost certainly win that bet.I doubt many of them would even notice :)++ -
Export query results to excel from forms
Are there any ways to export query results to MS Excel format files from a form.
Thanks.Here's my working code out of one of my forms that does this:
PROCEDURE export_transactions_to_excel IS
-- Declare the ole objects
application ole2.obj_type;
workbooks ole2.obj_type;
workbook ole2.obj_type;
worksheets ole2.obj_Type;
worksheet ole2.obj_type;
cell ole2.obj_type;
-- my variables
rowCounter Number := 1;
local_cursor_Record number := :System.Cursor_Record;
old_cursor_Style varchar2(100);
errors_occurred boolean := false;
Ole_Error Exception;
pragma exception_init( Ole_Error, -305500 );
my_alert_id ALERT;
alert_response NUMBER;
procedure place_value_in_cell( rownum_in in number
, colnum_in in number
, value_in in varchar2 )
is
-- Declare handles to OLE argument lists
args ole2.list_Type;
begin
args := ole2.create_arglist;
ole2.add_arg(args, rownum_in); /* row number */
ole2.add_arg(args, colnum_in); /* column number */
-- the next line is for excel97
-- cell := ole2.invoke_obj( worksheet, 'Cells', args );
cell := ole2.get_obj_property( worksheet, 'Cells', args );
ole2.Destroy_arglist( args );
ole2.set_property( cell, 'Value', value_in );
ole2.release_obj (cell);
end place_value_in_cell;
procedure SaveSpreadsheet
is
args ole2.List_Type;
vDateStamp varchar2(20);
begin
vDateStamp := to_char(sysdate,'mmddyyyy') | | '_' | | to_char(sysdate,'hh24miss');
args := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(args, 'C:\PAPRETCC_' | | vDateStamp | | '.XLS');
OLE2.INVOKE(worksheet, 'SaveAs', args);
OLE2.DESTROY_ARGLIST(args);
--args := Ole2.Create_ARgList;
ole2.invoke( application, 'Quit' );
end SaveSpreadSheet;
procedure Open_EXCEL_Workbook is
Begin
application := ole2.create_obj('Excel.Application');
--ole2.set_property( application, 'Visible', 'True' );
-- Return object handle to the Workbooks collection
workbooks := ole2.get_obj_property( application, 'Workbooks' ); -- invoke_obj w/ excel 97
-- Add a new Workbook object to the Workbooks collection
workbook := ole2.invoke_obj( workbooks, 'Add' );
-- return object handle to the Worksheets collection for the
-- Workbook
worksheets := ole2.get_obj_property( workbook, 'Worksheets' ); -- invoke_obj w/ Excel97
-- Add a new Worksheet to the Worksheets collection
worksheet := ole2.invoke_obj( worksheets, 'Add');
end open_EXCEL_workbook;
PROCEDURE Write_Column_Headers IS
BEGIN
place_value_in_cell(rowCounter,1, 'Payer Name');
place_Value_in_cell(rowCounter,2, 'Payer Address');
place_value_in_cell(rowCounter,3, 'SSN');
place_value_in_cell(rowCounter,4, 'Account');
place_value_in_cell(rowCounter,5, 'Refund Receipt');
place_value_in_cell(rowCounter,6, 'Pretax Allocation');
place_value_in_cell(rowCounter,7, 'Tax Allocation');
place_value_in_cell(rowCounter,8, 'Total Amount');
place_value_in_cell(rowCounter,9, 'Orig Receipt');
place_value_in_cell(rowCounter,10,'Orig Date');
place_value_in_cell(rowCounter,11,'TR Number');
place_value_in_Cell(rowCounter,12,'Date');
place_Value_in_cell(rowCounter,13,'Status');
place_value_in_cell(rowCounter,14,'Vt Number');
rowCounter := rowCounter + 1;
END Write_Column_Headers;
PROCEDURE Export_The_Data IS
original_receipt number;
original_date DATE;
original_transmittal_number number;
BEGIN
-- Return object handle to cell A1 on the Worksheet
Go_block('Transactions');
First_Record;
LOOP
IF alert_response = ALERT_BUTTON2 or
(alert_response = ALERT_BUTTON1 and nvl(:transactions.rg_approval,'N') <> 'N' )
-- :system.record_status = 'CHANGED')
then
place_value_in_cell( rowCounter, 1, :TRANSACTIONS.NDB_PAYEE_NAME );
place_value_in_cell( rowCounter, 2, nvl(:TRANSACTIONS.NDB_PAYEE_ADDRESS,'unknown') );
place_value_in_cell( rowCounter, 3, nvl(:TRANSACTIONS.NDB_SSN,'unknown') );
place_value_in_cell( rowCounter, 4, :transactions.NDB_DESCRIPTION );
place_value_in_cell( rowCounter, 5, to_char(:Transactions.transaction_group_EID) );
place_Value_in_cell( rowCounter, 6, to_char(:transactions.ndb_pretax_amount) ); -- chg
place_ value_in_Cell( rowCounter, 7, to_char(:transactions.ndb_tax_amount) );
place_value_in_cell( rowCounter, 8, to_char(:transactions.amount_including_taxes) );
original_receipt := revenue_pkg.original_receipt_number(
:transactions.transaction_group_eid,
:transactions.allocation_eid,
:transactions.allocation_table );
original_date := revenue_pkg.original_receipt_date(
:transactions.transaction_group_eid,
:transactions.allocation_eid,
:transactions.allocation_table );
original_transmittal_number := revenue_pkg.transmittal_number_for_receipt(original_receipt);
place_value_in_cell( rowCounter, 9, nvl(to_char(original_receipt),'unknown') );
place_value_in_cell( rowCounter, 10, nvl(to_char(original_date,'mm/dd/yyyy hh24:mi:ss'),'unknown') );
place_value_in_cell( rowCounter, 11, nvl(to_char(original_transmittal_number),'unknown') );
-- COMPTROLLER COLUMNS
IF ( alert_response = ALERT_BUTTON1 and nvl(:transactions.rg_approval,'N') <> 'N' )
THEN
place_value_in_cell( rowCounter, 12, to_Char(sysdate,'mm/dd/yyyy') );
place_value_in_cell( rowCounter, 13, nvl(:transactions.rg_approval,'N') );
place_value_in_cell( rowCounter, 14, nvl(to_char(:location.vt_number),'NULL') );
END IF;
End If;
exit when :SYSTEM.LAST_RECORD = 'TRUE';
NEXT_RECORD;
rowCounter := rowCounter + 1;
END LOOP;
END Export_The_Data;
/* ----------------------------------- main procedure --------------------------------------*/
BEGIN
Begin
my_alert_id := Find_Alert('THREE_BUTTON_ALERT');
IF NOT ID_NULL( my_alert_id ) then
alert_Response := SHOW_ALERT( my_alert_id );
If (alert_response = ALERT_BUTTON1) OR
(alert_response = ALERT_BUTTON2) then
old_Cursor_style := get_application_property( CURSOR_STYLE );
set_application_property( CURSOR_STYLE, 'BUSY' );
Open_EXCEL_WorkBook;
Write_Column_Headers;
Export_The_Data;
Else
Raise Form_Trigger_Failure;
End If;
Else
Raise Form_Trigger_Failure;
End If;
exception
when Form_Trigger_Failure then
RAISE;
when Ole_Error then
AlertSend( 'There was an error exporting the data to Microsoft Excel (receipt# ' | |
to_Char(:transactions.transaction_Group_eid) | | ')', false );
errors_occurred := TRUE;
when others then
AlertSend( SQLERRM, false );
errors_occurred := TRUE;
End;
Ideally, I'd like to call SaveSpreadsheet in Export_The_Data, and just ExitExcel here,
but it prompts for whether to save the changes and I don't know how to get around that
right now. SO, we just save and exit, regardless.
SaveSpreadSheet;
-- Release the OLE objects
ole2.release_obj (worksheet);
ole2.release_obj (worksheets);
ole2.release_obj (workbook);
ole2.release_obj (workbooks);
ole2.release_obj (application);
IF NOT errors_occurred then -- stay on the record that caused the error
Go_Record( local_cursor_Record );
End If;
Set_Application_Property ( CURSOR_STYLE, old_cursor_style );
EXCEPTION
When Form_Trigger_Failure then
null;
When Others then
AlertSend( SQLERRM );
END export_transactions_to_excel; -
Export query results to a CSV file
Hi,
My requirement is I need to export the results of a query to a CSV file. Can anyone please suggest a way to include the column names also in the CSV file?
Thanks in advance.
AnnieFollowing code is from asktom. I have modified to include column heading. This will get your desired CSV file for a given query.
create or replace function dump_csv( p_query in varchar2,
p_separator in varchar2
default ',',
p_dir in varchar2 ,
p_filename in varchar2 )
return number
AUTHID CURRENT_USER
is
l_output utl_file.file_type;
l_theCursor integer default dbms_sql.open_cursor;
l_columnValue varchar2(2000);
l_status integer;
l_colCnt number default 0;
l_separator varchar2(10) default '';
l_cnt number default 0;
l_colDesc dbms_sql.DESC_TAB;
begin
l_output := utl_file.fopen( p_dir, p_filename, 'w' );
dbms_sql.parse( l_theCursor, p_query, dbms_sql.native );
for i in 1 .. 255 loop
begin
dbms_sql.define_column( l_theCursor, i,
l_columnValue, 2000 );
l_colCnt := i;
exception
when others then
if ( sqlcode = -1007 ) then exit;
else
raise;
end if;
end;
end loop;
dbms_sql.define_column( l_theCursor, 1, l_columnValue, 2000 );
l_status := dbms_sql.execute(l_theCursor);
dbms_sql.describe_columns(l_theCursor,l_colCnt, l_colDesc);
l_separator := '';
for lColCnt in 1..l_colCnt
loop
utl_file.put( l_output, l_separator || '"' || Upper(l_colDesc(lColCnt).col_name) || '"');
l_separator := p_separator;
end loop;
utl_file.new_line( l_output );
loop
exit when ( dbms_sql.fetch_rows(l_theCursor) <= 0 );
l_separator := '';
for i in 1 .. l_colCnt loop
dbms_sql.column_value( l_theCursor, i,
l_columnValue );
utl_file.put( l_output, l_separator || '"' ||
l_columnValue || '"');
l_separator := p_separator;
end loop;
utl_file.new_line( l_output );
l_cnt := l_cnt+1;
end loop;
dbms_sql.close_cursor(l_theCursor);
utl_file.fclose( l_output );
return l_cnt;
end dump_csv;The original link is below.
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:95212348059
Thanks,
Karthick. -
Exporting BI Publisher 11g ouput to Excel 2007 with over 65,000 records
Hi All,
I have seen information that BI Publisher 11.1.1.5 allows sending BI Publisher reports directly into native Excel 2007. Will this automatically allow reports with over 65,000 records to be saved in a single Excel 2007 sheet? If so, is it possible to do this in BI Publisher 11.1.1.3 which I am currently using or must I upgrade to 11.1.1.5 to get this functionality?
Will BI Publisher 11.1.1.5 also work with Excel 2010 to be able to load reports with over 65,000 records into a single Excel 2010 sheet?
Thanks for any information that will help me find a solution to this issue.
Barrywell, i did some research, and indeed, to be able to output as .xlsx you would need an update to 11.1.1.4, as it is the first one which supports Excell 2007/10.
*[url http://www.java-forums.org/blogs/advanced-java/collection/]Java collection* -
Exporting query results into a csv file using arabic and hebrew chars
Hi,
iv'e encountered a problem, using plsql to export a query into a csv file.. the arabic turns into question mark. Do you have any idea why?Usually this indicates a mismatch between client and database character set.
How do you export this query?
What is your database version?
What is your client OS?
T. -
HOW TO Export Entire Page Report, Not Just Regions, To CSV or Excel?
I need to export a main report (Page 2014) that consists of 5 different regions (Name, Feature, States, Admin Areas, and Maps), as one CSV file.
I know that I can set each of the 5 different region's report attributes to export by enabling the CSV output to Yes.
But , since my main report (Page 2014) has these many regions, I end up with 5 different CSV files.
There is no attribute to set for the main report (Page 2014) to enable it to export as CSV output.
How can I get an all-encoompassing CSV file of the main report (Page 2014)?
Thank you in advance,
MaggieHello Maggie,
>> How can I get an all-encoompassing CSV file of the main report (Page 2014)?
This might be possible using the advanced print server configuration, with BI Publisher, using the same technique that is being used to print master-details reports (which is a type of a multi-region report) - http://www.oracle.com/technology/products/database/application_express/html/configure_printing.html . The standard print server configuration only supports reports with a single region. If you have BIP in your organization, that’s great. Otherwise, CSV files don’t warrant it.
The only other option, I can see, is to create the CSV file manually, using the technique described in the following Blog entry, by Scott Spendolini - http://spendolini.blogspot.com/2006/04/custom-export-to-csv.html .
Regards,
Arie. -
Export ALV to excel automatically???
hi experts.
i want to run my ALV report on daily shedule basis like 11:00 in night in background.now i want to also save it automatically after completion of background job..
how can i save my ALV list to excel automatically on daily basis.????Hi,
GUI_DOWNLOAD doesn't work in background use dataset. Refer below code.
*--Local Variables
DATA : l_erfile TYPE string.
*--Clear file
CLEAR : l_erfile.
l_erfile = p_aefile.
*--Open dataset for output mode to transfer the error log
OPEN DATASET l_erfile FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc EQ c_ok.
IF NOT it_erfile[] IS INITIAL.
LOOP AT it_erfile INTO st_erfile.
TRANSFER st_erfile TO l_erfile.
CLEAR : st_erfile.
ENDLOOP.
*--Error Log downloaded on given path
MESSAGE i000 WITH text-005.
ELSE.
*--Legacy Data Created Successfully
MESSAGE i000 WITH text-004.
ENDIF.
ENDIF.
Regards,
Prashant -
HELP - Export Files from Data Set into Excel (CSV File)
Hello,
I was hoping someone could help me with adobe forms since this is the first time we have used this function at my work. We created an enrollment form, posted it online and 700 employees completed the form (with the submit button it came back to my email). I received all the forms and added them to the dataset in adobe. Now that my forms are complete, I have tried several options to export them into a csv file and it is not working properly. When I use the export button it only brings over 125 of the 700. If I export by clicking on forms>manage form data>merge files into a spreadsheet it brings them all over but is moving my information on some of the rows. For example, some names will be in the name column, some are under social security, etc. I need the exact answer under the appropriate column becuase I can't tell which plan employees chose. I would really appreciate if someone could help. I have searched and searched for the reason this is doing this but I can't seem to locate an answer. Is there another step that I'm missing? Does anyone know why my rows are shifting? We tried to test this before we used it and it seemed to work fine but we only used 5 files. Please Please Please Help Me! This enrollment file is due by tomorrow!
Thank You,
MaryI've moved your post to the Acrobat Windows user to user forums. You might also want to consider the Adobe moderated Acrobat forums here:
http://www.acrobatusers.com/forums/aucbb/index.php
Kind Regards,
Michelle -
How to upload the web query result to CSV/Text file
Hi,
Kindly help me on the following.
1) I have info-provider (IP), which has info-objects "company code" and "supplier".
2) I built a query by putting company-code with a variable in free-charateristics and supplier-code in row.
3) When I run this query, it will ask company-code as input and the result will be filtered using company-code.
4) For this query, I created a web-template and assigned data-provider to display the data on the web.
5) The user wants to enter input company-code='1000' and write the data in a CSV file in a specific directory. i.e, by clicking the execute button (after entering company code) , the result should go to the CSV or text file. i.e. the application should automatically generate the file with query results.
Note: The user should not use context menu to EXPORT TO CSV OR EXCEL file.
Please let me know, if there is any tutorial. Thanks a lot advance help.
Regards
Kandasamy1. SELECT INTO
Below method will create table when data is inserted from one table to another table. Its useful when you need exactly same datatype as source table.
Use AdventureWorks2008R2;
Go
---Insert data using SELECT INTO
SELECT AddressLine1, City
INTO BothellAddresses
FROM Person.Address
where City = 'Bothell';
GO
---VERIFY DATA
Select AddressLine1, City
FROM BothellAddresses
---DROP TABLE
DROP TABLE BothellAddresses
GO
2. INSERT INTO SELECT
Below method will need table to be created prior to inserting data. Its really useful when table is already created and you want insert data from
another table.
Use AdventureWorks2008R2;
Go
---Create Table
CREATE TABLE BothellAddresses (AddressLine1 NVARCHAR(60), City NVARCHAR(30))
---Insert into above table using SELECT
INSERT INTO BothellAddresses(AddressLine1, City)
SELECT AddressLine1, City
FROM Person.Address
where City = 'Bothell';
---VERIFY DATA
Select AddressLine1, City
FROM BothellAddresses
---DROP TABLE
DROP TABLE BothellAddresses
GO
Regards,
Vishal Patel
Blog: http://vspatel.co.uk
Site: http://lehrity.com
Maybe you are looking for
-
I opened an attachment and can't get rid of it or return to my other messages. No back button or buttons of any kind. Any suggestions?
-
Can anyone tell me how to create a custom welcome screen that people will see when they log on to my Airport network? Macbook Pro, 2GHx CD, 512 MB Mac OS X (10.4.9)
-
hello, i am new in labview and was given a task to create a vi like the stated above.. can anyone help me..??
-
Thumbnail opens window to watch youtube...how?
I want a thumbnail to display the HTML widget that has the embed code (or even the youtube widget) for a youtube in a properly sized window (say 50px bigger than video). I have looked at a lot of Tips & Tricks type web sites, and have not been able t
-
Not charging!!!!! Plz help
I Hav iphone 5 bout 2 years old, it was briefly submerged in river, I opened it up and dryed out the phone with help from YouTube vids, the phone worked normally execpt camera didn't work anyway, it was working fine but when it was plugged in to char