Home » Developer & Programmer » Forms » null values question (oracle 10g)
null values question [message #545311] Tue, 28 February 2012 05:36 Go to next message
baliberde
Messages: 201
Registered: January 2012
Location: outer space
Senior Member
Hello, I'm having a problem with null values. I want to display old student in a display item if subjects text item has records. Otherwise, display new student if it has null values.


This is the code that i tried so far..
IF :block2.subjects IS NULL THEN
       :block3.type := 'NEW STUDENT';
ELSE
       :block3.type := 'OLD STUDENT';
END IF;


But i got logic error during runtime.
Re: null values question [message #545313 is a reply to message #545311] Tue, 28 February 2012 05:46 Go to previous messageGo to next message
cookiemonster
Messages: 10929
Registered: September 2008
Location: Rainy Manchester
Senior Member
What error?
What trigger is the code in?
Re: null values question [message #545314 is a reply to message #545313] Tue, 28 February 2012 05:48 Go to previous messageGo to next message
baliberde
Messages: 201
Registered: January 2012
Location: outer space
Senior Member
when-button-pressed trigger. but it shows no error message
Re: null values question [message #545315 is a reply to message #545314] Tue, 28 February 2012 05:50 Go to previous messageGo to next message
cookiemonster
Messages: 10929
Registered: September 2008
Location: Rainy Manchester
Senior Member
Well it's doing something that you think is wrong. Do we have to guess or are you actually going to explain properly?
Also, is there other code in the button? If so it might be an idea to post all of it.
There is nothing obviously wrong with the posted code.
Re: null values question [message #545317 is a reply to message #545315] Tue, 28 February 2012 06:01 Go to previous messageGo to next message
baliberde
Messages: 201
Registered: January 2012
Location: outer space
Senior Member
sorry i have placed it in when-new-block-instance trigger
Re: null values question [message #545319 is a reply to message #545317] Tue, 28 February 2012 06:06 Go to previous messageGo to next message
baliberde
Messages: 201
Registered: January 2012
Location: outer space
Senior Member
i have two blocks in one canvas and when i go to one of that block, even when there are records, it displayed New student
Re: null values question [message #545323 is a reply to message #545319] Tue, 28 February 2012 06:13 Go to previous messageGo to next message
cookiemonster
Messages: 10929
Registered: September 2008
Location: Rainy Manchester
Senior Member
I suspect the problem is that you really don't understand how forms works.
Code that checks a value of block item, and code that assigns values to block items, applies to the current record only.
To apply to all records you would have to loop through them.
Re: null values question [message #545328 is a reply to message #545323] Tue, 28 February 2012 06:42 Go to previous messageGo to next message
Littlefoot
Messages: 19525
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
How about this: for existing records (i.e. the ones that are fetched from the database when you perform query), put that code into POST-QUERY trigger. For newly entered records, put that code into WHEN-VALIDATE-ITEM trigger on BLOCK2.SUBJECTS item.
Re: null values question [message #545329 is a reply to message #545328] Tue, 28 February 2012 07:14 Go to previous message
cookiemonster
Messages: 10929
Registered: September 2008
Location: Rainy Manchester
Senior Member
I was going to make that suggestion until I noticed that the item being set is in a different block to the one being checked.
I'm not sure of the setup but I suspect WVI wouldn't work because of that.
Previous Topic: Capturing Key Press in Oracle Forms
Next Topic: Raise an alert When browser is closed in Form 11g
Goto Forum:
  


Current Time: Sat Aug 30 01:32:27 CDT 2014

Total time taken to generate the page: 0.08528 seconds