Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CTL & WHEN CLAUSE Oracle

Status
Not open for further replies.

einyel

Technical User
May 29, 2003
32
ES
Hi all,

I load a flat file into a table via CTL (loader).
This flat file contains records for years 2001, 2002, 2003, 2004, 2005 and I only have to load records till current year.

Example
LOAD DATA
INFILE 'D:\TRANSFER\BBMF04.TXT'
INTO TABLE SIFI.COMMITMENT_INPUT &quot;&quot;&quot;&quot;&quot;WHEN (31:34) <= CURRENT YEAR &quot;&quot;&quot;&quot;&quot;
FIELDS TERMINATED BY ';' OPTIONALLY ENCLOSED BY '&quot;'
( IAN POSITION(16:30) CHAR &quot;TO_NUMBER:)IAN)&quot;,
AÑO POSITION(31:34) CHAR &quot;TO_NUMBER:)AÑO)&quot;,...and some other fields....


My question is:
Is there any way I can put a when clause to filter only the desired records till current year ? or do I have to build a work table?

Thanx in advance

Angel
 
I'm no sqlldr expert, so I cant help you with any control file syntax. However, my suggestion is to load your data in full into a temporary table then use a database procedure to load only the data you require into your main table.
 
That was my thought... : (

Thanx

Einyel
Functional&Technical Cognos Consultant
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top