Re: SQLloader

From: Stephen Hanlon <steve_at_hanlon.co.uk>
Date: Tue, 09 Mar 1999 20:11:09 +0000
Message-ID: <36E5805D.E64AFCDC_at_hanlon.co.uk>


joakim.krassman_at_prepage.se wrote:

> Hi, everyone
>
> I am really into deep shit and if I cant solve this problem I will have to
> rebuild all my tables and all ASP pages...puhhhhh...I was hoping that someone
> outhere could help me with my problem....
>
> I want my control file to look like this:
>
> load data
> infile "C:\import\480.swe"
> truncate
> into table test
> when (1:3) = 'D01'
> (ID position(15:18),
> Name position(23:4))
>
> when (1:3) = 'D02'
> (Thelephone position(5:8),
> ID position(15:18))
>
> begindata
>
> D01 test test ID23 test test test
> D02 test test ID23 test test test
> D01 test test ID24 test test test
> D02 test test ID24 test test test
>
> I want the sqlloader to insert every row in the same post, like a loop that
> fetching in every data to the same record. I have tried a lot of diffrent ways
> but none have worked out. Please.........
>
> kind regardes Joakim Krassman
>
> It would be really nice if you could email me the answer...if there is one...
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own

You could try using our new loading tool DataMill, there is a fully functional trial version for download at our website (www.hanlon.co.uk).

You could load the contents using a control file along the lines of:

arguments {

    infile = "C:\import\480.swe";
}

declare section {

    b_key     position(1:3);
    b_ID      position(15:18);
    b_Name    position(23:40);
    b_Telephone position(5:8);

}

start load {

    truncate table test;
}

transaction body {
begin
  if :b_key = 'D01' then
    insert into test (ID, Name) values (:b_ID, :b_Name);   elsif :b_key = 'D02' then
    insert into test (ID, Telephone) values (:b_ID, :b_Telephone);   end if;
end;
}

Hope this helps,
Steve Hanlon.

--
Stephen Hanlon...................Email :  steve_at_hanlon.co.uk
Hanlon Consulting Ltd............Phone : +44 (0)181 755 4545
http://www.hanlon.co.uk/ ........Fax   : +44 (0)870 056 7283
Received on Tue Mar 09 1999 - 21:11:09 CET

Original text of this message