Re: Urgent ,,Please Help

From: Daniel A. Morgan <dmorgan_at_exesolutions.com>
Date: Wed, 07 Mar 2001 00:01:52 -0800
Message-ID: <3AA5EAEF.12568F4A_at_exesolutions.com>


> I have a file in which the data is like this
>
> H1 4600019786R03020195010195013195
> R0300000110720790101950000002090010295
> R0300000000000580202950068400271010295
> T1 000000 00000000000 000025 00000184637
>
> I need to load this data in 2 different tables they are ..... header_table,
> detail_table
>
> My sql loader uses the WHEN clause so that the tables are loaded
>
> WHEN it starts with H
> it goes into header_table,
> WHEN it starts with R
> it goes into detail_table,
> WHEN it starts with T
> it goes into remaining columns in header_table
>
> However when loading the T1 record into header _table i get an error
>
> ORA-01400: cannot insert NULL into ("HEADERS_TABLE")
>
> I am trying all possible ways to get it solved but of no avail
>
> Please help, it helps me to proceed further

Create a single table with the exact same structure as the records in the file you are using to load the data. Put no constraints of any type on the table. Then use SQL*Loader to blow the records into the table. Once they are inside the database write a simple stored procedure to distribute them to the two tables and to perform any error checking.

Daniel A. Morgan Received on Wed Mar 07 2001 - 09:01:52 CET

Original text of this message