Reporting data with quotes around each column, separating with ,
I want to report data with quotes (") around the data and make is CSV.
I use colsep , to allow the comma separator, but how can I get " around each column?
I do not know the column I am dealing with, since it's over several tables from a dynamic script.
EG
set pagesize 90 linesize 1000 colsep ,
spool FND_SESSION_REP.csv
with mycount as (select count(*) numrows from FND_SESSION_REP) select vi.instance_name, vi.version, moredata.* from (select rownum r,mycount.numrows, data.* from FND_SESSION_REP data, mycount where mycount.numrows>0) moredata,v$instance vi where r>numrows-10;
spool off And I'd like
"col1","col2","col3"
etc
Possible?
SQL> select '"'||empno||'","'||ename||'"' from scott.emp;
'"'||EMPNO||'","'||ENAME||'"'
"7369","SMITH"
"7499","ALLEN"
"7521","WARD"
"7566","JONES"
"7654","MARTIN"
"7698","BLAKE"
"7782","CLARK"
"7788","SCOTT"
"7839","KING"
"7844","TURNER"
"7876","ADAMS"
"7900","JAMES"
"7902","FORD"
"7934","MILLER"
14 rows selected
SQL>
Similar Messages
-
How to export a report data with a custom file name?
Hello:
Env: OBIEE 11g Answers/Interactive Dashboards
I have a tabular report (built in Answers) and displayed in a Dashboard. I want to export the report data in csv format prefixed with the <OBIEE user login name>_<Name of the Report>_<current timestamp> on a certain folder.
Any ideas appreciated..
Thanks
Sankar Bala
Edited by: 589151 on Mar 7, 2012 6:14 AMThis does not help solve my problem.
Tabular Report->Place it in a section in a dashboard->Report Links (Export Option turned on). When doing the export, I want to change the file name as the <Login Name>_<File Name>_<Time Stamp>.csv when doing the export into csv from the dashboard.
Regards
Sankar -
Matrix report data with summary column in excel format
Hi ,
I want to display output of matrix report with summary column in excel format.
I have tried using spreadsheet but column header and actual data is displaying in proper order.
Please tell me the way how to do this ASAP.
Thanks in advance.Hi ,
I want to display output of matrix report with summary column in excel format.
I have tried using spreadsheet but column header and actual data is displaying in proper order.
Please tell me the way how to do this ASAP.
Thanks in advance. -
Region sql query(updateable report) data entry in non db columns
In a tabular report type updateable report
What is the best way to provide data entry into a non db column a) (to accept parameters for some on demand pl/sql processes)?
Only when setting a) as a standard report column the db insert/update transaction can be processed
When changing a) to text field the db insert/update transaction fails with en error (screen/db are not in sync which is not actually the case)
a) should not be part of the db insert/update transactions but still allow data entry
How can this be achieved?
Thanks
PeterHi Peter,
I think the easiest solution is to use an updateable view instead of the direct table access.
Here is an example:
CREATE OR REPLACE VIEW V_EMPLOYEES
AS
SELECT EMPLOYEE_ID
, FIRST_NAME
, LAST_NAME
, FIRST_NAME||' '||LAST_NAME AS FULL_NAME
FROM EMPLOYEES
CREATE OR REPLACE TRIGGER TRG_V_EMPLOYEES
INSTEAD OF INSERT OR UPDATE OR DELETE
ON V_EMPLOYEES
REFERENCING NEW AS new OLD AS old
FOR EACH ROW
BEGIN
IF UPDATING
THEN
UPDATE EMPLOYEES
SET FIRST_NAME = :new.FIRST_NAME
, LAST_NAME = :new.LAST_NAME
WHERE EMPLOYEE_ID = :old.EMPLOYEE_ID
-- insert and delete is not allowed
ELSIF INSERTING
THEN
NULL; -- there would be a insert code
ELSIF DELETING
THEN
NULL; -- there would be the delete code
END IF;
END;
/FIRST_NAME||' '||LAST_NAME AS FULL_NAME in the example view simulates your function call.
There might be a possibility to do it in APEX as well, but that was the first solution which came into my mind.
Patrick
Check out my APEX-blog: http://inside-apex.blogspot.com
Check out the ApexLib Framework: http://apexlib.sourceforge.net -
Downloading as dat file ... each columns in NEW LINE
HI ,
Can any one help me out in this ...
example emp table having columns empid ename salary
12 AA 123
now im downloading it as a ".dat" file , its getting downloaded but all the columns are in the same line
i have tried it with chr(13) still its not getting to next line
select empid||chr(13) ||ename||chr(13)||salary from emp .. this is how i framed the query ...
in toad its displaying with square box in between the field
required is
=======
12
AA
123 .. this is how it has to downloaded in dat file
regards,
ARUMUGAMHI,
the query is working only for wordpad .. science im dow\nloading that file as a DAT file i cn open it in execle, word also but when i open in these two its displaying all the columns values in single line and not in new line
the problem when i open in wordpad is ......... the file contains tags line <table>,<td etc > h
how could i eleminate these tags and
what could be done for getting in excel and word
regards,
ARUMUGAM -
Print report data across in excel
hello
I have report data with xml file that typically has like 50 records of data. each record will have a dynamic number of data fields that need to go into a separate column/cell into excel output table.
i.e., need to print data across (tried using for-each @column ). this works for the first record but rest of the records wont work.
any ideas or examples on how we could have an xml structure and template table formula that i could use.
report need to look like this
Table col1 col2 col3 ... and so on
data1 X ' ' ' '
data2 ' ' X ' '
... and so on
and so on
thanks
Edited by: 955878 on Sep 10, 2012 3:09 PMi got this by doing to for-each
for-each:hdrgroup
then for-each@column
this way we had to get the xml 1 dataset per each row and all columns in this row.
thanks
Subhash -
How to import data from CSV file with columns separated by semicolon?
I migrate database from MS SQL 2008 to ORACLE 11g
I export data to CSV file from MS SQL
then I try to import it to Oracle
several tables goes fine using Import data option in the SQL Developer
Standard CSV files with data separated by comma were imported.
chars, date (with format string), and integer data are imported via import wizard without problems
the problems were when I try to import table with noninteger numbers with modal part separated by comma not by dot
comma is the standard separator for columns in CSV file
so I must change the standard separator to semicolon
then the import wizard have problem to correct recognize the columns data because it use only standard CSV comma separator :-/
In SQL Developer 1.5.3 Tools -> Preferences -> Migration -> Data Move Options
I change "End of Column Delimiter" to ; but it doens't work
Is this possible to change the standard column separator for import data wizzard in SQL Developer 1.5.3?
Or maybe someone know how to import data in SQL Developer 1.5.3 from CSV when CSV colunn separator is set to semicolon?A new preference has been added to customize the import delimiter in main code line. This should be available as part of future release.
-
How create report with data from table and some columns results function ?
Hi,
How can i create on apex report region with some columns (of the report) as returned from a table and the other columns as results of plsql functions ?
for example , I want to create a report like that:
device last_date error_msg stop/start
kodak1 06/04/08 null >>
kodak2 08/03/08 good msg --^--
kodak3 08/04/08 err msg >>
3 rows returned
where the 3 first columns are data returned from the table and the forth column is the result of plsql function (returned for example false) and on that i want to display a button of start ( >> in this example ) or stop ( --^-- in this example)Thomas,
There is no problem here -- this is fully suported scenario.
1. Bind Table dataSource to Customers node.
2. Bind individual cell editors to any attribute of customer or any nested node like Address, say create column with InputField as editor, then for "value" property select Customer.Address.Street.
Your nested nodes (like Address) must be non-singleton, set singleton=false on context designer tab.
Valery Silaev
EPAM Systems
http://www.NetWeaverTeam.com -
CSV file with text qualifiers around each field causing error on Import
Hi
I have a csv file which I am trying to import - a one line extract is shown below. It is delimited by semi colon and each field has a text qualifier around it.
XXX Drinks Ltd;"BR01";"1";"001.2008";"2008";"Distribution";"-186";"-186";"-186"
When importing i get the following issue
1) BPC doesn't seem to handle the text qualifier for the fields. For example the "BR01" field above requires me to put a conversion as follows ""BR01"" i.e. I have to double the quotes because BPC adds them
2) Even after the required conversion, BPC does not like the double quotes around the amounts, even though when validating the transform I get no error message, when running the import package I get the following message
Record Count: 1
Accept Count: 1
Reject Count: 0
Skip Count
The number of failing rows exceeds the maximum specified. (Microsoft Data Transformation Services (DTS) Data Pump (8004202c): TransformCopy 'DTSTransformation__9' conversion error: General conversion failure on column pair 1 (source column 'SIGNEDDATA' (DBTYPE_STR), destination column 'SIGNEDDATA' (DBTYPE_NUMERIC)).)
Does this my source file can't have double quotes as a text qualifier?
thanks in advance
Scott FarringtonJames, thanks for your reply
does that mean that BPC can't deal with the double quotes? I understand about removing them and using a comma for a delimiter, but this is the file format I have been given.
What I really need to know is, given this format, using a transformation and/or mapping function, can I import the data the way it is?
And I still need an answer to my second point, about the error message received on running the import package,
thanks
Scott -
Data with two rows in a single column
I have been working on a report with the customer due amounts shown in bucketed columns eg 1-30 , 31-60 etc for each Customer,
so for each column I want to show an additional row with the % of the due amounts for each bucketed column.
. The format of report should look like below in pivot/table view
|Customer| |Due1-30 | Due31-60 | Due60+ | Total |
|XYZ | | 3000 | 2000 | 5000 | 10000 |
| |%Due | 30% | 20% | 50% | 100% |
ABC….
I have to get the percentages on the measure values in a separate row(not as a seperate column). Could you please help me how to get result like the format what I have shown
Thanks,
BP
Edited by: user8116383 on May 6, 2011 8:55 AMHi
This can be achievable by using Pivot view.
1.In Columns field place the customer and place the measure lables in the rows field and the measure column in measure field.
2.Duplicate the measure column and name it as %Due and click more options on this duplicated column and click shown data as -> percent of -> Row
Thanks
Diney -
Get frequent data for each column of a table
What is the best way to get the most frequent data in each column of a table.
we have around 25 tables and each table has around 20 columns , so rather than writing group by for each column of table , is there any easy way to find this?
example we have table
Column A Column B Column C
Apple Monday Red
orange Tuesday Green
Apple Monday Red
Lemon Wednesday Green
Apple Thursday Red
in this table, column A's frequnt data is Apple , column B's frequent data is Monday , Column C's frequnt data is Red
Apple 3 Monday 2 Red 3
Orange 2 Tuesday 1 Green 2
Lemon 1 Wednesday 1
Thursday 1
Group by kind of query will give this result, but with 20 tables each having 20 - 30 columns if we need similar kind of result .. is there any way to get this data.Hi,
GROUP BY (using aggregate functions) is the best way to do what you described.
PIVOT and UNPIVOT are probably what you'd want in this case. The phrase "GROUP BY" may not actually appear in your code, but you'll essentially be doing a GROUP BY.
Analytic functions (rather than aggregate functions) can do the job, too, but they'll be less efficient. Analytic functions get you results about the groups, without losing each row's identify, but in this case, losing each row's identity is eactly what you want to do. You only want 'Apple' to appear 1 time, not 3 times.
The fact that you need to do the same query on 20 different tables suggests that there's something wrong with your table design. Wouldn't it be better to have 1 big table, with a new column that has 20 unique values instead?
I hope this answers your question.
If not, please post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) from all tables involved, so that the people who want to help you can re-create the problem and test their ideas.
Also post the results you want from that data, and an explanation of how you get those results from that data, with specific examples.
Simplify the problem as much as possible. For example, instead of posting a problem with 20 tables, each having 25 columns, post a similar problem involving, say, 2 tables, each with 3 columns.
Always say which version of Oracle you're using (for example, 11.2.0.2.0).
See the forum FAQ: https://forums.oracle.com/message/9362002 -
Download int table into csv file with each column in separate column in csv
Hi All,
I want to download the data in internal table to CSV file. but each column in the table should come as separate column in csv format.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = GD_FILE
FILETYPE = 'ASC'
WRITE_FIELD_SEPARATOR = 'X'
tables
DATA_TAB = I_LINES_NEW
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17.
IF SY-SUBRC NE 0.
WRITE: 'Error ', SY-SUBRC, 'returned from GUI_DOWNLOAD SAP OUTBOUND'.
SKIP.
ENDIF.
with the above values passd , I am getting csv file but all the columns in one column separated by some square symbol.
How to separate them into different columns.
Thanks in advance
rgds,
MadhuriBelow example might help you understand on dowloading CSV file:
TYPE-POOLS: truxs.
DATA: i_t001 TYPE STANDARD TABLE OF t001,
i_data TYPE truxs_t_text_data.
SELECT * FROM t001 INTO TABLE i_t001 UP TO 20 ROWS.
CALL FUNCTION 'SAP_CONVERT_TO_TEX_FORMAT'
EXPORTING
i_field_seperator = ','
* I_LINE_HEADER =
* I_FILENAME =
* I_APPL_KEEP = ' '
TABLES
i_tab_sap_data = i_t001
CHANGING
i_tab_converted_data = i_data
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
DATA: file TYPE string VALUE 'C:\testing.csv'.
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
filename = file
CHANGING
data_tab = i_data[]
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
not_supported_by_gui = 22
error_no_gui = 23
OTHERS = 24.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Regards
Eswar -
Report data binding error unknown column name
Hi,
I am having a problem with the new 7.02 update of Report
Builder. The issue is it's not finding my SQL query.
I have wrote my query initally in the advance mode, and it
doesn't seem to reconize it. Is there an issue with this?
I did manage to fix one of my reports by using the basic mode
and selecting all my tables and seting my linkage and criteria.
I have other computers that i have not updated to 7.02 and
they do not have this issue. Below is the error:
Error Occurred While Processing Request
Report data binding error Unknown column name : work_phone.
Please try the following:
Check the ColdFusion documentation to verify that you are
using the correct syntax.
Search the Knowledge Base to find a solution to your problem.
Browser Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0;
.NET CLR 1.1.4322; .NET CLR 2.0.50727)
Remote Address 127.0.0.1
Referrer
Date/Time 13-Jul-06 02:33 PM
Stack Trace (click to expand)
coldfusion.runtime.report.Report$ReportDataBindingException:
Report data binding error Unknown column name : work_phone.
at
coldfusion.runtime.report.Report.runReport(Report.java:420)
at
coldfusion.filter.ComponentFilter.invoke(ComponentFilter.java:96)
at
coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:225)
at
coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:52)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:86)
at
coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:69)
at
coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:2 8)
at
coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
at
coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
at
coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at coldfusion.xml.rpc.CFCServlet.invoke(CFCServlet.java:106)
at coldfusion.xml.rpc.CFCServlet.doGet(CFCServlet.java:157)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at
org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:78)
at
jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
at
jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at
jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:257)
at
jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:527)
at
jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:204)
at
jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:349)
at
jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:457)
at
jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:295)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
This report works in 7.01. So all query variables match with
a variable in the SQL select statement.
Anyone have any Ideas??
Thanks,
DanielThank you very much for help.
The "Unknown column name " is a field still used in my
report, so I can't remove it.
After I clear the query in the report and reopen the report
and apply the same query back to it, I get different error message:
Element TASKNUM is undefined in QUERY.
The error occurred in : line 1
-1 : Unable to display error's location in a CFML template.
I know for sure this "Element TASKNUM is undefined in QUERY."
is defined in query. each time it complains something different. I
get really confused.
Thanks again.
Yueming -
I am going to make a ADG with around 7 columns 6 of which I am going to use checkboxes as Item renderers. Each of these 6 checkboxes renderers will be define in separate actionscript files as they will be updating different parts of the ADG data provider. Does this sound like the best option?
Well the only difference is that each checkbox effects a different attribute of the dataprovider of the ADG:
for example this renderer effects the isSelected attribute. I may want to set a different one , hope this explains it better
package
import flash.display.DisplayObject;
import flash.events.KeyboardEvent;
import flash.events.MouseEvent;
import flash.text.TextField;
import mx.controls.CheckBox;
import mx.controls.advancedDataGridClasses.AdvancedDataGridListData;
import mx.controls.listClasses.ListBase;
* The Renderer.
public class CheckBoxRenderer extends CheckBox
public function CheckBoxRenderer()
focusEnabled = false;
override public function set data(value:Object):void
super.data = value;
if(super.data.isSelected == null){
data.isSelected = false;
data.isSelected = this.selected;
invalidateProperties();
override protected function commitProperties():void
super.commitProperties();
if (owner is ListBase)
selected = ListBase(owner).isItemSelected(data);
override protected function keyDownHandler(event:KeyboardEvent):void
override protected function keyUpHandler(event:KeyboardEvent):void
override protected function clickHandler(event:MouseEvent):void
super.clickHandler(event);
if(!data.isSelected){
data.isSelected = true;
}else{
data.isSelected = false;
override protected function updateDisplayList(w:Number, h:Number):void
super.updateDisplayList(w, h);
if (listData is AdvancedDataGridListData)
var n:int = numChildren;
for (var i:int = 0; i < n; i++)
var c:DisplayObject = getChildAt(i);
if (!(c is TextField))
c.x = (w - c.width) / 2;
c.y = 0; -
How can we get Dynamic columns and data with RTF Templates in BI Publisher
How can we get Dynamic columns and data with RTf Templates.
My requirement is :
create table xxinv_item_pei_taginfo(item_id number,
Organization_id number,
item varchar2(4000),
record_type varchar2(4000),
record_value CLOB,
State varchar2(4000));
insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'USES','fever','TX');
insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'HOW TO USE','one tablet daily','TX');
insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'SIDE EFFECTS','XYZ','TX');
insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'DRUG INTERACTION','ABC','TX');
insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'OVERDOSE','Go and see doctor','TX');
insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'NOTES','Take after meal','TX');
select * from xxinv_item_pei_taginfo;
Item id Org Id Item Record_type Record_value State
493991 224 1265-D30 USES fever TX
493991 224 1265-D30 HOW TO USE one tablet daily TX
493991 224 1265-D30 SIDE EFFECTS XYZ TX
493991 224 1265-D30 DRUG INTERACTION ABC TX
493991 224 1265-D30 OVERDOSE Go and see doctor TX
493991 224 1265-D30 NOTES Take after meal TX
Above is my data
I have to fetch the record_type from a lookup where I can have any of the record type, sometime USES, HOW TO USE, SIDE EFFECTS and sometimes some other set of record types
In my report I have to get these record typpes as field name dynamically whichever is available in that lookup and record values against them.
its a BI Publisher report.
please suggestif you have data in db then you can create xml with needed structure
and so you can create bip report
do you have errors or .... ?
Maybe you are looking for
-
orignal screen when i tried to turn it on. after hours of trying it finally connected to itunes and just as it started to sync it disconnected and the screen went like this. help me please. its a 2nd gen ipod and out of warrenty.
-
In my iPad 2 sound notifications don't work anymore
In my iPad 2 sound notifications don't work anymore
-
Dear Experts, I my FI trial balance report. "#" sign is coming instead of the GL number. How to remove it from the report and replace it with the value. Please suggest. Regards
-
Can the load order of subforms be changed?
I have a form with two subforms. Subform A is a datasheet which has a Form_Current event which is suppose to call a subroutine in the main form, which in turn tries to change a control in Subform B. However, on startup, Subform B has not loaded and
-
The technical name is Elastic Time - the time is now
The technical name is Elastic Time - the time is now. http://www.sonicstate.com/news/shownews.cfm?newsid=5402 This is the future of audio editing, and I sincerely hope Logic will provide this same (or superior) functionality very soon, as it is the w