How would you get first 2000 chars of a Long field?

From: Sean Dolan <sdolan_at_3si.com>
Date: 13 May 1998 20:12:52 GMT
Message-ID: <01bd7eab$331eb600$1565a8c0_at_sdolan.3si.com>


[Quoted]         We are having some BIG problems doing an import of data into our Oracle tables. The problem is that a field in our flat text file could be > 2000 so we've decided to put the data into a temporary table where the field is a LONG column. Now we'd like to have a "good" table with the first 2000 characters of the LONG field... how would one do this?

        We have tried SQL/Plus in terms of spooling it to a file, but the problem is that we get LOTS of EXTRA spaces in the data output.

        select recNumber, '|', action from testTable;

It's trying to fill up a 500 character line (set in Environment settings) so it fills the empty space after the recNumber and the | with spaces. Then on the next line it outputs the action (2000 characters)... if we could just get rid of the extra spaces, we could (laboriously) use SQL Loader again to input the "cleaned-up" flat file.

Any ideas on how to do this better (or even at all)? Thanks,
Sean Dolan
Sr Systems Engineer, 3Si
MCSE Received on Wed May 13 1998 - 22:12:52 CEST

Original text of this message