Remove column name in generated CSV file through ODI
Hi,
I want to remove the column names in CSV file which I am creating through database.
I have tried putting "heading to zero in the the datastore", which I created for csv file, but it is not working.
Please assist.
Thanks,
Sudeep Naik
Okay let me explain.After creating your csv file you open it.If 1st row contains column name then during reverse you use heading as 1. Regarding c1,c2 these are the column name defined by odi.Its not going to come as your data.The way i told you just make it by giving header 1 then reverse it.After that just drag it to your interface.Then on interface right click on source table and click on view data.Here you can find if your column name is coming as data or not.Hope you are clear now.
Thanks.
Similar Messages
-
Add header record with column names while writing csv file fileAdapter?
Hi I am writing the output of a query to csv file using fileadapter. but the file generated does not have the header record with the column names. how can I achieve this. please help.
I'm trying to do the same, but something is not right with my syntax and I haven't been able to resolve all day. Can someone spot what I'm doing wrong?
Here is the variable with the data I want to insert as the headers for the CSV:
Updated variable "CPARWebJEHeaders"
<CPARWebJEHeaders>
<Root-Element xmlns="http://xmlns.oracle.com/CPWebJEARWrite">
<CPARWebJE>
<Project>Project</Project>
<Organization>CC_Org</Organization>
<Account>Account</Account>
<TransactionAmount>Amount</TransactionAmount>
<TransactionDesc>Description</TransactionDesc>
</CPARWebJE>
</Root-Element>
</CPARWebJEHeaders>
Here is the InputVariable data for my invoke to the File Adapter:
[2008/03/24 15:27:30] Updated variable "WriteCPARWebJEFile_Write_InputVariable"
<WriteCPARWebJEFile_Write_InputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Root-Element">
<Root-Element xmlns="http://xmlns.oracle.com/CPWebJEARWrite">
<ns0:CPARWebJE xmlns:ns0="http://xmlns.oracle.com/CPWebJEARWrite">
<ns0:Project>INV08-00002</ns0:Project>
<ns0:Organization>1.6.1.1.01</ns0:Organization>
<ns0:Account />
<ns0:TransactionAmount>176</ns0:TransactionAmount>
<ns0:TransactionDesc />
</ns0:CPARWebJE>
<ns0:CPARWebJE xmlns:ns0="http://xmlns.oracle.com/CPWebJEARWrite">
<ns0:Project>INV08-00001</ns0:Project>
<ns0:Organization>1.6.1.1.01</ns0:Organization>
<ns0:Account />
<ns0:TransactionAmount>305.46</ns0:TransactionAmount>
<ns0:TransactionDesc />
</ns0:CPARWebJE>
</Root-Element>
</part>
</WriteCPARWebJEFile_Write_InputVariable>
This is my latest iteration of the insertBefore command, which is done right after the transformation populating the variable above:
<bpelx:assign>
<bpelx:insertBefore>
<bpelx:from variable="CPARWebJEHeaders" query="/ns12:Root-Element/ns12:CPARWebJE"/>
<bpelx:to variable="WriteCPARWebJEFile_Write_InputVariable" part="Root-Element"/>
</bpelx:insertBefore>
</bpelx:assign>
And finally, here is the current error message:
<selectionFailure xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/">
<part name="summary">
<summary>Assign Operation Misuse. The parent of the selection result does not exist or is not an XML element; insertBefore operation cannot be performed. Please check the BPEL source at line number "96" .</summary>
</part>
</selectionFailure>
I understand the error message, but for the life of me can't get it resolved. Trying to change the "to" variable, I can't even get the process to deploy. FYI this is on 10.1.2 and I can't go to 10.1.3 yet, but I think this is a syntax issue and not related to the version.
Thanks!
Message was edited by:
user623606 -
Crystal report - generate CSV file through Java interface
Hi,
I need to generate a Character Seperated File through Crystal Report 10 using Java.
What constant stands for CSV Format and what value of SI_PROGID we can provide to pull the CSV format.
Eg. SI_PROGID = ceProgID.EXCEL or SI_PROGID = ceProgID.PDF .....
Currentlly we are crystalLibs.jar to connect the Crystal server.
Thanks In AdvanceIn BusinessObjects Enterprise installations, the following ProgIDs are valid.
CrystalEnterprise.Analytic
CrystalEnterprise.AppFoundation
CrystalEnterprise.Calendar
CrystalEnterprise.Category
CrystalEnterprise.Connection
CrystalEnterprise.Designer
CrystalEnterprise.Destination
CrystalEnterprise.DiskUnmanaged
CrystalEnterprise.Event
CrystalEnterprise.Excel
CrystalEnterprise.Folder
CrystalEnterprise.FavoritesFolder
CrystalEnterprise.Ftp
CrystalEnterprise.Hyperlink
CrystalEnterprise.Inbox
CrystalEnterprise.InfoView
CrystalEnterprise.LicenseKey
CrystalEnterprise.Managed
CrystalEnterprise.MyInfoView
CrystalEnterprise.ObjectPackage
CrystalEnterprise.Overload
CrystalEnterprise.Pdf
CrystalEnterprise.PersonalCategory
CrystalEnterprise.Powerpoint
CrystalEnterprise.Program
CrystalEnterprise.Report
CrystalEnterprise.Rtf
secEnterprise
secLDAP
CrystalEnterprise.Server
CrystalEnterprise.ServerGroup
CrystalEnterprise.Shortcut
CrystalEnterprise.Smtp
CrystalEnterprise.Txt
CrystalEnterprise.Universe
CrystalEnterprise.User
CrystalEnterprise.UserGroup
CrystalEnterprise.Webi
CrystalEnterprise.Word -
Needs to generate CSV file through DME
Hi Experts,
I am using DME to generate certain file, the file format is supposed to contain a fixed number of fields even if most are empty, with each field delimited or separated by comma (using CSV Standard File Format), and not tab or space delimited.
While customising the file through T-Code DMEE, file gets generated but not in CSV format due to which Bank system unable to read the data.
Please help me out in getting the file in the required format.
Its an urgent issue, hence looking for a quick reply from the experts.
Thanks in Advance
Regards,Hi Experts,
Please help me out....
Regards -
Can we create .CSV files through documaker
Hi,
Is it possible to create .csv files through documaker apart from pdf's
ThanksWith apologies, it is still unclear (to me) what you are asking.
It is possible to create files using DAL, but to offer more specific guidance requires a better understanding of what it is that you want.
A CSV is a Comma-Separate Value file. A PDF file is a printed document file containing formatted text content, graphics, lines, boxes, etc - in other words a fully-composed document. I'm not exactly sure how a PDF and a CSV file could contain the same data.
Are you perhaps asking to get an index of the created PDF files written as a CSV file? Something that contains a row of key transaction data along with the file name of the generated PDF? Perhaps something akin to the batch (BCH) files that can be produced per transaction recipient?
Are you asking for an export file of all the field data that went into the creation of the document and included in the PDF? Normally a CSV has a header that describes the columns and then each row of data would be consistent with that header. Without knowing that every PDF file you create will have exactly the same number of fields defined, it is difficult to imagine that a single CSV file would be sufficient. And depending upon the number of fields and the size of the data assigned to each, this could be quite a long record per PDF in the resulting CSV file.
Or perhaps you had in mind to get a name / value pair written for each field with data written on separate lines? This would not a be a true CSV file, but could have the name and values separated by commas if that is what you require.
You have something specific in mind and yet, we are not in your mind. We need more specific information on exactly what you are trying to accomplish. -
I was told I was able to generate out a CSV file through UTL_FILE method. Can someone provide the skeleton of how should I create it in PL/SQL?
I tried google search but it only says in words and not code itself.
I have this PL/SQL that I will want to generate a CSV file.
SET SERVEROUTPUT ON;
SET TIMING ON;
DECLARE
CURSOR C1
IS
select balance from contract ;
BEGIN
FOR i IN C1 LOOP
IF i.balance <> '0' THEN
DBMS_OUTPUT.PUT_LINE('Amount is not 0 ');
I will like to put the statement 'Amount is not 0 ' in a CSV file here
else
DBMS_OUTPUT.PUT_LINE('Amount is 0 ');
END IF;
end loop;
END;
/How am I suppose to do this?
Edited by: JoannaLee on Aug 26, 2008 7:14 PMYour question is a bit confusing. In your subject line, and again in your question, you talk about generating a CSV file. That is a file of comma-separated values (hence the acryonym). But your question seems to be asking about generating a file with a sentence in it-- that would be a flat file but not a CSV file.
The links that were provided show you exactly how to generate a CSV file based on an arbitrary query.
If you are not looking to generate a CSV file, and instead you just want to generate a flat file to which you can write data, you'd just need to use the UTL_FILE package. Assuming you're on a recent version of Oracle, you would need to create a directory object, i.e.
CREATE DIRECTORY directory_name AS 'path_to_directory_on_database_server'Then you'd grant privileges on that directory object to whatever user will own the procedure that wants to write to the directory
GRANT read, write ON directory_name TO some_userIn your code, you'd just need to open the file and write to it
DECLARE
l_file utl_file.file_type;
BEGIN
l_file := utl_file.fopen( 'DIRECTORY_NAME', 'name_of_file', 'w' );
<<Other code>>
utf_file.put_line( l_file, 'String you want to write to the file' );
<<More code>>
utl_file.fclose( l_file );
END;Justin -
How to use resource bundle entries for column names/title in .rpt file
<p>Our application needs to be able to support reporting in multiple languages. Hence we do not want to put language specifiec column names in the rpt file but rather use text for a particular locale during runtime which in java world is easily achievable using Resource Bundle entries.</p><p>Does JRC allow for using resource bundle entries as column names or for that matter for titles etc. in the .rpt file?</p>
Hi,
You can follow this step-by-step tutorial to find out how to achieve this using our User Function Libraries (UFLs). The walkthrough can be found here:
<a href="http://diamond.businessobjects.com/node/412">http://diamond.businessobjects.com/node/412</a>
Regards,<br />Sean Johnson (CR4E Product Manager) <br /><br /> <a href="http://www.eclipseplugincentral.com/Web_Links-index-req-ratelink-lid-639.html">Rate this plugin @ Eclipse Plugin Central</a> -
How can I generate CSV file from a select query without having any loop .Is there any in build function which can directly generates trhe csv ?
I am using oracle 10g .My be you can try with and an SQL
create directory root as 'C:\';
declare
vclob clob := empty_clob();
begin
with mydata as
select
l || 'a' data1
, l || 'b' data2
, l || 'c' data3
, row_number() over(order by l) curr
, (row_number() over(order by l)) - 1 prev
from
ta
select
replace(ltrim(max(sys_connect_by_path(data1 || ',' || data2 || ',' || data2,':')), ':'), ':', chr(13))
into
vclob
from
mydata
start with
curr = 1
connect by
prior curr = prev;
dbms_advisor.create_file(buffer => vclob
,location => 'ROOT'
,filename => 'mycsv.csv'
end;
/I guess i will get lot of scolding form gurus and experts for above code :P
Regards,
Amit -
VISA: How to get the CSV file through C/C++ code?
How to get the CSV file through C/C++ code?
I'm communicating with a USB oscilloscope using VISA.Thank you for your reply.
I am using Apache Commons File Upload. Here is the code where I got the "fi".
DiskFileUpload fu = new DiskFileUpload();
fu.setSizeMax(1000000000);
List fileItems = fu.parseRequest(request);
Iterator itr = fileItems.iterator();
FileItem fi = (FileItem)itr.next();
if(!fi.isFormField())
File tempFileRef = new File(fi.getName());
System.out.println("Field = "+tempFileRef.getAbsolutePath());
} -
Extracting data from Essbase & loading into flat file through ODI
Hi,
I want to extract data from Essbase and load it into a flat file through ODI(for extraction from essbase I'm using a report script) and I’m using these KM’s:- LKM Hyperion Essbase data to SQL,IKM SQL to FILE Append & for reversing I’m using RKM Hyperion Essbase.All the mappings have been done and the interface has been made. But when I’m executing the interface it is throwing the error below:-
ODI-1217: Session ESS_FILEI (114001) fails with return code 7000.
ODI-1226: Step ESS_FILEI fails after 1 attempt(s).
ODI-1240: Flow ESS_FILEI fails while performing a Loading operation. This flow loads target table ESS_FILE.
ODI-1228: Task SrcSet0 (Loading) fails on the target FILE connection FILE_PS_ODI.
Caused By: java.sql.SQLException: ODI-40417: An IOException was caught while creating the file saying The system cannot find the path specified
at com.sunopsis.jdbc.driver.file.impl.commands.CommandCreateTable.execute(CommandCreateTable.java:62)
at com.sunopsis.jdbc.driver.file.CommandExecutor.executeCommand(CommandExecutor.java:33)
at com.sunopsis.jdbc.driver.file.FilePreparedStatement.execute(FilePreparedStatement.java:178)
at oracle.odi.runtime.agent.execution.sql.SQLCommand.execute(SQLCommand.java:163)
at oracle.odi.runtime.agent.execution.sql.SQLExecutor.execute(SQLExecutor.java:102)
at oracle.odi.runtime.agent.execution.sql.SQLExecutor.execute(SQLExecutor.java:1)
at oracle.odi.runtime.agent.execution.TaskExecutionHandler.handleTask(TaskExecutionHandler.java:50)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.processTask(SnpSessTaskSql.java:2906)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2609)
at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:537)
at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:453)
at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:1740)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$2.doAction(StartSessRequestProcessor.java:338)
at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:214)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:272)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$0(StartSessRequestProcessor.java:263)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$StartSessTask.doExecute(StartSessRequestProcessor.java:822)
at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:123)
at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$2.run(DefaultAgentTaskExecutor.java:82)
at java.lang.Thread.run(Thread.java:619)
Please let me know what I'm missing and how I can resolve this error.
ThanksIt seems that you are trying to use the file as your staging areas. Hyperion LKM extracts essbase data into a DB staging area which can then be used by your file IKM to load it into file.
You need to use a RDBMS for your staging area. -
Generating CSV file with column names and data from the MySQL with JAVA
Hi all,
Give small example on ...
How can I add column names and data to a CSV from from MySQL.
like
example
sequence_no, time_date, col_name, col_name
123, 27-apr-2004, data, data
234, 27-apr-2004, data, data
Pls give small exeample on this.
Thanks & Regards
Rama KrishnaHello Rama Krishna,
Check this code:
Example below exports data from MySQL Select query to CSV file.
testtable structure
CREATE TABLE testtable
(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
text varchar(45) NOT NULL,
price integer not null);
Application takes path of output file as an argument.
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;
import java.sql.ResultSet;
import java.sql.SQLException;
public class automateExport {
public static void main(String[] args) {
DBase db = new DBase();
Connection conn = db.connect(
"jdbc:mysql://localhost:3306/test","root","caspian");
if (args.length != 1) {
System.out.println(
"Usage: java automateExport [outputfile path] ");
return;
db.exportData(conn,args[0]);
class DBase {
public DBase() {
public Connection connect(String db_connect_str,
String db_userid, String db_password) {
Connection conn;
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
conn = DriverManager.getConnection(db_connect_str,
db_userid, db_password);
} catch(Exception e) {
e.printStackTrace();
conn = null;
return conn;
public void exportData(Connection conn,String filename) {
Statement stmt;
String query;
try {
stmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_UPDATABLE);
//For comma separated file
query = "SELECT id,text,price into OUTFILE '"+filename+
"' FIELDS TERMINATED BY ',' FROM testtable t";
stmt.executeQuery(query);
} catch(Exception e) {
e.printStackTrace();
stmt = null;
Greetings,
Praveen Gudapati -
Issue while generating a CSV file through Oracle.
Hi,
I am generating a CSV file using oracle stored procedure.
In an Oracle procedure I need to create a CSV file, which contains the data of a select query, and then emailing this file. Problem is that one of the field contains comma eg ('ABC,DE'). Now in the CSV file 'ABC' is shown in the one cell and 'DE' is shifted to the adjacent cell which is not required..
Thanks.Hi Welcome,
If you data contains comma then make ~ as your delimeter.
or repalce all the commas form your data.
select replace(column_name,',','') from table_name; /* before writing to the file */Regards,
Bhushan -
Uploading a csv file through XDB FTP
Hello
I'm developing a project where i need to upload a big amount of data, contained in a CSV file, on the file system of a database server and it would be great if the FTP service provided with XDB could be used to achieve such a job.
Does somebody know if XDB-FTP is able to upload files outside the XML repository and to upload them directly ( without intermediate steps that may generate heavy redo-log generation ) into a file-system on the database server?
I'd like to consider other good alternatives too, now I'm using a different FTP server but I would like to avoid this dependency.
Thanks
Bye AlessandroI finally solved the problem using a Java class that launches a daemon listening for an incoming connection, that stores the first stream on a text file and then terminates.
Definition of the java class
create or replace and compile java source named SimpleFileTransfer as
import java.net.*;
import java.io.*;
class SimpleFileTransfer {
private int port;
private int timeout;
private ServerSocket serverSocket;
private int buffSize = 8192;
private String savingFilePath;
public SimpleFileTransfer( int port, int timeout, String fname) throws IOException,SocketException {
this.port = port;
this.timeout = timeout;
this.savingFilePath = fname;
serverSocket = new ServerSocket(port);
serverSocket.setSoTimeout(timeout);
public void prepareToReceive() {
System.out.println("Preparing to receive "+savingFilePath+" on port "+port);
(new FileWriter()).start();
//System.out.println("Prepared to receive");
class FileWriter extends Thread {
Socket socket;
BufferedReader in;
PrintWriter out;
public void run() {
//System.out.println("Server started");
try {
socket = serverSocket.accept();
//System.out.println("Ready to receive");
in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
out = new PrintWriter(savingFilePath);
char arr[] = new char[buffSize];
int readBytes;
while ( (readBytes = in.read(arr,0,buffSize)) >= 0 ) {
//System.out.println("Receive data starting with "+arr[0]);
out.write(arr,0,readBytes);
out.flush();
in.close();
out.close();
catch (IOException e) {
e.printStackTrace();
//System.out.println("Terminated");
public static void activateService(int port,int timeout,String savingFilePath) /*throws SocketException, IOException*/ {
try {
SimpleFileTransfer ft = new SimpleFileTransfer(port,timeout,savingFilePath);
ft.prepareToReceive();
catch (IOException e) {
e.printStackTrace();
public static void main(String args[]) throws IOException {
int myPort = 21000;
if (args[0].equals("server")) {
activateService(myPort,10000,"C:\\\\D.dat");
else (args[0].equals("client")) {
Socket s = new Socket("database_host",myPort);
BufferedReader in = new BufferedReader(new FileReader("D:\\\\D.dat"));
PrintWriter out = new PrintWriter(s.getOutputStream());
int readBytes;
int buffSize = 8192;
char arr[] = new char[buffSize];
while ( (readBytes = in.read(arr,0,buffSize)) >= 0 ) {
//System.out.println("Send data starting with "+arr[0]);
out.write(arr,0,readBytes);
out.flush();
in.close();
out.close();
}Definition of PL/SQL wrapping procedure to activate the daemon on the database
create or replace
procedure ENABLE_TRANSFER (
port in number,
millis_timeout in number,
saving_incoming_path varchar2
) is
language java
name 'SimpleFileTransfer.activateService(int,int,java.lang.String)';Activation of the daemon
begin
enable_transfer(21000,10000,'C:\temp\incoming.txt');
end;Sample call to the main method of the class to work as client for uploading.
prompt> java SimpleFileTransfer clientBye Alessandro -
Matching a server to an owners name in a CSV file
I am able to go through this 1000 line plus CSV file with this foreach loop to find the owner of the server. But I feel there should be a cleaner way. Here is what I have so far
$sharepoint = Import-Csv "C:\PatchCheck\SharePoint.csv"
foreach ($i in $sharepoint)
if ($i.'Server Name' -eq 'ABCARCTPACS01')
$appowner = $i.'App Owner'
Write-Host $appowner
This will work but I feel it is working to hard for what I want to do. I need to match up the 'Server Name' with the 'App Owner' for all 1000+ servers.
at some point I would like to pull this information from SharePoint where I extracted the CSV file from.
Thank you in advance for any help you can give.1000+ names in a file are trivial. YOU wl not notice it if it is not perfect.
Perhaps a tutorial on looping and code formatting would help:
Here is the melt down of your guess. A little study will explain it.
Import-Csv C:\PatchCheck\SharePoint.csv | where-object{$_.'Server Name' -eq 'ABCARCTPACS01'}
It is good that you used single quotes. Few new users know how to do that.
\_(ツ)_/ -
How to generate PDF file through reports using forms 6i
Hi all,
I am using oracle 10g with forms 6i and reports 6i.I need to generate pdf file where clicking a button a report should be called and the report should be generated as a .pdf file in the source i have specified(ex. d:\...).Is this popssible with forms?.how can i achieve this.Kindly help me with suitable answers.Thanks :)
Regards
Vidshi,
regarding report, there is a dedicated report forum. you should post there.
but answer for your question is form is nothing to do with the pdf generation. you can call the report from the as usual.
In the report you should set the properties like
destype to 'file'
desname to 'path with file name'
desformat to 'pdf'
Maybe you are looking for
-
Hi there, Mac newbie here, I've only had my mac for a month or so, but slowly getting up to speed with it. Does anyone know if there is any applications that enable users to batch edit keywords within images? I know iPhoto and Aperture perform such a
-
How to compare two fields in condition editor in receiver determination
Hello, Is it possible to compare to fields frrom the source in the condition editor of Receiver Determination? Because on the right hand operand we can specify only constants right and not the source field. For eg: If field1 != field2 then Reciever =
-
Variable Refresh button in WAD
Hi All, I would like to add a button to a web template so that after I execute the report I would like to click on the button and the variable screen pops up enabling the user to select alternative values. I am working in BI 7 and would like to know
-
Business Rule in trigger not working
Hi, I have business rule that no one below 18 years should be employed in this system. I have created a trigger that alerts me so, but when ever I insert someone either over 10 or below, it fires and deos not insert any record, but if I deleted the t
-
Rounding ist wrong for float value (MS SQL 2005)
Hello I have a simple report with a command: select num = convert(float, 4.145) Field round over "Format Field" or ToText( num, 2) the result is 4.14 -> Wrong if i use Round(num, 2) result is 4.15 --> OK In CR 8.5 result is always correct Thx