Trying to call a user-defined function from Forms 4.0.12 - Problems - Is this an Oracle bug?
Date: 8 Mar 1995 21:06:52 -0000
Message-ID: <3jl69c$4gq_at_crocus.csv.warwick.ac.uk>
Hello,
I have a user-defined SQL function, preferred_name. Here is it's header file
Create Or Replace Function Preferred_Name ( Card_Year In Natural Default Null, Card_Maniple In Natural Default Null, Card_Number In Natural Default Null, Title_Abbreviation In VarChar2 Default Null, First_Forename In VarChar2 Default Null, Middlename In VarChar2 Default Null, Preferred_Forename In VarChar2 Default Null, Surname In VarChar2 Default Null, Prefer_Title In Char Default Null, Prefer_Initials In Char Default Null, Prefer_Fullstops In Char Default Null, Prefer_Middle_Names In Char Default Null, Format In Natural Default 0 ) Return VarChar2 Is
It can be called from sqlplus with no-parameters or parameters as follows
SQL> select preferred_name from dual;
PREFERRED_NAME
Mr Richard Tinker
SQL> select csv_user_oracle.preferred_name('','','','Mr','Richard','James','Rich', 'Tinker','N','N','N','N') from dual;
CSV_USER_ORACLE.PREFERRED_NAME('','','','MR','RICHARD','JAMES','RICH','TINKER','
Rich Tinker
I am experiencing problems trying to call this function from an Oracle Form (version 4.0.12). I am trying to call the function from a trigger in Forms and assign the result to a variable. The function is in the schema csv_user_oracle, and my personal schema is csv_user_esuvl.
select csv_user_oracle.preferred_name('','','','Mr','Richard','James', 'Rich','Tinker','N','N','N','N') into function_result from dual;
OR
function_result := preferred_name();
When compiling the trigger, Oracle Forms gives the following error
Error 302 at line 66, column 24
component 'PREFERRED_NAME' must be declared
If I try and call the function as:
function_result := preferred_name();
where function_result is declared as VARCHAR2 I also get the same error.
I have tried declaring the function in various ways but this fails. (I think the declaring of a function message my be a red herring because I use a function in another PL/SQL block of code without declaring it
Forenames := Initialise (Forenames);
where Initialise is another function. Does anyone know what I have done wrong. Is this a bug in Oracle Forms version 4.0.12. I'm sure that calling a function from a trigger is a fairly normal thing to do.
Help.
Richard Tinker
-- R.J.Tinker_at_csv.warwick.ac.ukReceived on Wed Mar 08 1995 - 22:06:52 CET