By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,064 Members | 1,388 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,064 IT Pros & Developers. It's quick & easy.

how can run PL/SQL from oracle FORMS trigger or procedure/funcktion.

P: 10
HI
how can run PL/SQL application as:

create or replace
function getChecksiffra (in_string varchar2) return number is

xSvar number := 0;
xNR number := 0;
xSumma number := 0;
xString varchar2(100) := null;
BEGIN
if in_string IS NOT NULL then xString:=replace(in_string,'-'); end if;
if substr(xString,12,1) IS NOT NULL
and substr(xString,10,1) <= '9'
and substr(xString,11,1) <= '9'
and substr(xString, 9,1) <= '9'
then
xNR := to_number(substr(xString,3,1)* 2);
if xNR>9 then xNR:=xNR-9; end if;
xSumma := xSumma + xNR;
xNR := to_number(substr(xString,5,1)* 2);
if xNR>9 then xNR:=xNR-9; end if;
xSumma := xSumma + xNR;
xNR := to_number(substr(xString,7,1)* 2);
if xNR>9 then xNR:=xNR-9; end if;
xSumma := xSumma + xNR;
xNR := to_number(substr(xString,9,1)* 2);
if xNR>9 then xNR:=xNR-9; end if;
xSumma := xSumma + xNR;
xNR := to_number(substr(xString,11,1)* 2);
if xNR>9 then xNR:=xNR-9; end if;
xSumma := xSumma + xNR;
xNR := to_number(substr(xString,4,1));
xSumma := xSumma + xNR;
xNR := to_number(substr(xString,6,1));
xSumma := xSumma + xNR;
xNR := to_number(substr(xString,8,1));
xSumma := xSumma + xNR;
xNR := to_number(substr(xString,10,1));
xSumma := xSumma + xNR;
if xSumma between 61 and 70 then xSvar:=70-xSumma; end if;
if xSumma between 51 and 60 then xSvar:=60-xSumma; end if;
if xSumma between 41 and 50 then xSvar:=50-xSumma; end if;
if xSumma between 31 and 40 then xSvar:=40-xSumma; end if;
if xSumma between 21 and 30 then xSvar:=30-xSumma; end if;
if xSumma between 11 and 20 then xSvar:=20-xSumma; end if;
if xSumma between 0 and 10 then xSvar:=10-xSumma; end if;
end if;
return( xSvar );
/*EXCEPTION when others then return( null );*/
end;
/

From oracle FORMS trigger or procedure/funcktion.
i check if the numeral which i insert to field is correct.

Thanks
Nov 11 '08 #1
Share this Question
Share on Google+
6 Replies


100+
P: 127
Hi,

What is your problem? You want to call this function from a form, or the function is giving you a wrong result? If it is the latter, then please describe what the function should do.

If it is the first, then you have 2 options, either put the code in the form, or put the function in a package, make a role for the form and give the role execute rights on the package, and then you can call the function from your form.

Pilgrim.
Nov 11 '08 #2

amitpatel66
Expert 100+
P: 2,367
you can always create a procedure or a function in forms builder 6i and then execute them
Nov 12 '08 #3

P: 10
HI!

I create a function in forms under program units, but the function is giving me no result!

The funcktion have to check if the insert numeral to field is correct.

shall i write any thing in items triggers?
Nov 12 '08 #4

P: 10
Hi,

What is your problem? You want to call this function from a form, or the function is giving you a wrong result? If it is the latter, then please describe what the function should do.

If it is the first, then you have 2 options, either put the code in the form, or put the function in a package, make a role for the form and give the role execute rights on the package, and then you can call the function from your form.

Pilgrim.
I create a function in forms under program units, but the function is giving me no result!

The funcktion have to check if the insert numeral to field is correct.

shall i write any thing in items triggers?
Nov 12 '08 #5

100+
P: 127
Hi,

Where/when do you do the call to the function?

Pilgim.
Nov 12 '08 #6

amitpatel66
Expert 100+
P: 2,367
I create a function in forms under program units, but the function is giving me no result!

The funcktion have to check if the insert numeral to field is correct.

shall i write any thing in items triggers?
Hmm ok so from where are you calling this function?


1. Make sure your function is perfectly compiled in forms builder 6.0 without any errors.
2. Try calling that function just for testing and print few dummy data on screen to check the flow
3. Then fit in this function from where you need to actually call and trigger that event (Say button click etc) to check if the function executes correctly


post back in caseof any issues
Nov 13 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.