Call Stored Procedure from Forms 6i -- Urgent Plz... [message #147718] |
Sat, 19 November 2005 21:22 |
sireeshraju
Messages: 32 Registered: October 2005
|
Member |
|
|
Dear All,
I have searched for this topic in this website and never
found one suitable answer for my Query below:-
I am first writing a stored procedure as:-
CREATE OR REPLACE FUNCTION
good_hire
(birthdate_in IN DATE,
reqsal_in IN NUMBER)
RETURN BOOLEAN
IS
too_young BOOLEAN :=
ADD_MONTHS
(SYSDATE, -216) >
birthdate_in;
too_expensive BOOLEAN :=
reqsal_in > fin.dept_bal;
BEGIN
RETURN NOT (too_young
OR too_expensive);
END;
Now in my forms also i have the same function,which i defined in in my program unit i.e., with the same name good_hire,but with different parameters.
If I want to call this stored procedure(good_hire)in my form
I am writing this code in the pre-Insert trigger.
IF good_hire
(:newemp.birthdate,
:newemp.proposed_sal)
THEN
SELECT empseq.NEXTVAL
INTO :newemp.empno
FROM dual;
ELSE
RAISE FORM_TRIGGER_FAILURE;
END IF;
Notice that i am sending bind variables from my form to the
stored procedure. Now my question :
1) Can i pass bind variables to the stored procedures from
forms or is there any other way i can access the
stored roceures from forms(Expecting a detailed answer) and
from which triggers can I access the stored procedures(like pre-
Insert here)?
2) If at all I have the same parameters in my program unit
function and with the same name good_hire, I know that the code
in the pre-Insert trigger will call only the function in my
program unit and not the stored procedure, but if I like to
call my stored procedure instead of the local function good_hire
then what should I do?
2)As I said before if i have different parameters, for the
stored procedure good_hire and local function good_hire and If
I call good_hire from my pre-insert trigger .. Is it that the
Forms will decide and call the Local function or stored
procedure depending on the parameter list?
I hope all my points are very clear.
I am expecting the best and detailed answer for my
Queries, I also hope these Quests will clear the doubts of many
members in our esteemed group.
Thnx in Advance...
Regards
siree....
|
|
|
|
|
Re: Call Stored Procedure from Forms 6i -- Urgent Plz... [message #150010 is a reply to message #147718] |
Tue, 06 December 2005 00:11 |
|
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
Never, repeat never, create the same procedure or function name in a form as in the database. Don't expect the argument differences to get around the fact that you trying to use two procedures with the same name. Just use different names and KNOW that you are using different procedures.
David
|
|
|