Csv output has database column names instead of aliases as in template
Hi,
I'm trying to publish a csv report to an ftp server in a specific format and layout. The column names need to be customized. I've modified the alias name both in the data model and in the rtf layout template. But the csv still contains the data base names as in column0, column 1, etc. Does anyone know how to fix this? The html or rtf format displays the correct column names but not the csv.
output sent:
Column 0 Jane
Column 1 Doe
Column2 Female
desired output:
Name Jane
Last Name Doe
MF Female
Edited by: user556100 on Apr 30, 2013 2:25 AM
Edited by: user556100 on Apr 30, 2013 2:25 AM
As far as i know CSV output will not consider any template formatting. it will basically give output of all the columns used in select statement of SQL in comma separated format.
It is the default behavior of CSV output in bi publisher
Guru's Correct me if i am wrong
Similar Messages
-
Exporting data to a csv file and include column names
I am creating a SSIS package which creates a .csv file. The package works fine except it is not putting the column names as the first row.
How do I get the column names to also export?
Thanks,
~JohnSQL Server 2012 T-SQL has the new FORMAT command:
SELECT FORMAT(CONVERT(MONEY,123456.78),'c0','en-US'), -- $123,457
FORMAT(CONVERT(MONEY,123456.78),'c2','en-US'), -- $123,456.78
FORMAT(CONVERT(MONEY,123456.78),'c2','en-GB'), -- £123,456.78
FORMAT(CONVERT(MONEY,123456.78),'c2','de-DE') -- 123.456,78 €
Prior to SS 2012:
SELECT CONVERT(varchar(40),CONVERT(MONEY,123456.78),1) -- 123,456.78
SSIS Import/Export Wizard:
http://www.sqlusa.com/bestpractices/ssis-wizard/
Kalman Toth SQL 2008 GRAND SLAM
New Book: SQL Programming & Database Design Using Microsoft SQL Server 2012 -
Spaces in database column names
Hi folks!
Does anyone know if there is some way to reference Micosoft Access
database columns that contain spaces using Forte and ODBC?
I know it's like trying to use a jet plane to go down to the high street, but
we want to extend a (large) in-house system with a good Forte front-end.
I am aware that there are utilities available to rename entities within
Access databases, but if there is an easy way to do this in Forte we'd
prefer to go that way.
Cheers,
Duncan Kinnear,
McCarthy and Associates, Email: [email protected]
PO Box 764, McLean Towers, Phone: +64 6 834 3360
Shakespeare Road, Napier, New Zealand. Fax: +64 6 834 3369
Providing Integrated Software to the Meat Processing Industry for over 10 years
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>Duncan,
Just put the column in double quotes.
Example:
sql SELECT
,ipool.id
,asgn."Assignment Date"
,asgn.router
,asgn."Order Number"
FROM assigned_ips addr
,assignments asgn
WHERE
addr.id = asgn.Assigned_IP
AND asgn.master_ip = mpool.id
AND mpool.ip_pool = ipool.id
AND ipool.ncc = ncc.id
ORDER BY addr.id
on session accessDbSession
At 09:31 AM 6/17/99 +1200, you wrote:
Hi folks!
Does anyone know if there is some way to reference Micosoft Access
database columns that contain spaces using Forte and ODBC?
I know it's like trying to use a jet plane to go down to the high street,but
we want to extend a (large) in-house system with a good Forte front-end.
I am aware that there are utilities available to rename entities within
Access databases, but if there is an easy way to do this in Forte we'd
prefer to go that way.
Cheers,
Duncan Kinnear,
McCarthy and Associates, Email: [email protected]
PO Box 764, McLean Towers, Phone: +64 6 834 3360
Shakespeare Road, Napier, New Zealand. Fax: +64 6 834 3369
Providing Integrated Software to the Meat Processing Industry for over 10years
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/> -
How to use variable in :old. variable instead of :old.column name.
My requirement is to update the audit_update table with the old value and new value when an update statement gets executed. If i use :old.columnname the purpose is getting resolved.
My requirement is to loop through the columns taken dynamically and update the audit_update_details table. The updation is taking place in a function that called.
The first cursor holds the column name of a given table.
I have to use a statement like :old.variablename . where the variable holds the column name .
Is their an alternative?
CREATE OR REPLACE TRIGGER INSERT_EMP1
AFTER INSERT OR UPDATE OR DELETE
ON EMP FOR EACH ROW
declare
v_seq number(5);
v_result boolean;
v_col_name varchar2(20);
CURSOR FIRSTCURSOR IS
select COLUMN_NAME from user_tab_columns where table_name like 'EMP';
begin
if inserting then
INSERT INTO aud_details VALUES(seq_aud_log_id.nextval,'Emp','I','eno',:NEW.ENO);
end if;
if DELETING then
INSERT INTO aud_details VALUES(seq_aud_log_id.nextval,'Emp','D','eno',:OLD.ENO);
end if;
IF UPDATING THEN
INSERT INTO aud_details VALUES(seq_aud_log_id.nextval,'Emp','U','eno',:OLD.ENO);
select seq_aud_log_id.currval into v_seq from dual;
open FIRSTCURSOR;
LOOP
FETCH FIRSTCURSOR INTO v_col_name;
EXIT WHEN FIRSTCURSOR%NOTFOUND;
BEGIN
-- How to make the code to work successfully.
if (:old.v_col_name != :new.v_col_name) then
v_result := insert_fn('emp',:old.eno, v_col_name , :old.v_col_name, :new.v_col_name, v_seq );
end if;
end;
end loop;
THe below is an example that uses the column name .Instead of column name i need to use the variable. So that the trigger functions for any given table.
/* IF (:old.ename != :new.ename) THEN
v_result := insert_fn('emp',:old.eno, 'ename' , :old.ename, :new.ename, v_seq );
END IF;
IF (:old.dno != :new.dno) THEN
v_result := insert_fn('emp',:old.eno, 'dno' , :old.dno, :new.dno,v_seq );
END IF;
IF (:old.salary != :new.salary) THEN
v_result := insert_fn('emp',:old.eno, 'salary' , :old.salary, :new.salary, v_seq );
END IF;
END IF;
END INSERT_EMP1;
thanks,
vinodhAs Solomon said, it's not possible, but you could write a procedure that would generate the code to do it for each individual column. You could then execute the code generator procedure any time the tables DDL changed in order to update the triggers code.
-
JDBC send data to oracle, oracle only accept column name in Upper case
Hi experts,
I am doing a scenario File --> XI --> JDBC, JDBC send data to a Oracle 10g database, I have configured JDBC receiver to use XML-SQL format. in oracle database , table "EMPLOYEE" has a column "NAME", but when I send data to oracle using JDBC receiver, the column is "name", then XI complains
" 'EMPLOYEE' (structure 'insert'): java.sql.SQLException: FATAL ERROR: Column 'name' does not exist in table 'EMPLOYEE'.
can anyone help me to let oracle accpet column "name". I can't change colum in JDBC receiver from "name" to "NAME".
Thanks a lot.<i>can anyone help me to let oracle accpet column "name"</i>
Making Oracle case insensitive is not possible (in my opinion). By default all object names are stored in UPPER case in the rdbms dictionary.
When XI searches for column name in Oracle, this search is case sensitive. So u have to configure accordingly.
Regards,
Prateek -
All,
I am a new user of JSC and am hopefully running into a simple issue. I've searched the forums here but so far have not found any postings regarding my problem. Apologies if this has been asked and answered before.
I am building a webapp to display data from a MySQL database. There are several places in the schema where I need to join to the same table multiple times. I have setup the joins in the query builder and also setup a view in the database directly that does the joins. Either way, the query works fine and returns the expected data. The trouble is that the rowset underlying the dataprovider is not returning the metadata using either the table&column aliases from the query builder or the column names from the view, but rather in all cases returning the underlying table and column names. In my table component I am trying to display the data from each table.column alias distinctly but because the metadata visible to the dataprovider is the same (ie table.column), I end up with both table columns showing the same data. I've tried to track down the implementation of the metadata getter method but it is apparently in source that is not provided.
In case it matters, I'm using mysql-connector-java-5.0.3-bin.jar as the driver.
Is there something I'm missing or is there a workaround for this?
Thanks in advance,
ScottThanks,
I should have been more explicit in my description of the problem.
Example of what I have is as follows:
select table1.columnA, table2.columnA as columnX,....
from table_name as table1 join table_name as table2....
where there are other tables and columns in the select clause as well as the join conditions but where the base table and column (in the above table_name.columnA) are used twice with two different aliases. I have done this join directly in the query builder and also created a view, hiding the actual names of the columns. I can execute either query in the query builder and the columns in the result set "spreadsheet" are labeled with the base table column names, not the aliased names or the view's column names. This is causing a problem because the same thing happens when I try to bind the ui:table columns to the dataprovider. It uses the base tables' column names and I have no way to distinguish between the different aliases. If I try to manually change the jsp to refer to the aliased name or the view column name, I get an exception that the aliased tablename and or column is an invalid parameter.
Sorry if that was not clear in my original post. -
Is there any way to have the CSV Output link be a button instead of a link?
Dwayne,
Yes, but only if you create a copy of your report on another page. The steps are: copy your report page, on the copied page, edit the report attributes. Choose CSV as the template. Make sure thereâs no other content on that page. Then create a CSV button on your original page and a branch that takes you to the copied page. When pressing the button, instead of actually taking you to that page, you should get a CSV download dialog.
Hope this helps,
Marc -
Database link name does not work with JDBC.
Hi,
I am new to Oracle database. I run a query from a Java class and after waiting around 20 minutes then it returns "ORA-04021 timeout occurred while waiting to lock DBMS_LOCK" error. The query is:
select r2.EXTERNAL_ID, d.EXTERNAL_ID AS ISIMPORTED from (select external_id from results r1
where r1.*run_id = ?* and not exists
(select id from results@cdata where external_id = r1.external_id and run_id = r1.run_id)
order by r1.external_id) r2 left join dummymaindata d on r2.external_id =d.external_id;
In this query I use a database link to access another database. The strange thing is at least for me, if I use "@cdata" it always gets stuck for at least 20 minutes and end with an exception "ORA-04021 timeout occurred while waiting to lock DBMS_LOCK" but if I use any combination of the database link name instead of the "@cdata" for example "@CDATA", "@Cdata", "@cDaTA", "@CdaTa" etc., it works fine without any exception.
This starnge behavior is only with this query for using the database link name while with any other query it does not matter that how I do write the db link name.
Kindly answer.
Arshad..Hi,
1) What is your Oracle, JDBC driver, target Oracle (to which you are connecting through DB link) versions?
2) Are you using DBMS_LOCK somewhere in the code? PL/SQL procedures on the source/target servers?
3) Can you construct a complete reproducible test case? -
Dynamic column name in cfquery
I have a scenario in which database column names are in a
format COLUMN1, COLUMN2, ...COLUMNn. Number of column is not known
while coding. But usually the column names are hard code while
accessing the cfquery result like
cfqueryresult.COLUMN1.
I want to get the column names from
'cfqueryresult.ColumnList' and from that result i want to fetch the
column values.
Is it possible to achieve this in coldfusion?quote:
Originally posted by:
Dan Bracuk
quote:
Originally posted by:
Newsgroup User
And then start planing for the normalization of your database
because that is a classic de-normalized pattern that just leads to
more and more difficulties maintaining your application. Just like
this one you have just experienced!
That wasn't my interpretation. I have some reports where the
contents of a select clause depend on user input. It results in a
similar scenario to what was described in the OP.
Or maybe the OP was trying to write generic code that could
be applied to arbitrary tables.
That was the situation which resulted in my question that you
and Ian answered so helpfully: I use an Access template in which
there are forms to facilitate entry of value lists (list-id, value,
and label) and a metatable that describes each column of the actual
working table , identifies any value-list that column references,
and includes the prompt and (after processing) the HTML for that
web page element. After I define the working table in the metatable
I run a VB procedure that creates the working table and generates
all the HTML in the metatable. Finally my generic ASP (and, coming
soon, ColdFusion) references the metatable and the working table to
generate an empty form, display a form populated from a DB row for
editing, assign form values to a DB row, or delete a DB row. Same
code, any table; all I have to do is define the table and the
value-lists it needs.
This is a wonderful tool for me in a Social Sciences
department where the Professors are always designing surveys to
gather data. I can deplay a web-based survey in a few hours, and,
with your help and many hours poring over manuals, I have the first
example working in ColdFusion. And, incidentally, the ColdFusion
version is way tidier, more compact, and more readable than the ASP
version.
Dan, I'll be happy to answer other peoples' questions as soon
as I am more confident in my knowlege of ColdFusion!
-Richard
Richard Hopley
Research Associate
Department of Social Science and Health Policy
Wake Forest University Medical School
Winston-Salem, NC -
Invalid column name when executing explain plan
SQL Developer version 4.0, SQL Worksheet, Windows 2000, Database 9.2.0.6.
When attempted to run a explain plan on a simple two table join query, it generates error invalid column name. Removed aliases and simplify query to one table row count, and still get the same error. Even tried the schema owner and got the same error.
I decided to check the explain plan table and found out that it was from an older version. Recreated the explain plan table and was able to run the explain plan.
I'm just posting this in the event somebody else runs into the same problem.This was fixed in the 4.1 or 1215 build. Please update by downloading or check for updates.
-thanks
kris -
Hi,
I am using OCCI to interact with DB through code, which means I am writing a vc++ file to interact with Data Base and execute the Stored Procedure which I am calling from the C++ Code. And also displaying the output of the Stored Procedures to the Front End. I am succeeded in this, but now I should be able to display the Column names of the output to Front End. Can any one help me on this.
Example:
Sno | Sname
------- |-------------
1 ABC
2 DEF
I am getting (1,ABC) and (2,DEF) as the output of the Stored Procedure but I need the Column names also to display. How to get them.
Thanks in Advance..:)Look at Re: exporting csv via pl/sql - select statement?
It has an example how to extract the column name from a cursor. You have to check, whether you can use DBMS_SQL.DESCRIBE_COLUMNS
Your procedure might need another out parameter, that returns the column names , e.g. as comma separated list or as varray. -
I need to split a exported field from CSV file generated by Export-CSV Serverlist.csv in VMWare PowerCLI.
Get-VM * | Select Name,Notes | Export-Csv Serverlist.csv -NoTypeInformation
Current CSV output:
Name
Note
Server1 Exchange Server at HQ
Group=5
*** I need to move "Group=5" to next column instead in the same field. Every Note field have Group=x.
Name
Note Group
Server1 Exchange Server at HQ
Group=5If I understand you correctly, you want to take the csv file you just made and create a csv file with three headings: Name, Note, Group. The value for Group is currently listed in the Note field.
Import-CSV Serverlist.csv |
Select Name, @{Name="Note";Expression={($_.Note -split "Group\=")[0]}},@{Name="Group";Expression={(($_.Note -Split "(Group\=)")[1..2]) -join ""}} |
Export-CSV newServerlist.csv -NoTypeInformation -
Reading csv file how to get the Column name
Hi,
I am trying to read a csv file and then save the data to Oracle.
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection c = DriverManager.getConnection("jdbc:odbc:;Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=.;Extensions=csv,txn");
Statement stmt = c.createStatement();
ResultSet rs = stmt.executeQuery("select * from filename.csv");
while(rs.next())
System.out.println(rs.getString("Num"));
My csv file looks like this:
"CHAM-23","COMPANY NAME","Test","12",20031213,15,16
Number,Environ,Envel,Date,Time
"1","2",3,"4",5
"6","7",8,"9",9
Now is there anyway using the above code I start processing the file from the second row that holds the names of the columns and skip the first row. And also can I get the name of the column using ResultSet something like:
if columnName.equals("Number")
Because I may have a csv file that could have more columns:
"CHAM-24","COMPANY NAME","Test","12",20031213,16,76
Number,Environ,Envel,Date,Time,Total,Count
"1","2","3","4","5",3,9
"6","7","8","9",9",,2
So I want to get the column name and then based on that column I do some other processing.
Once I read the value of each row I want to save the data to an Oracle Table. How do I connect to Oracle from my Application. As the database is on the server. Any help is really appreciated. ThanksThe only thing I could think of (and this is a cluj) would be to attempt to parse the first element of each row as a number. If it fails, you do not have a column name row. You are counting on the fact that you will never have a column name that is a number in the first position.
However, I agree that not always placing the headers in the same location is asking for trouble. If you have control over the file, format it how you want. If someone else has control over the file, find out why they are doing it that way. Maybe there is a "magic" number in the first row telling you where to jump.
Also, I would not use ODBC to simply parse a CSV file. If the file is formatted identically to Microsoft's format (headers in first row, all subsequent rows have same number of columns), then it's fine to take a shortcut and not write your own parser. But if the file is not adhering to that format, don't both using the M$ ODBC driver.
- Saish
"My karma ran over your dogma." - Anon -
The column name "PERNR" has two meanings. ABAP/4 Open SQL statement.
Hi All,
Could anyone advise on what are the error I encountered at below code.
I get the error in " The column name "PERNR" has two meanings. ABAP/4 Open SQL statement." . This errors happen to all the key fields I have selected in below code (eg: pernr, subty, objps, sprps, begda, endda, seqnr).
The field zeih also encountered error in "Unknown column name "ZEIH". not determined until runtime, you cannot specify a field list."
SELECT pernr
subty
objps
sprps
begda
endda
seqnr
zlsch
ZEIH
SELECT * INTO CORRESPONDING FIELDS
OF TABLE i_pa0009
FROM pa0001 INNER JOIN pa0009
ON pa0001pernr = pa0009pernr
WHERE bukrs IN s_code AND
banks NE space.Hi,
In this query
SELECT pernr
subty
objps
sprps
begda
endda
seqnr
zlsch
ZEIH
if you have used joins and if both the database pa0001, pa0009 has the above mentioned fields you will get the error message as the control gets confused as to which table of the field you are referring to..., instead use them in this way
SELECT pa0001~pernr
for each field mention to which table it belongs and ~ before the field name in the above fashion, this will remove the error
Regards,
Siddarth -
Searching for missing column names in a single database.
I have a database with about 100 tables, database gets generated using entity framework. The application has been enhanced so users deployed with older version of the application need to upgrade to newer version. The database generated is both versions
is same name.
Now, the older version is missing some tables and column names that are in new database.
Is there a script that can search for missing fields in a single database as described in this situation?
Below is my script. Basically, nameofdatabase would the database generated and that already existing. If you install the application and database already exits no new database will be created.
SELECT * FROM (Select TABLE_CATALOG, Table_name,COLUMN_NAME FROM nameofdatabase.INFORMATION_SCHEMA.COLUMNS) a FULL OUTER JOIN (SELECT TABLE_CATALOG, Table_name,COLUMN_NAME FROM nameofdatabase.INFORMATION_SCHEMA.COLUMNS) b ON b.COLUMN_NAME=a.COLUMN_NAME and
a.TABLE_NAME=b.TABLE_NAME WHERE b.COLUMN_NAME is null or a.COLUMN_NAME is null ;There is a great tool called SQLCompare provide by www.red-gate.com
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence
Maybe you are looking for
-
Shapes, Smart Art not showing in PDF from Word 2007
Hi, I am having a strange problem. When I convert my Word 2007 document to PDF using Acrobat PDF, all the shapes and smart art that I created in Word 2007 is not appearing in the PDF. However, when I am converting either Microsoft Powerpoint or Micro
-
Weird HttpsURLConnection problem
Hi everyone, I am running a struts application on jboss 3.2.1. Part of my application deals with posting xml over https. Two problems popped up today, and because they appeared at the same time, I have a hunch they're related. 1. Our production serve
-
i have a 6230i i use windows xp and i connect to the computer via usb cable. my problem is that i plug in the cable and pc suite reads it fine execpt i click on file manager and nothings in the folders (none of my things music photos etc)same with au
-
SOA Order Booking Web Client Error
Ok, so I have gotten the SOA Order Booking Application to run. But now when I go to localhost:8888/soademo and try to log in with what they want me to I get a login error. I have checked the tables to make sure that I have the email and password righ
-
My iPod touch 5 wont respond to anything. It wont turn on. It wont charge. It wont connect to iTunes. Help!