Home » Developer & Programmer » Forms » FRM-40738 ERROR IN ORACLE FORMS
FRM-40738 ERROR IN ORACLE FORMS [message #655244] Thu, 25 August 2016 10:55 Go to next message
Soulami
Messages: 23
Registered: August 2016
Junior Member
Hi ,

I am getting an error when i click of save/execute button of a screen as FRM 40738 : Argument 1 of predefined procedure GO_BLOCK cant be null.

Below is my code on the click of when button pressed trigger

declare
res number;

begin

Check_Fehlkz_Code(res);

if res = 1 then

p_msg_ppslib('WARNUNG', stl.gtext(:parameter.stlapp, :parameter.stlmod, 25889));
raise form_trigger_failure;

else

Toolbar.beenden;

end if;

exception
when FORM_TRIGGER_FAILURE then
RAISE FORM_TRIGGER_FAILURE;
when others then
null;

end;
Re: FRM-40738 ERROR IN ORACLE FORMS [message #655248 is a reply to message #655244] Thu, 25 August 2016 11:49 Go to previous messageGo to next message
Michel Cadot
Messages: 67466
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Please read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.

Quote:
when others then
null;
This is a bug, remove it and WHEN OTHERS, then retry.

Re: FRM-40738 ERROR IN ORACLE FORMS [message #655249 is a reply to message #655248] Thu, 25 August 2016 11:55 Go to previous messageGo to next message
Soulami
Messages: 23
Registered: August 2016
Junior Member
I should remove when others then null ?
Re: FRM-40738 ERROR IN ORACLE FORMS [message #655250 is a reply to message #655249] Thu, 25 August 2016 11:59 Go to previous messageGo to next message
Michel Cadot
Messages: 67466
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

This is what I said but before understand why reading the link.

Re: FRM-40738 ERROR IN ORACLE FORMS [message #655251 is a reply to message #655250] Thu, 25 August 2016 12:29 Go to previous messageGo to next message
Soulami
Messages: 23
Registered: August 2016
Junior Member
No, didn't work. Still the same error.
Re: FRM-40738 ERROR IN ORACLE FORMS [message #655252 is a reply to message #655251] Thu, 25 August 2016 12:32 Go to previous messageGo to next message
Michel Cadot
Messages: 67466
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

At least, now your code is better.

Re: FRM-40738 ERROR IN ORACLE FORMS [message #655253 is a reply to message #655252] Thu, 25 August 2016 12:44 Go to previous messageGo to next message
Soulami
Messages: 23
Registered: August 2016
Junior Member
But what difference does it make?
Didnt work anyway , changed it to

exception
WHEN FORM_TRIGGER_FAILURE then
RAISE FORM_TRIGGER_FAILURE;
WHEN OTHERS THEN
MESSAGE(SQLERRM);
Re: FRM-40738 ERROR IN ORACLE FORMS [message #655254 is a reply to message #655253] Thu, 25 August 2016 12:47 Go to previous messageGo to next message
Michel Cadot
Messages: 67466
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

So you didn't do what I said: REMOVE the clause, SUPPRESS it, DROP it, GET RID OF it.

Re: FRM-40738 ERROR IN ORACLE FORMS [message #655255 is a reply to message #655254] Thu, 25 August 2016 12:49 Go to previous messageGo to next message
Soulami
Messages: 23
Registered: August 2016
Junior Member
Remove when others exception ?

But what difference will it make? Will it?
Re: FRM-40738 ERROR IN ORACLE FORMS [message #655256 is a reply to message #655255] Thu, 25 August 2016 12:56 Go to previous messageGo to next message
Michel Cadot
Messages: 67466
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

OK forget it and stay with your bad code you're the type of guys that guarantees I will have work and money all my life, god bless you.

Re: FRM-40738 ERROR IN ORACLE FORMS [message #655257 is a reply to message #655256] Thu, 25 August 2016 13:01 Go to previous messageGo to next message
Soulami
Messages: 23
Registered: August 2016
Junior Member
No, please tell me. I thought you asked me to remove this

when others then
null;

So I removed null. And used message(sqlerrm);

you want me to remove the exception when others ?
Re: FRM-40738 ERROR IN ORACLE FORMS [message #655258 is a reply to message #655257] Thu, 25 August 2016 14:33 Go to previous messageGo to next message
Littlefoot
Messages: 21612
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Simply remove the whole EXCEPTION section. The way you use it is useless, it does nothing good; it just successfully hides any possible error. Let Forms raise an excaption if it happens; doing so, you'll (at least) know what went wrong. Then, if necessary, handle it. Using WHEN OTHERS is in most cases wrong (did you read contents behind the link Michel provided?).



As of your initial question: there's no GO_BLOCK in this piece of code, so the error must be somewhere else. Is it, perhaps, CHECK_FEHLKZ_CODE? What does it do?

Which Forms version do you use? Because, if you can't find the culprit and use Forms 9i onward, set the breakpoint and run the form in debug mode. Execute it step by step, until you find the line that causes the error.

Or, possibly even simpler (and faster), go to Edit menu and Find a string in your PL/SQL procedures - search for GO_BLOCK in there. Most probably, there aren't that many GO_BLOCKs in the form so you might see the error cause instantly, i.e. GO_BLOCK without an argument. It should contain the target block, such as
GO_BLOCK('employees');
Re: FRM-40738 ERROR IN ORACLE FORMS [message #655259 is a reply to message #655258] Thu, 25 August 2016 14:56 Go to previous messageGo to next message
Soulami
Messages: 23
Registered: August 2016
Junior Member
This is the Check_Fehlkz_Code :

PROCEDURE Check_Fehlkz_Code(rc out number) IS

BEGIN
first_record;


LOOP
IF :CTRL_FEHLKZ.fehlkz=699
THEN

p_msg_ppslib('WARNUNG', stl.gtext(:parameter.stlapp, :parameter.stlmod, 25889));
raise form_trigger_failure;
rc:=1;
exit;
END IF;

IF :system.last_record = 'TRUE'
THEN
exit;
ELSE
next_record;
END IF;
end loop;


END;
Re: FRM-40738 ERROR IN ORACLE FORMS [message #655260 is a reply to message #655259] Thu, 25 August 2016 14:58 Go to previous messageGo to next message
Soulami
Messages: 23
Registered: August 2016
Junior Member
And yes I did go through the link of When Others which Michel had sent.
Re: FRM-40738 ERROR IN ORACLE FORMS [message #655276 is a reply to message #655260] Fri, 26 August 2016 01:00 Go to previous messageGo to next message
Littlefoot
Messages: 21612
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Soulami, think with your own head. Do you see GO_BLOCK in CHECK_FEHLKZ_CODE? I do not. So how could it raise "Argument 1 of predefined procedure GO_BLOCK cant be null"?

Did you read the rest of my message (apart from following Michel's link)? What did you do about it?
Re: FRM-40738 ERROR IN ORACLE FORMS [message #655313 is a reply to message #655276] Fri, 26 August 2016 16:12 Go to previous messageGo to next message
cookiemonster
Messages: 13895
Registered: September 2008
Location: Rainy Manchester
Senior Member
By the way, that procedure will never assign a value to RC. The line of code that does that can never be run because of the raise.
Re: FRM-40738 ERROR IN ORACLE FORMS [message #655425 is a reply to message #655313] Wed, 31 August 2016 01:45 Go to previous messageGo to next message
Soulami
Messages: 23
Registered: August 2016
Junior Member
hello,

Because of raise?

Raise form_trigger_failure?
Re: FRM-40738 ERROR IN ORACLE FORMS [message #655426 is a reply to message #655425] Wed, 31 August 2016 01:46 Go to previous messageGo to next message
Soulami
Messages: 23
Registered: August 2016
Junior Member
Could you please tell me what is wrong? So that i could fix it
Re: FRM-40738 ERROR IN ORACLE FORMS [message #655431 is a reply to message #655425] Wed, 31 August 2016 03:16 Go to previous messageGo to next message
cookiemonster
Messages: 13895
Registered: September 2008
Location: Rainy Manchester
Senior Member
Soulami wrote on Wed, 31 August 2016 07:45
hello,

Because of raise?

Raise form_trigger_failure?
Yes. Raise causes oracle to stop running the current block of code and crash out to the first exception handler it can find. So any code after a raise can never be run.
Also when a procedure ends in error it doesn't pass back out parameters.
If you want the out parameter set you can't use raise.
Re: FRM-40738 ERROR IN ORACLE FORMS [message #655439 is a reply to message #655431] Wed, 31 August 2016 05:08 Go to previous messageGo to next message
Soulami
Messages: 23
Registered: August 2016
Junior Member
okay, got it.

But in that case the warning would be by passed, if i remove the raise form_trigger_failure.Right?

Any alternative?
Re: FRM-40738 ERROR IN ORACLE FORMS [message #655440 is a reply to message #655431] Wed, 31 August 2016 05:10 Go to previous messageGo to next message
Soulami
Messages: 23
Registered: August 2016
Junior Member
Should i set the value first and then raise?
Re: FRM-40738 ERROR IN ORACLE FORMS [message #655455 is a reply to message #655439] Wed, 31 August 2016 05:46 Go to previous messageGo to next message
cookiemonster
Messages: 13895
Registered: September 2008
Location: Rainy Manchester
Senior Member
Soulami wrote on Wed, 31 August 2016 11:08
okay, got it.

But in that case the warning would be by passed, if i remove the raise form_trigger_failure.Right?

Which one? You appear to have two.
The current code bypasses the outer one because the out parameter is never set.

You should either:
Have Check_Fehlkz_Code call p_msg_ppslib and do a raise and not bother with an out parameter and not have the trigger do either.
Or have the trigger call p_msg_ppslib and do a raise and remove those from Check_Fehlkz_Code and just have it return the out parameter.

You're trying to do both, which makes no sense.
Re: FRM-40738 ERROR IN ORACLE FORMS [message #655456 is a reply to message #655440] Wed, 31 August 2016 05:46 Go to previous message
cookiemonster
Messages: 13895
Registered: September 2008
Location: Rainy Manchester
Senior Member
Soulami wrote on Wed, 31 August 2016 11:10
Should i set the value first and then raise?
If you raise an error, out parameters don't get passed back, even if they're set.
Previous Topic: choose which lov to show
Next Topic: How to validate each record if the number of records displayed e.g. =2 in oracle forms
Goto Forum:
  


Current Time: Tue Oct 27 01:09:05 CDT 2020