Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: External table field options
Kirmo Uusitalo wrote:
> Hi,
>
> Given this csv file:
> 0101;Fox Street 20 A;27052005
> 00102;42nd Street 20921;25022005
> 00105;Fox Street 21;00000000
>
> I wish to read its contents into Oracle 9i external table.
> I have created the following sql statement to create the table but it
> needs a few fixes.
[snip]
If you take Sybrand' advice and use a little of your own imagination, then you might come up with something like this:
create or replace function GetAddrCode( addrcode in varchar2 )
return varchar2 as
begin
return to_char( to_number( addrcode ) );
EXCEPTION
when others then
return null;
end GetAddrCode;
/
You could of course have performed the coersion in place, but having a function allows you to write neater code in larger contexts, ime and imo.
Hope this help's.
Cheers,
Chris Val
Received on Sun May 29 2005 - 23:21:27 CDT