Home » Other » General » Create a Table from .csv File
Create a Table from .csv File [message #266148] Mon, 10 September 2007 00:51 Go to next message
rajaobj
Messages: 9
Registered: September 2006
Location: Chennai
Junior Member

Hi Friends,
My requirement is
1.I will be getting a .csv file which has the details about the columns and datatypes.
2.I want to create a table based on this.
3.How to automate this process.

Can anybody help me out on this.

Thanks,
Raja
Re: Create a Table from .csv File [message #266151 is a reply to message #266148] Mon, 10 September 2007 00:56 Go to previous messageGo to next message
BlackSwan
Messages: 25046
Registered: January 2009
Location: SoCal
Senior Member
>1.I will be getting a .csv file which has the details about the columns and datatypes.

Good for you

>2.I want to create a table based on this.

Good for you

>3.How to automate this process.

By being smarter than the equipment you are dealing with.

Might this answer be Operating system dependent, but we don't know which?

Might this answer be dependent upon Oracle version,but we done know which.

You're On Your Own (YOYO)!


Re: Create a Table from .csv File [message #266154 is a reply to message #266148] Mon, 10 September 2007 00:59 Go to previous messageGo to next message
rajaobj
Messages: 9
Registered: September 2006
Location: Chennai
Junior Member

Actually my problem is i want a automate process for my ETL.I use to get the mapping document.everytime i need to entry this in the ETL Part(Create a table).So if i am able to automate this it will be easy for me to create a table definition in the ETL.
Re: Create a Table from .csv File [message #266160 is a reply to message #266154] Mon, 10 September 2007 01:11 Go to previous messageGo to next message
Michel Cadot
Messages: 64135
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Sorry? Ana posted 2 questions and you answer none. Instead you posted an ununderstandable blabla.
Is this an Oracle question or one for your ETL editor?

Regards
Michel
Re: Create a Table from .csv File [message #266174 is a reply to message #266148] Mon, 10 September 2007 01:49 Go to previous messageGo to next message
rajaobj
Messages: 9
Registered: September 2006
Location: Chennai
Junior Member

I heard about external tables.But can i able to perform this on External Tables
Re: Create a Table from .csv File [message #266180 is a reply to message #266174] Mon, 10 September 2007 01:57 Go to previous messageGo to next message
Michel Cadot
Messages: 64135
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
But can i able to perform this on External Tables

"this" what?
Don't you understand that nobody here knows what you want?

Regards
Michel
Re: Create a Table from .csv File [message #266187 is a reply to message #266148] Mon, 10 September 2007 02:31 Go to previous messageGo to next message
rajaobj
Messages: 9
Registered: September 2006
Location: Chennai
Junior Member

Thanks for the reply michel,
But i dont know how i am going to proceed further in this problem.
Re: Create a Table from .csv File [message #266193 is a reply to message #266187] Mon, 10 September 2007 02:52 Go to previous messageGo to next message
Michel Cadot
Messages: 64135
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Good luck.

Regards
Michel
Re: Create a Table from .csv File [message #266206 is a reply to message #266148] Mon, 10 September 2007 03:47 Go to previous messageGo to next message
Littlefoot
Messages: 20900
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
If file you are getting is the same all the time (not data, but its description), I'd rather pre-create this table (connect to SQL*Plus and issue CREATE TABLE statement). If your database version does NOT support external tables feature, you'd use SQL*Loader to take data from a file and insert those records into a table. Depending upon requirements you probably know, you might APPEND new records (which would leave old records in a table) or REPLACE old records with new ones.

If external tables feature is available to you, you might create external table and work with it as if it was an "ordinary" Oracle table; I believe you'd use some kind of SELECT (whether in SQL or even PL/SQL script).

However, if file description differs all the time, you'd first have to parse a record to find out how it looks like and - with a lot of pain (from my point of view) - create (and DROP, perhaps?) a table dynamically using the EXECUTE IMMEDIATE.

I hope (and believe) this is NOT the case - just pre-create a table, write a control file and load data using SQL*Loader.

What do you call "automating the process"? Once table is created and control file written, you'd only have to run SQL*Loader. If this file is available, for example, every day on 8:00 AM, you'd use your operating system scheduling utility.

If, on the other hand, you choose to use external tables, you might run this (PL/)SQL script using DBMS_JOB (or DBMS_SCHEDULER).
Re: Create a Table from .csv File [message #266233 is a reply to message #266148] Mon, 10 September 2007 04:43 Go to previous message
rajaobj
Messages: 9
Registered: September 2006
Location: Chennai
Junior Member

Thanks for the reply,I will try that and let u know

Thanks,
Raja
Previous Topic: Pool for Browser.
Next Topic: Why did Oracle stray from the column OWNER in DBA_SEQUENCES?
Goto Forum:
  


Current Time: Thu Dec 08 06:08:49 CST 2016

Total time taken to generate the page: 0.09498 seconds