Return-Path: <oracle-l-bounce@freelists.org>
Delivered-To: 2-oracle-l@orafaq.com
Received: (qmail 30604 invoked from network); 17 Dec 2007 13:29:55 -0600
Received: from freelists-180.iquest.net (HELO turing.freelists.org) (206.53.239.180)
  by static-ip-69-64-49-119.inaddr.intergenia.de with SMTP; 17 Dec 2007 13:29:55 -0600
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 295447DAC5D;
 Mon, 17 Dec 2007 14:29:55 -0500 (EST)
Received: from turing.freelists.org ([127.0.0.1])
 by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 21564-03; Mon, 17 Dec 2007 14:29:55 -0500 (EST)
Received: from turing (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 917707DABC8;
 Mon, 17 Dec 2007 14:29:54 -0500 (EST)
Received: with ECARTIS (v1.0.0; list oracle-l); Mon, 17 Dec 2007 13:42:30 -0500 (EST)
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 019247DA7A2
 for <oracle-l@freelists.org>; Mon, 17 Dec 2007 13:42:30 -0500 (EST)
Received: from turing.freelists.org ([127.0.0.1])
 by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 13643-09 for <oracle-l@freelists.org>;
 Mon, 17 Dec 2007 13:42:29 -0500 (EST)
Received: from smtp02.constellation.com (smtp02.constellation.com [216.99.187.52])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id AE3557DA78C
 for <oracle-l@freelists.org>; Mon, 17 Dec 2007 13:42:29 -0500 (EST)
Received: from relay.ceg.corp.net (HELO exr-msw-02.Ceg.Corp.Net) ([10.102.93.68])
  by smtp02.constellation.com with ESMTP; 17 Dec 2007 13:42:29 -0500
Received: from EXM-OMF-21.Ceg.Corp.Net ([10.103.93.33]) by exr-msw-02.Ceg.Corp.Net with Microsoft SMTPSVC(6.0.3790.1830);
	 Mon, 17 Dec 2007 13:42:28 -0500
X-MimeOLE: Produced By Microsoft Exchange V6.5
Content-class: urn:content-classes:message
MIME-Version: 1.0
Subject: RE: sql loader question
Date: Mon, 17 Dec 2007 13:42:27 -0500
Message-ID: <72AB68B424526641A8514835270C2EB502D0C7CF@EXM-OMF-21.Ceg.Corp.Net>
In-Reply-To: <121720071713.26183.4766AE410004A047000066472200734840079D9A00000E09A1020E979D@comcast.net>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: sql loader question
References: <121720071713.26183.4766AE410004A047000066472200734840079D9A00000E09A1020E979D@comcast.net>
From: "Brady, Mark" <Mark.Brady@Constellation.Com>
To: <ryan_gaffuri@comcast.net>,
 <oracle-l@freelists.org>
X-OriginalArrivalTime: 17 Dec 2007 18:42:28.0761 (UTC) FILETIME=[9341E090:01C840DC]
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by Ecartis
X-archive-position: 3980
X-ecartis-version: Ecartis v1.0.0
Sender: oracle-l-bounce@freelists.org
Errors-to: oracle-l-bounce@freelists.org
X-original-sender: Mark.Brady@Constellation.Com
Precedence: normal
Reply-to: Mark.Brady@Constellation.Com
List-help: <mailto:ecartis@freelists.org?Subject=help>
List-unsubscribe: <oracle-l-request@freelists.org?Subject=unsubscribe>
List-software: Ecartis version 1.0.0
List-Id: oracle-l <oracle-l.freelists.org>
X-List-ID: oracle-l <oracle-l.freelists.org>
List-subscribe: <oracle-l-request@freelists.org?Subject=subscribe>
List-owner: <mailto:steve.adams@ixora.com.au>
List-post: <mailto:oracle-l@freelists.org>
List-archive: <http://www.freelists.org/archives/oracle-l>
X-list: oracle-l
X-Virus-Scanned: Debian amavisd-new at localhost.localdomain

Maybe this isn't a direct answer to your question but you might try
using External Tables and/or NVL2. External Tables will give you a much
more comfortable and familiar SQL interface to your data. Also, you
should look at NVL2. It gives you the ability to specify what to do in
the event that your test is not null.

-----Original Message-----
From: oracle-l-bounce@freelists.org
[mailto:oracle-l-bounce@freelists.org] On Behalf Of
ryan_gaffuri@comcast.net
Sent: Monday, December 17, 2007 12:14 PM
To: oracle-l@freelists.org
Subject: sql loader question

I rarely use sql loader. 

I need to account for nulls and set them to January 1, 9999

I am getting errors when I try to use a to_date function in sql loader
even though I have seen examples just like this on the web. This is 10.2

my_date date "to_date(:my_date,'YYYY-MM-DD')"

I get: ORA-01821: date format not recognized

The following works:

my_date date "YYYY-MM-DD"

I am trying to get to something like this:

my_date date
"decode(:my_date,null,to_date('9999-01-01','YYYY-MM-DD'),to_date(:my_dat
e,'YYYY-MM-DD')"

I dont think nvl will give me what i want since I still need an "else"
mask. At this point, I can't get the basic syntax right. 

Here is the header part of the control file

LOAD DATA
CHARACTERSET UTF8
INFILE "load.data" "var 7"
APPEND INTO TABLE my_table FIELDS TERMINATED BY ' ' ENCLOSED By "'" AND
"'"

>>> This e-mail and any attachments are confidential, may contain legal,
professional or other privileged information, and are intended solely for the
addressee.  If you are not the intended recipient, do not use the information
in this e-mail in any way, delete this e-mail and notify the sender. CEG-IP2

--
http://www.freelists.org/webpage/oracle-l


