Query Output to CSV file
Hi,
I am trying to export a Query result to CSV in comma-delimited tab format.
In SBO it is allowing to save the query results as CSV file; but when I opened
it is in 'Text Unicode' filetype.
Is there anyway save it directly as CSV in comma-delimited tab format.
Thanks Regards
Shiva
Hi Gordon,
Sorry could not reply soon.
Its a smiple query
"SELECT ItemCode, ItemName, ItmsGrpNam,
LeadTime, VATLiable, CardCode"
The things is we might make some changes to it based on customer requirement. But the fact is no matter what query, I have no problem with query. It is while saving it is making a 'tab-delimited' file rather than 'comma-delimited file'. User has to manually open it and save it as CSV file.
Regards
Shiva
Similar Messages
-
To download the query output to falt file
Hi all,
i have a query which i know will give more than 65k records as the output for a selection.
i cannot run this query in excel due to its limitation.
if i run on web i cannot download this as downloading is happening to excel file only.
The customer ideally wants to download the query result to a text file(csv,tab-delimited etc) which inturn it will upload to MS-Access.
How do i achieve this?
SAP has given response use try using these options:
1.open interfaces to receive the output of a query via the MDX language.
2.open hub tool as it is designed for big amounts of data.(i suppose this is not possible as i want to download query output not the data target contents)
how do i achieve my scenario with option 1?
Are there any alternatives??
Any useful help will be rewarded.
Regards,
Dhanya.hi vivek,
thnks for the useful reply.
i have some problem with my ID,hence loggin in through my coleague's ID.
i will assign u points as i get logged in.
I did as u said by downloading it to unconverted format.
the file got download to a text file.where the output has
1.header rows(10 lines almost)
2.the values r coming in single quotes e,g:
'144000023073 'TAAS SETTLEMENT CONV 738 '19333000 '30.09.2006 '0.000
how can i remove all this?
Regards,
Dhanya
I -
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 -
Sql query to downloaded csv file
Hi.
This is probably something really easy, but I cant find how to do it.
I want to run a dynamic SQL query and have the output appear in csv format as a file the user can save to disk.
Is this easy, if so how? Or is there a longer packaged based solution to this?
Regards,
AsimAsim,
First you need to create a report, you can use a simple SQL query based report, or if your query is dynamic, use a region of type PL/SQL function returning SQL query. Then go to the reports attributes page and enable the CSV link for that report. When running your report page, youâll notice a CSV export link that lets your download your report as a CSV file.
Alternatively, If you donât want to run the report as a regular HTML DB page at all, then you could just choose the CSV template as the report template on the reports attributes page. When running the page with that template, it opens a file download dialog for the CSV file right away. You could integrate this with your own application by placing a âdownloadâ button on some other page, that on clicking of this button branches to the CSV download page and by doing so, lets you download the file.
Marc -
Spool output to .csv file - having issues with data display
Hi,
Need to deliver the output of a select query which has around 80000 records to a .csv file. A procedure is written for the select query and the procedure is being called in the spool script. But few of the columns have comma(,) in the values. For Example, there is a personal_name column in the select query which says the name as " James, Ed". Then output is displayed in different columns. Hence the data is being shifted to the right for the remaining columns.
Could some one help fix this issue. I mainly used a procedure as the select query is about three pages and hence want the script to look clear.
Script is,
set AUTOPRINT ON ;
set heading ON;
set TRIMSPOOL ON ;
set colsep ',' ;
set linesize 1000 ;
set PAGESIZE 80000 ;
variable main_cursor refcursor;
set escape /
spool C:\documents\querys\personal_info.csv
EXEC proc_personal_info(:main_cursor);
spool off;Hi,
set PAGESIZE 80000 ;is not valid and it will print header as default every 14 rows.
You can avoid printing the header in this way:
set AUTOPRINT ON ;
set heading ON;
set TRIMSPOOL ON ;
set colsep ',' ;
set linesize 1000 ;
set PAGESIZE 0 ;
set escape /
set feedback off
spool c:\temp\empspool.csv
SELECT '"'||ename||'"', '"'||job||'"'
FROM emp;
spool offThe output will look like this in this case
"SMITH" ,"CLERK"
"ALLEN" ,"SALESMAN"
"WARD" ,"SALESMAN"
"JONES" ,"MANAGER"
"MARTIN" ,"SALESMAN"
"BLAKE" ,"MANAGER"
"CLARK" ,"MANAGER"
"SCOTT" ,"ANALYST"
"KING" ,"PRESIDENT"
"TURNER" ,"SALESMAN"
"ADAMS" ,"CLERK"
"JAMES" ,"CLERK"
"FORD" ,"ANALYST"
"MILLER" ,"CLERK"You can also consider creating a unique column by concatenating the columns in this way:
spool c:\temp\empspool.csv
SELECT '"'||ename||'","'||job||'"' In this case the output will look without spaces between columns:
"SMITH","CLERK"
"ALLEN","SALESMAN"
"WARD","SALESMAN"
"JONES","MANAGER"
"MARTIN","SALESMAN"
"BLAKE","MANAGER"
"CLARK","MANAGER"
"SCOTT","ANALYST"
"KING","PRESIDENT"
"TURNER","SALESMAN"
"ADAMS","CLERK"
"JAMES","CLERK"
"FORD","ANALYST"
"MILLER","CLERK"Regards.
Al
Edited by: Alberto Faenza on May 2, 2013 5:48 PM -
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 -
How to generate report output in csv file and send it to user email inbox
Hi All,
We have requiremnt to generate the csv file from the report (Bex query)automatically and need to send that file automatically to user email address every week.
It should be done automatically and one more thing the file name should contain that particuar date
for example if we generate file automatically today the file name should be like below.
US_04_15_2009.CSV
Any one have any ideas?
Regards,
SirishaHi Arun Varadarajan.
Thanks for your reply.We are in BI 7.0.Can you tell me how to broadcast the query as CSV.Please let me know if there is any possiblity to display or change the file name dynamically based on system date.
Regards,
Sirisha
Edited by: sirisha Nekkanti on Apr 16, 2009 4:08 AM -
Save query output as .csv, .xls
I am looking to save a bunch of query paramenters into a csv
file. i am currently playing around with cffile, cfcontent,
cfheader, but i dotn know what the best approach is. Ultimately i
want save dialog to pop up and allow the user to save it to the
desired location with desired name. what is the best way to do this
in cold fusion?
Thanks
DrewUse cfheader and cfcontent to get the pop up. Use table tags
to format your data. -
Inserting a satment that allows otpu of a query to a CSV file
Hi,
I have have been informed that a UTL file will not be required. A simple CSV file is all that is wanted.(Pass the results of the select clause into the csv).
So can anyone help me place such a command into the below script, where the results of the select clause can be sent to a CSV file.
Thanks.
declare
from_date DATE :='09-dec-2007';
to_date DATE :='22-dec-2007';
cursor date_range is
select a.Item_ID , b.shipnode_key, b.quantitY as ONHAND
from YFS_INVENTORY_ITEM a, YFS_INVENTORY_Supply b
where b.Supply_TYPE = 'ONHAND'
and b.Inventory_item_key = a.Inventory_item_key;
begin
l_output := dbms_output.put.fopen('Stock_Mirroring',' YFS_INVENTORY_ITEM a, YFS_INVENTORY_Supply b||to_date||.csv','w');
for l_count in date_range loop
dbms_output.put_line(l_output,
l_count.a.Item_ID||'|'||
l_count.b.shipnode_key||'|'||
l_count.b.quantitY);
end loop;Outputting to a CSV file - responses should stay in that thread.
-
Query on formating CSV file.
Hi All,
According to my business logic i need to read data from DataBase and need to create CSV file to represent that data. I am able to create CSV file. But i want to format the cells of the CVS file. means like, i want to change the back groung color of a cell. Is it possible to do changes to the cells of CSV file through JAVA program?.
Regards,
Naga.A CSV is, as definition, a comma separated values format.
It can contain only text and you cannot give any formatting definition, neither via Java nor via an editor. -
ABAP Query output to XML file using Business connector
Hi All,
I would request your help on to know, how can I read the output of ABAP query executed in SAP system via Business connector and then generate a XML file.
Also the existing business connector system, generates the XML file in encoding iso-8859-1. Where as customer wants the output XML file in encoding windows-1252.
Please help with your valuable ideas.
Thanks,Hello,
possible solution:
1. create a remote function module (FM) in SAP which returns your needed data
2. create outbound map in BC for this FM
3. call this FM from BC in a flow
3. extract the result to XML (e.g. with service recordToDocument)
CSY -
Hi,
By using Query (SQ01), we are able to download data in Excel format, Text format, etc. But... is there an option that I can download in CSV format.
Thanks.....
Rgds,
KianHi Kian,
you could save the Excel file in CSV format, couldn't you?
Regards
Bernd -
Saving jsp query results to csv file
I have a query form jsp application which does as you would expect - throw in some search parameters - results set is returned - my question is how I go about writing an instance to save these results into a csv notepad file. I've used JBuilder a lot and within that it is relatively simple to create a save-to-file instance - is it the same within JDeveloper?? Sorry if this is a fairly obvious question - I just havent come across anything in the docs yet
Try this in a JSP:
<%
response.setContentType( "text/x-csv" );
response.setHeader( "Content-disposition", "inline;filename=myfilename.csv" );
%>
"value1","value2","value3"
"valueX","valueY","valueZ" -
Query Output to download in flat file through APD or other means?
Hello Experts,
I am currently on BW3.5 system and have requirement to load query output in flat file in .csv format. I checked the option of APD but looks like we cant directly load the query output in flat file like in APD (BW 3.5 system) .
One way i can think of it...load the query output in transactional ODS and built an infospoke on it to write into flat file.
Please advice if there are any better methods to store the query output in flat files.
Thanks!Hi,
Use RSCRM_BAPI.
See
Re: RSCRM_Bapi
See the help on RSCRM_BAPI
Re: Running Quaries automatically and saving them in as a Excel file in Server
Re: Data transfer to external systems
Re: Loading from a Custom R/3 Table
Re: How can I schedule my Bex report to execute in background
Re: How can I insert the RSCRM_BAPI into Process chain?
Thanks
Reddy -
How to get sql query data and write into csv file?
I am writing to seek help, in how can I create bat. script which can execute the following logic:
connection to the database
run sql query
create CSV file
output query data, into CSV file
save the CSV file
osql
-S 84.18.111.111
-U adw
-P rem
-i "c:\query.sql"
send ""
sed -e 's/,\s\+/,/g' MCI_04Dec2014.csv > localNoSpaces.csv
-o "c:\MCI_04Dec2014.csv"
This what i have so far, and I am little struggling with the logic after creating CSV file. I am unable to get the above script to work, please advice further, where I may be going wrong.
Can you create if statement logic within window's script, to check for null parameters or data feeds?
Any hints would be most appreciated.Thank you for your reply.
Apology for posting the code irrelevant to the forum, as I am still novice scripting user.
My goal is to create window's script which can compute the above logic and send the final output file (csv), to FTP folder.
Can this logic be implemented via bat. script, if so, is there a example or tutorial i could follow, in order to achieve my task.
Any help would be much appreciated.
Maybe you are looking for
-
My daughter has entered the wrong passcode too many times on her iPOD Touch, it is now disabled. When I connect to iTunes, it will not let me go any further until I enter the correct passcode. I no longer get the option to do this, all I get is iPO
-
Do I need a server version or not?
Hi All I am new to iCal. I would like to use it as a shared calendar on our network in the office (4 users) to keep track of what each other are doing and to schedule tasks for each other. This means each user needs to be able to add New Events and N
-
My iphone 4 said it was searching for signal then told me i needed to restore it and once i tried to restore it wouldnt allow me to complete restoring it, so my phone is disable
-
Sales Order status is CLSD, RA is still processed
We have been working on Closing old MTO sales orders to shorten the month-end processing time. Most have been successful. However, there are some order that we set the status to CLSD and the order still process through RA. Other order (those we se
-
Dear All, I have a problem with format left side in Cross Tab Report. When I design Reports using Cross Tab and I view it, it works well in Crystal Reports. But When I upload it to Crystal Report Server 2008, the left side become to the center. I do