Re: SQLLDR syntax question
Date: Tue, 9 Mar 2010 14:07:59 -0800 (PST)
On Mar 8, 9:56 am, Kay Kanekowski <kay.kanekow..._at_web.de> wrote:
> Hi Martin,
> you need a function that calculate your "string" data.
> That's my try:
> create or replace function fn_kk_calc ( string_in IN varchar2 ) return
> erg number;
> execute immediate 'select ' || string_in || ' from dual' into erg;
> return erg;
> LOAD DATA
> INFILE math.txt
> INTO TABLE kk_math
> FIELDS TERMINATED BY ','
> OPTIONALLY ENCLOSED BY '"'
> id1 integer external "fn_kk_calc(:id1)",
> id2 integer external
This all seems to be far more work than necessary simply to enable the use of some round-about 'calculation' rather than coding the numeric values desired. Yes, it's creative, but having to write a funciton to process the mathematical gyrations loaded into the inline data unnecessarily complicates a fairly basic data load. Has no one heard of Occam's Razor? Paraphrased:
"The simplest solution is the best"
It's simplest in this situation to code 10 rather than 1+9; interesting as the other offerings may be they are merely baroque additions to what should be a minimalist execution.
David Fitzjarrell Received on Tue Mar 09 2010 - 16:07:59 CST