Content area
Full text
DOWNLOAD ftp.elementkjournals.com/dbm/dec00.zip Have you been asked to build a data feed yet? If your hand is in any kind of e-commerce, you'll likely be asked to build data feeds to the likes of LinkShare, AOL, Yahoo! and a multitude of other portals. Data feeds allow you to host essential e-commerce data on a high-traffic portal site.
What are data feeds? They are usually some variation of a CSV (comma separated values) file. If you're required to build a text file that's targeted for import into another database or a spreadsheet, then you'll find this article helpful. We'll build a PL/SQL package that reads a table and writes the data to disk in CSV format. You can then transfer this file to another Web site for upload into another database or application that reads CSV files.
Understanding the CSV format
The CSV format is a variation of what's commonly known as a flat file or a text file. The idea is the file consists of some sort of delimiter, and is usually one line in length to make it easy on whomever parses your file. An easy way to learn the structure is to type some information into Excel, and save it in CSV format. Then, take a look at it in a text editor. For the most part, it's pretty dull stuff, but it gets interesting when you want to embed commas and quotes in the data. For example, suppose you have the following three fields in your data record:
With some careful thought, you'll notice that there are sets of double quotes to account for the comma, and another set to account for the double quotes in the data. This is similar to our single-quote gymnastics in our dealings with string data in Oracle SQL.
Making test data
The test data used in this example comes from www.bamboogiant.com. The data is...





