From: ddf on
On Mar 8, 9:56 am, Kay Kanekowski <kay.kanekow...(a)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
> number
> is
>  erg number;
> begin
>  execute immediate 'select ' || string_in || ' from dual'  into erg;
>  return erg;
> end;
> /
>
> LOAD DATA
> INFILE math.txt
> INTO TABLE kk_math
> REPLACE
> FIELDS TERMINATED BY ','
>        OPTIONALLY ENCLOSED BY '"'
> (
>   id1 integer external "fn_kk_calc(:id1)",
>   id2 integer external
> )
>
> hth
> Kay

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
From: gazzag on
On 9 Mar, 22:07, ddf <orat...(a)msn.com> wrote:
>
> 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

Agreed. However, we don't really know the OP's requirement and why he
perhaps needs a way of loading the data as is.

-g
From: ddf on
On Mar 10, 10:03 am, gazzag <gar...(a)jamms.org> wrote:
> On 9 Mar, 22:07, ddf <orat...(a)msn.com> wrote:
>
>
>
> > 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
>
> Agreed.  However, we don't really know the OP's requirement and why he
> perhaps needs a way of loading the data as is.
>
> -g

It isn't a business reason:

"I have created a table called test like this "create table test(id1
number, id2 number)" in Oracle 10g.2 Standard Edition on a Windows XP
home computer.


I am trying to import data into my "test" table.

...."

I have no problem with experimentation (this is how many people learn
things) however writing a function to aid SQL*Loader to process inline
data seems a bit excessive.

Of course that's only my opinion.


David Fitzjarrell