Home » RDBMS Server » Server Utilities » How to accept dynamic file name (file name format : FN_DDMMYYYY.DAT )for SQL Loader ? (Financial,3,unix/window,oracle 9i)
How to accept dynamic file name (file name format : FN_DDMMYYYY.DAT )for SQL Loader ? [message #281961] Tue, 20 November 2007 03:08 Go to next message
tapaskmanna
Messages: 98
Registered: January 2007
Location: Cyprus,Nicosia
Member
How to accept dynamic file name (file name format : FN_DDMMYYYY.DAT )for SQL Loader ?
How to extract the filename as it will be one of the input data?

Re: How to accept dynamic file name (file name format : FN_DDMMYYYY.DAT )for SQL Loader ? [message #281964 is a reply to message #281961] Tue, 20 November 2007 03:14 Go to previous messageGo to next message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:

How to accept dynamic file name (file name format : FN_DDMMYYYY.DAT )for SQL Loader ?

Use external table.

Quote:

How to extract the filename as it will be one of the input data?

How can you extract the data from a file which you don't know the name because you have to extract its name from the file which you don't know the name because...?

Regards
Michel
Re: How to accept dynamic file name (file name format : FN_DDMMYYYY.DAT )for SQL Loader ? [message #281967 is a reply to message #281964] Tue, 20 November 2007 03:22 Go to previous messageGo to next message
tapaskmanna
Messages: 98
Registered: January 2007
Location: Cyprus,Nicosia
Member
I am having Data File with a naming convention :FN_DDMMYYYY.DAT
Now while uploading data from data file to stage table then one of the date field must be updated with DDMMYYYY of FN_DDMMYYYY.
As DDMMYYYY of FN_DDMMYYYY this will be changing always.

So how to incorporate..?


Re: How to accept dynamic file name (file name format : FN_DDMMYYYY.DAT )for SQL Loader ? [message #281970 is a reply to message #281967] Tue, 20 November 2007 03:36 Go to previous messageGo to next message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Make a script that automatically generates the control file from a parameter you gave (for instance the file name or the date).

Regards
Michel
Re: How to accept dynamic file name (file name format : FN_DDMMYYYY.DAT )for SQL Loader ? [message #281976 is a reply to message #281970] Tue, 20 November 2007 04:05 Go to previous messageGo to next message
tapaskmanna
Messages: 98
Registered: January 2007
Location: Cyprus,Nicosia
Member
Thanks !!!
Re: How to accept dynamic file name (file name format : FN_DDMMYYYY.DAT )for SQL Loader ? [message #281981 is a reply to message #281970] Tue, 20 November 2007 04:23 Go to previous messageGo to next message
tapaskmanna
Messages: 98
Registered: January 2007
Location: Cyprus,Nicosia
Member
Can we write a hard coded value in Control File i.e Fixed value
like "22032007" in below contol script to be uploaded in the stage table?

Control File
-----------------------------------------------------
load data
infile '\data\FN_22032007.csv'
into table emp
fields terminated by "," optionally enclosed by '"
(empno, empname, sal, deptno,"22032007" )
----------------------------------------------------------

Re: How to accept dynamic file name (file name format : FN_DDMMYYYY.DAT )for SQL Loader ? [message #281990 is a reply to message #281981] Tue, 20 November 2007 05:30 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
Sure, look at this thread as an example.
Re: How to accept dynamic file name (file name format : FN_DDMMYYYY.DAT )for SQL Loader ? [message #281997 is a reply to message #281981] Tue, 20 November 2007 05:43 Go to previous message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Database Utilities
Part II SQL*Loader
Chapter 9 Field List Reference
Section Using SQL*Loader to Generate Data for Input
Subsection Setting a Column to a Constant Value

Regards
Michel
Previous Topic: Newbie: error during an import
Next Topic: How to take backup for only tables not other objects
Goto Forum:
  


Current Time: Sat Dec 10 12:50:50 CST 2016

Total time taken to generate the page: 0.07322 seconds