PLS-00231: function 'TO_DOLLAR_STR' may not be used in SQL

From: Ken Wilson <ken.wilson_at_homeNOSPAM.com>
Date: 2000/02/02
Message-ID: <38980CE1.744C2A5B_at_homeNOSPAM.com>#1/1


I am getting the above message and cannot figure out what is wrong with the code that's generating it. The sql script is being run under SQL Plus 3.3

Bear in mind I am a student at this time and the coded is basically more of academic interest for learning than anything of substance. I have appended the code to this message. If anyone can steer me in the right direction it would be greatly appreciated.

Ken Wilson
First Law of Optimization: The speed of a non-working program is irrelevant
(Steve Heller, 'Efficient C/C++ Programming')

< code snippet>
declare

/**
  • This function will build a string of dollar signs
  • and return it based on the number input **/ function To_Dollar_Str (Dollar_Count IN number) return varchar2 is

Dollar_Str Course.Dollar%type;
i positive := 1;

begin

for i IN 1..Dollar_Count loop

    Dollar_Str := Dollar_Str || '$';
end loop;

return Dollar_Str;

end;

  • Main body of script starts here

begin

update Course
set Dollar = To_Dollar_Str(floor(Additional_Fees / 10)) where
  Department_ID = upper('&Dept_ID_In') and   Course_ID = upper('&Course_ID_In') and   Additional_Fees >= 10;

commit;

end;

<code ends> Received on Wed Feb 02 2000 - 00:00:00 CET

Original text of this message