Creating CSV ETL from ValueObject collection

Hey all,
Suprisingly, I can not find a lot of information regarding direct ETL/export from a javabean collection (i.e. a ValueObject collection from EJB) into a CSV for export. Part of the ETL is to map specific javabean properties to the CSV in a particular order.
I know it's possible to write something along the lines of:
myVO.getMyfield1() + "," + myVO.getMyfield5 + "," + myVO.getMyfield3;But, looking for something a little more elegant and easier to maintain.
I know using some reporting tools (i.e. JasperReport) you can do something like that, but that seems like more maintance than one would want for simple data extraction process.
Anyone have any experience in this they would like to share?
Thanky,
-D

anybody? Is this that hard?

Similar Messages

  • Stored Proc to create .csv file from table

    Hi all,
    I have a table with 4 columns and 10 rows. Now I need a stored proc to create a .csv file from the table data. Here the scripts to create a table and insert the row's.
    Create table emp(emp_id number(10), emp_name varchar2(20), department varchar2(20), salary number(10));
    Insert into emp values ('1','AAAAA','SALES','10000');
    Insert into emp values ('2','BBBBB','MARKETING','8000');
    Insert into emp values ('3','CCCCC','SALES','12000');
    Insert into emp values ('4','DDDDD','FINANCE','10000');
    Insert into emp values ('5','EEEEE','SALES','11000');
    Insert into emp values ('6','FFFFF','MANAGER','90000');
    Insert into emp values ('7','GGGGG','SALES','12000');
    Insert into emp values ('8','HHHHH','FINANCE','14000');
    Insert into emp values ('9','IIIII','SALES','20000');
    Insert into emp values ('10','JJJJJ','FINANCE','21000');
    commit;
    Now I need a stored proc to create a .csv file in my local location. Please let me know If you need any other details....

    Some pointers:
    http://www.oracle-base.com/articles/9i/GeneratingCSVFiles.php
    http://tkyte.blogspot.com/2009/10/httpasktomoraclecomtkyteflat.html
    also, doing a search on this forum or http://asktom.oracle.com will give you many clues.
    .csv file in my local location.What is your 'local location'?
    A client machine? The database server machine?
    What database version are you using?
    (the result of: select * from v$version; )

  • How to create .csv file from ABAP report

    Hi
    We have a requirement to generate .csv file from abap report.
    Currently user saves data from abap report to spreadsheet(.xls format) in desktop.  Then opens excel file and save as .csv format.  Need option to save directly in .csv format instead of .xls format.
    Please let me know, if there is any standard function module available to create .csv file.
    Regards
    Uma

    I tried with your code it's going to dump
    REPORT ZTEMP101 message-id 00.
    tables: lfa1.
    types: begin of t_lfa1,
          lifnr like lfa1-lifnr,
          name1 like lfa1-name1,
          end of t_lfa1.
    data: i_lfa1 type standard table of t_lfa1,
          wa_lfa1 type t_lfa1.
    types truxs_t_text_data(4096) type c occurs 0.
    data: csv_converted_table type table of TRUXS_T_TEXT_DATA.
    select-options: s_lifnr for lfa1-lifnr.
    select lifnr name1 from lfa1 into table i_lfa1
           where lifnr in s_lifnr.
    CALL FUNCTION 'SAP_CONVERT_TO_CSV_FORMAT'
    EXPORTING
       I_FIELD_SEPERATOR          = ';'
             I_LINE_HEADER              =
             I_FILENAME                 =
             I_APPL_KEEP                = ' '
      TABLES
        I_TAB_SAP_DATA             = I_LFA1
    CHANGING
       I_TAB_CONVERTED_DATA       = csv_converted_table
    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.
    CALL FUNCTION 'WS_DOWNLOAD'
    EXPORTING
      BIN_FILESIZE                  = ' '
      CODEPAGE                      = ' '
       FILENAME                      =
       'C:\Documents and Settings\ps12\Desktop\Test folder\exl.cvs'
      FILETYPE                      = 'DAT'
      MODE                          = ' '
      WK1_N_FORMAT                  = ' '
      WK1_N_SIZE                    = ' '
      WK1_T_FORMAT                  = ' '
      WK1_T_SIZE                    = ' '
      COL_SELECT                    = ' '
      COL_SELECTMASK                = ' '
      NO_AUTH_CHECK                 = ' '
    IMPORTING
      FILELENGTH                    =
      TABLES
        DATA_TAB                      = csv_converted_table
      FIELDNAMES                    =
    EXCEPTIONS
      FILE_OPEN_ERROR               = 1
      FILE_WRITE_ERROR              = 2
      INVALID_FILESIZE              = 3
      INVALID_TYPE                  = 4
      NO_BATCH                      = 5
      UNKNOWN_ERROR                 = 6
      INVALID_TABLE_WIDTH           = 7
      GUI_REFUSE_FILETRANSFER       = 8
      CUSTOMER_ERROR                = 9
      OTHERS                        = 10
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    my version is 4.6c

  • Inserting Record into CSV file from BizTalk Orchestration

    Scenario:
    1.Receive file from Source system via RecvPipeline
    2.In Orchestration  extracting some values like ENO,Ename,Salary etc.these values to be added in to CSV file from Expression Shape.How to append/add emp records in to CSV with out overriding the rows.
    Ex:If we submitted 10 files then the CSV file should contain 10 rows in CSV.
    Let me know how to create CSV file from Orchestration and how to add rows into that csv value
    Regards BizTalkWorship

    Simple.
    Receive the message through a Receive Port/Location.
    Create a flat-file schema representing the CSV file structure. Ensure each row is delimited by “{CR}{LF}”. 
    This flat-file schema should only contain the element which you want to see in the destination CSV file like ENO,Ename,Salary etc.
    Have a map where the source schema should be the one which represents the received file and destination schema should be the one which is above created flat-file schema.
    Map the source schema to the destination schema mapping the filed 
    ENO,Ename,Salary etc.
    Have a custom send pipeline with flat-file assembler component it. Use this send pipeline in the send port.
    In send port, configure the send filter like “BTS.ReceivePortName == YourReceivePortName”. Configure the send port’s “Outbound Maps” to the map which you have created in
    above step
    Key Point. In your send port, set the “Copy Mode” property to “Append” from default “Create New”
    With your send port’s, “Copy Mode” property configured to “Append” this will append the value of the output to the existing file. Since in your flat-file schema, each record
    is delimited by “{CR}{LF}” and since you’re overwriting the output file you will have one file with records appended. So if 10 files received, instead of 10 output files, you will have 1 CVS file with 10 rows.
    If you want to construct the message in Orchestration as do, you do as opposed to map in send port at outbound map you can still do.
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • Recently, when I create a new album (untitled), it immediately fills with picture either from the album above it or, if I have a Faces collection open, with the pictures from that collection. Why and how do I fix it?

    Recently, when I create a new album (untitled), it immediately fills it immediately fills with picture either from the album above it or, if I have a Faces collection open, with the pictures from that collection. Why and how do I fix it?

    When a new album is created it will fill with whatever is in the right hand window,  If you're in the Events or Photos mode it will contain all photos in the library.  Yes, strange behavior.
    OT

  • SSIS 2008 – Read roughly 50 CSV files from a folder, create SQL table from them dynamically, and dump data.

    Hello everyone,
    I’ve been assigned one requirement wherein I would like to read around 50 CSV files from a specified folder.
    In step 1 I would like to create schema for this files, meaning take the CSV file one by one and create SQL table for it, if it does not exist at destination.
    In step 2 I would like to append the data of these 50 CSV files into respective table.
    In step 3 I would like to purge data older than a given date.
    Please note, the data in these CSV files would be very bulky, I would like to know the best way to insert bulky data into SQL table.
    Also, in some of the CSV files, there will be 4 rows at the top of the file which have the header details/header rows.
    According to my knowledge I would be asked to implement this on SSIS 2008 but I’m not 100% sure for it.
    So, please feel free to provide multiple approaches if we can achieve these requirements elegantly in newer versions like SSIS 2012.
    Any help would be much appreciated.
    Thanks,
    Ankit
    Thanks, <b>Ankit Shah</b> <hr> Inkey Solutions, India. <hr> Microsoft Certified Business Management Solutions Professionals <hr> http://ankit.inkeysolutions.com

    Hello Harry and Aamir,
    Thank you for the responses.
    @Aamir, thank you for sharing the link, yes I'm going to use Script task to read header columns of CSV files, preparing one SSIS variable which will be having SQL script to create the required table with if exists condition inside script task itself.
    I will be having "Execute SQL task" following the script task. And this will create the actual table for a CSV.
    Both these components will be inside a for each loop container and execute all 50 CSV files one by one.
    Some points to be clarified,
    1. In the bunch of these 50 CSV files there will be some exception for which we first need to purge the tables and then insert the data. Meaning for 2 files out of 50, we need to first clean the tables and then perform data insert, while for the rest 48
    files, they should be appended on daily basis.
    Can you please advise what is the best way to achieve this requirement? Where should we configure such exceptional cases for the package?
    2. For some of the CSV files we would be having more than one file with the same name. Like out of 50 the 2nd file is divided into 10 different CSV files. so in total we're having 60 files wherein the 10 out of 60 have repeated file names. How can we manage
    this criteria within the same loop, do we need to do one more for each looping inside the parent one, what is the best way to achieve this requirement?
    3. There will be another package, which will be used to purge data for the SQL tables. Meaning unlike the above package, this package will not run on daily basis. At some point we would like these 50 tables to be purged with older than criteria, say remove
    data older than 1st Jan 2015. what is the best way to achieve this requirement?
    Please know, I'm very new in SSIS world and would like to develop these packages for client using best package development practices.
    Any help would be greatly appreciated.
    Thanks, <b>Ankit Shah</b> <hr> Inkey Solutions, India. <hr> Microsoft Certified Business Management Solutions Professionals <hr> http://ankit.inkeysolutions.com
    1. In the bunch of these 50 CSV files there will be some exception for which we first need to purge the tables and then insert the data. Meaning for 2 files out of 50, we need to first clean the tables and then perform
    data insert, while for the rest 48 files, they should be appended on daily basis.
    Can you please advise what is the best way to achieve this requirement? Where should we configure such exceptional cases for the package?
    How can you identify these files? Is it based on file name or are there some info in the file which indicates
    that it required a purge? If yes you can pick this information during file name or file data parsing step and set a boolean variable. Then in control flow have a conditional precedence constraint which will check the boolean variable and if set it will execute
    a execte sql task to do the purge (you can use TRUNCATE TABLE or DELETE FROM TableName statements)
    2. For some of the CSV files we would be having more than one file with the same name. Like out of 50 the 2nd file is divided into 10 different CSV files. so in total we're having 60 files wherein the 10 out of 60 have
    repeated file names. How can we manage this criteria within the same loop, do we need to do one more for each looping inside the parent one, what is the best way to achieve this requirement?
    The best way to achieve this is to append a sequential value to filename (may be timestamp) and then process
    them in sequence. This can be done prior to main loop so that you can use same loop to process these duplicate filenames also. The best thing would be to use file creation date attribute value so that it gets processed in the right sequence. You can use a
    script task to get this for each file as below
    http://microsoft-ssis.blogspot.com/2011/03/get-file-properties-with-ssis.html
    3. There will be another package, which will be used to purge data for the SQL tables. Meaning unlike the above package, this package will not run on daily basis. At some point we would like these 50 tables to be purged
    with older than criteria, say remove data older than 1st Jan 2015. what is the best way to achieve this requirement?
    You can use a SQL script for this. Just call a sql procedure
    with a single parameter called @Date and then write logic like below
    CREATE PROC PurgeTableData
    @CutOffDate datetime
    AS
    DELETE FROM Table1 WHERE DateField < @CutOffDate;
    DELETE FROM Table2 WHERE DateField < @CutOffDate;
    DELETE FROM Table3 WHERE DateField < @CutOffDate;
    GO
    @CutOffDate which denote date from which older data have to be purged
    You can then schedule this SP in a sql agent job to get executed based on your required frequency
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Create String from all Collection Items

    Hi all, I've been using Project Siena for the last week and I'm having a lot of fun with it.
    Right now, I'm having a problem creating a string comprised of all the rows of a particular collection.
    I am trying to generate the string for an email body. So far I have a 1 column collection called EmailCollection. It consists of rows of text with the appropriate URL Encoded characters. I would like to be able to export all the rows of this
    collection to a string, and then add this string into the Launch(mailto:) body variable.
    Let me know if I'm not being clear with this, and thanks for any help in advance!
    Elliot

    Thanks for the reply, StonyArc. I actually used your original thread to get me started until I ran into problems with exporting the entire single column collection to a concatenated string. I found a way to get it working, though it's not an elegant solution
    and it wont work if the number of rows in the collection changes.
    I'll try to explain it here, and if anyone else can think of a better way, I'd like to try it :)
    I needed to create an URL encoded string for my emails which consisted of the relevant pricing information from a Collection with 8 rows called NewPricingCollection. 
    Collect(EmailPricing, Substitute(Substitute(Substitute(Concatenate(NewPricingCollection!SetupItem,": ", NewPricingCollection!NewAmount, " ", NewPricingCollection!UnitType, "s ($", NewPricingCollection!TotalPrice, ")"), " ", "%20"), "$", "%24"), ":", "%3A"));
    This created a single column collection with 8 rows which looked like this: SetupItem: 5 Units ($TotalPrice). I used the substitute function to replace the non-URL friendly characters with their encoded equivalents. I'm not sure if this is the best
    practice use of the Substitute function by the way.
    Once I had the Single Column Collection, I couldn't find a way to concatenate the contents of each row into a single string. I was able to use the Lookup function to retrieve the first row of the collection, but that was it. Note that I may be using the
    lookup function incorrectly too :)
    I ended up using Last and LastN Functions to retrieve the specified number of rows from the end of the collection. Then I used the Lookup function to retrieve the string from the first row of each retrieved collection, then concatenated it together as a
    single string - along with the rest of the email body.
    LookUp(EmailPricing, Result in EmailPricing, Result) & "%0A" & LookUp(LastN(EmailPricing,7), Result in EmailPricing, Result) & "%0A" & LookUp(LastN(EmailPricing,6), Result in EmailPricing, Result) & "%0A" & LookUp(LastN(EmailPricing,5), Result in EmailPricing, Result) & "%0A" & LookUp(LastN(EmailPricing,4), Result in EmailPricing, Result) & "%0A" & LookUp(LastN(EmailPricing,3), Result in EmailPricing, Result) & "%0A" & LookUp(LastN(EmailPricing,2), Result in EmailPricing, Result) & "%0A" & LookUp(LastN(EmailPricing,1), Result in EmailPricing, Result)
    This created a string that looked like this inside of an email body:
    SetupItem1: 5 Units ($TotalPrice)
    SetupItem2: 5 Units ($TotalPrice)
    SetupItem3: 5 Units ($TotalPrice)
    SetupItem4: 5 Units ($TotalPrice)
    SetupItem5: 5 Units ($TotalPrice)
    SetupItem6: 5 Units ($TotalPrice)
    SetupItem7: 5 Units ($TotalPrice)
    SetupItem8: 5 Units ($TotalPrice)
    As you can see it will only work correctly with a collection of 8 rows, so if the number of items changes, then I'll need to find a better solution. 

  • Create xml from a collection type

    can anyone please explain me how to create an xml from a neseted table

    Hi Mario,
    Thanks for letting us know about this problem. I have logged a bug on this.
    If you should find any more problems like this, please let us know.
    Thanks,
    David

  • Creating CSV format/files from Objects

    Hi,
    Context : I need to convert a linear object (having only one level of member variables) into CSV format.
    Progress: I have been able to create CSV format if strings are passed.
    Requirement: However, I was wondering if it is possible to create the entire CSV at one shot, instead of having to pass the object members separately, as this wud turn out to be very cumbersome for objects with lots of members...
    Is there a way to create a csv file or formatted text, if given a linear object?
    Any pointers appreciated
    Cheers!
    Nick

    i was wondering....
    if the class is dynamically created at runtime, then we would not be able to build such a functionality. Any thoughts?

  • Is there a way to create a playlist from the now playing screen on ios7?

    Is there a way to create a playlist from the now playing screen on ios7? I want to be able to hear a song in my collection and immediately add it to an existing playlist or create a new playlist.
    Thank you in advance

    Hi Cornellius,
    From the now playing screen there's a Create button at the bottom that allows you to create a
    Genius Playlist
    New Station form Artist
    New Station from Song
    IPhone Help, Browse and play
    http://help.apple.com/iphone/7/#/iph3cf21a82
    The Now Playing screen provides playback controls and shows you what’s playing.
    For information on Genius Playlists, see
    Archived - Genius for iPod and iPhone
    http://support.apple.com/kb/HT2978
    I don't see an option to add it to an existing playlist.
    Best Regards,
    Nubz

  • How to delete photos from a collection

    Hi,
    The fact that I can't delete a photo when I'm browsing a collection is now one of the few things that really hampering my LR experience. The issue occurs even more often than it needs to because I often need to open several photos in Photoshop from which to create a final composite image. The quickest way to do this is to select them all and choose "Edit in Photoshop". However this create TIFFs for each file that I won't want to keep, so I then need to delete all but one of them.
    I'm hoping that I've just missed something obvious...
    At the moment I have to select the photo(s) that I want to delete, right click, choose to view them in the library, press the delete key, confirm the fact that I really would like to remove the files from the disk, then press the "back" button to get back to my collection view. Hardly quick.
    If the photos aren't all in the same folder then this doesn't work at all since there is no common folder. From the collection view there's simply no way of knowing if this is the case.
    I've tried using the Quick collection to group all the photos that I want to delete, however you can't delete them from there either.
    I've tried using the reject flag to flag all the ones that I want to delete, but that doesn't help either. All you can do with the rejected photos is to remove them from the collection; the reject flag isn't sticky across collection and the folder view.
    I really need an efficient way to delete multiple files from a collection view. Is there one?
    Thanks,
    Tim

    There is a three key combo for this. See the appropriate to your OS PDF in the FAQ, top of forum list, for a comprehensive Keyboard SHortcut list, including operators for Find.
    Don
    Don Ricklin, MacBook 2Ghz Duo 2 Core running 10.5.1 & Win XP, Pentax *ist D
    See LR Links list at my
    Blog for related sites.

  • How to Generate CSV Output from JD Edwards BI Publisher

    Hi All,
    I have a report "Critical Date Report" - R15611 in JD Edwards 8.11. This report has to be generated as CSV output from BI Publisher which is embedded to JDE.
    The purpose we want use BI Publisher is to move some of the data displaying to different place in the page(ex: Move the company address from top left corner to Bottom right corner).
    In order to achieve this
    1.We created blank rtf template and upload to XML repository using P95600 application
    2.Create report definition using P95620 application
    3.Here I see the available output types as PDF,RTF,HTML,EXCEL,POWERPOINT and XML,ETEXT(GRAYED OUT)
    Which output type we can use for CSV ?
    4.Execute the report definition of the critical date report from P95620 to get the XML source
    5.This XML source will be loaded into the blank rtf template
    6.From this point no idea how to design the rtf template in order to get the CSV output.
    7.We did design and output type as excel - but the result data is not in good formatting and alignment*(Headers and footers are repeating).*
    If any one has worked on similar type of requirement,let us know how to do or send a sample XML source,rtf template and how the CSV output will be. Or any document link present in Oracle site will be helpful. Please let me know if you need more details.
    Thanks in Advance.
    Vijay

    Hi Vijay,
    For CSV output, you need an E-text template (not RTF) that's why its grayed out! You can use Excel as output type and have (No headers and footers) , then you can open the file in Excel and store it as CSV. Does not always display correctly though.
    Why are you compelled to use BI publisher? you can use the JDE standard csv output report, (as is used by most EDI systems) of course this may involve a bit of customization if you wants the fields arranged differently.
    -Domnic

  • How to generate CSV ouput from JD Edwards 8.11 using rtf template

    Hi,
    I have a report "Critical Date Report" - R15611 in JD Edwards 8.11. This report has to be generated as CSV output from BI Publisher which is embedded to JDE. why we choose the output in BI Publisher is to move some of the data displaying to different place in the page(ex: Move the company address from top left corner to Bottom right corner).
    In order to achieve this
    1.We create blank rtf template and upload to XML repository using P95600 application
    2.Create report definition using P95620 application
    3.Here I see the available output types as PDF,RTF,HTML,EXCEL,POWERPOINT and XML,ETEXT(GRAYED OUT)
    Which output type we can use for CSV ?
    4.Execute the report definition of the critical date report from P95620 to get the XML source
    5.This XML source will be loaded into the blank rtf template
    6.From this point no idea how to design the rtf template in order to get the CSV output.
    7.We did design and output types as excel - but the result data is not in good formatting and alignment.
    If anyone has worked on similar type of requirement,let us know how to do or send a sample XML source,rtf template and how the CSV output will be.
    Thanks in Advance.
    Vijay

    Ive replied to your other post.

  • How to display all value of metadata from nodes collection model in content presenter template

    Hi All,
    first of all the new look of OTN is great.
    coming to problem i am facing (i dont know whr to ask here or in portal forum).
    i am creating a content presenter template to display list of items.
    now as per requirement i need to create a drop down to filter the list.
    now while check- in a file author would choose a value in one metadata field lets say xCategory(which is a single select list).
    i have to display similar category list on portal to allow user to filter list.
    i could hv used view of xCategory but problem is files are targeted to role using ACL. so u see i cant display all category to all users.
    also customer wants this whole thing to be Dynamic i.e. they can add value of xCategory later that to could be only for specific role (on portal it should be role specific , author can see whole list not a problem there).
    so what i think is if content is given as search result so the category. so now if i can get the all xCategory metedata from 'nodes' collection model in template i can create drop down with out having any additional bean.
    somthing like this
    #{nodes.xCategory} (but this one is not correct).
    please suggest me any solution.
    thanks
    -somesh

    Hi,
    you can do all of what you said with JSF. ADF Faces provides drag and drop functionality (have a look at the Web Developer Guide) that allow you to move nodes within a tree. The drag and drop framework sends an event notification to the server with a reference to the changed node.You can also have context menus on a tree node to help users creating, deleting and editing a tree nodes. JavaScript isn't required at all, even if you wanted to drag and drop a row in a table on top of a tree node to create a new tree node.
    I just finished a book project in which we explained this usecase. As soon as I find the time, I'll follow up with a blog entry on this as it seems to be a common requirement. However, as mentioned, the web developer guide on OTN explains drag and drop in ADF Faces pretty well.
    However, if you choose the "Search" link above, choose JDeveloper and ADF as the product to search for and type drag and drop as the search string, then you get lots of code sample posted in the past to this forum
    Frank

  • How to move an existing Application/Package Deployment from one collection to another

    We'd like to move an Application Deployment from one collection of devices to another. Instead of just creating a new deployment (which would make the app try to reinstall) we'd like to move the existing deployment.
    Any way to do this with PowerShell?

    Creating a new deployment won't make an app try to reinstall at all. That's the whole point of the Detection method.
    For packages, clients keep track of what they've run before so a new deployment won't cause it to run again unless the program is set for it to run again.
    Ultimately, you cannot change the collection targeted by a deployment as this violates a f underlying assumptions and messes up compliance/reporting for that deployment. You need to create a new deployment which as pointed out has no down-side.
    Jason | http://blog.configmgrftw.com

Maybe you are looking for