Question

I use the following syntax to load the table if a value exists at given position:

INTO TABLE some_table
WHEN (2745:2769) <> BLANKS
( ... fields specification ... )

It works when the value actually exists (record is loaded) and when there are spaces at this positions (not loaded). But also when the line is shorter than 2745 characters the record is still loaded, which is undesirable. How can I prevent this?

I tried all of the following and it's all the same:

WHEN (2745:2769) <> BLANKS
WHEN (2745:2769) <> ''
WHEN (2745:2769) <> ' '
WHEN (2745:2769) IS NOT NULL (this doesn't work at all actually)
Was it helpful?

Solution

Try using temporary table to load all of your data into. Then transfer the data from your temporary table into your table using a generic insert into ... select * from temporary table where column is not null;

The Oracle loader is not really the best place to try do manipulations/clauses etc. on data files. Rather ensure your file is as correct as possible before you try load it (i.e. run it through a perl parser or something before), or load into a temp table do your manipulations from a temporary table into your final table.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top