dividing by 100 in sql loader [message #406140] |
Tue, 02 June 2009 08:31 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
ora1980
Messages: 251 Registered: May 2008
|
Senior Member |
|
|
i am loading a .csv into oracle table, and for a particular column, i want whatever the value is there in the file / 100
being loaded..
i wrote a function which divides a number by 100
create or replace function div(in_num in number)
return number is
v_res number:=0;
begin
v_res:= in_num / 100;
return(v_res);
end f_div;
/
and in my control file, for that column, i did this:
load_column "div(load_column)"
but it gives error:
ORA-00984: column not allowed here
its a syntax error. can anyone help ?
|
|
|
|
|
Re: dividing by 100 in sql loader [message #406197 is a reply to message #406146] |
Tue, 02 June 2009 14:57 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
![](/forum/images/custom_avatars/43710.gif) |
Barbara Boehmer
Messages: 9104 Registered: November 2002 Location: California, USA
|
Senior Member |
|
|
The problem, as correctly pointed out by Mahesh Rajendran, is that the colon is missing. This causes it to see load_column as a column name, instead of of :load_column as a bind variable, which is why the error message says that a column is not allowed in the place where it was expecting a bind variable.
|
|
|