Path: dp-news.maxwell.syr.edu!spool.maxwell.syr.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!newsfeeder.wxs.nl!feeder1.cambrium.nl!feed.tweaknews.nl!138.199.65.86.MISMATCH!sn-ams-06!sn-xt-ams-08!sn-post-ams-02!sn-post-ams-01!supernews.com!corp.supernews.com!not-for-mail
From: Sybrand Bakker <postbus@sybrandb.demon.nl>
Newsgroups: comp.databases.oracle.misc
Subject: Re: SQL*Loader exit status
Date: Sat, 04 Mar 2006 00:26:36 +0100
Organization: Posted via Supernews, http://www.supernews.com
Message-ID: <32kh0216ulqolhog3jgk7vrfcr1515jmg7@4ax.com>
Reply-To: postbus@sybrandb.demon.nl
References: <46ru1jFcbqsqU1@individual.net>
X-Newsreader: Forte Agent 3.2/32.830
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Complaints-To: abuse@supernews.com
Lines: 59
Xref: dp-news.maxwell.syr.edu comp.databases.oracle.misc:125693

On Fri, 3 Mar 2006 23:24:49 +0100, "Homer Frey" <homerfrey@gmail.com>
wrote:

> Hello,
>
>I have a Java class which calls the Oracle SQL*Loader to import data into a 
>database-table (Oracle 9i).
>
>To check if everything worked fine I analyse the exit status of the 
>SQL*Loader.
>
>My tests showed me the following exit status:
>
>0: All data was successfully imported
>1: Problems with connection to database or for instance table is already 
>full
>2: Bad data, e.g. some data could not been imported
>
>But now I found out something peculiar which makes me some problems.
>
>This is my control file:
>
>INSERT
>INTO TABLE ms.TEST
>
>WHEN(01:03) != 'End'
>
>FIELDS TERMINATED BY ','
>
>(NR
>,
>NAME
>,
>AMOUNT
>,
>PRICE
>)
>
>
>As you can see I use a WHEN-condition to get the last row. And this makes me 
>trouble.
>
>Because due to this condition I get an exit status of "2". But it works like 
>I want: Import all data except the last line. So I expect a exit status of 
>0. So why SQL*Loader throws exit status 2???
>
>Can I tell this SQL*Loader anyhow to give me a 0 when it not import all data 
>due to the WHEN-condition? Have I to change the ctrl-file?
>
>Regards Homer 
>

You are aware files use to end with an EOF marker, and this marker is
respected by Sql*loader automagically?
So why do you have this kludge?
Remove the redundant last line and you will be ok.

--
Sybrand Bakker, Senior Oracle DBA
