Home » Developer & Programmer » Forms » Data Not Showing (Forms 10g)
Data Not Showing [message #599816] Tue, 29 October 2013 04:26 Go to next message
oradev10
Messages: 7
Registered: October 2013
Junior Member
I am navigating to a 2nd block and the data appears fine. When I add a default_where clause suddenly the data won't display. I checked in sql plus and I should retrieve 6 rows. I also set up an on-count trigger and saw that the query is retrieving the 6 rows however the block/canvas shows nothing. When I remove the default_where I do get the data showing. Any ideas as to why the default_where is not displaying even though it is querying properly? Thanks in advance.
Re: Data Not Showing [message #599822 is a reply to message #599816] Tue, 29 October 2013 04:56 Go to previous messageGo to next message
Littlefoot
Messages: 21808
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Run the form in debug mode so that you could trace its execution.
Re: Data Not Showing [message #599826 is a reply to message #599822] Tue, 29 October 2013 05:03 Go to previous messageGo to next message
oradev10
Messages: 7
Registered: October 2013
Junior Member
Unfortunately the environment is not properly set up so I am relegated to using messages.
Re: Data Not Showing [message #599828 is a reply to message #599826] Tue, 29 October 2013 05:07 Go to previous messageGo to next message
Littlefoot
Messages: 21808
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Although you said that query "works", could you double check it? When setting up the DEFAULT_WHERE, compose its value into a variable and display it on the screen (put it into an item or use MESSAGE built-in); then copy/paste it into SQL*Plus and run it. If it is correctly created, it should return these 6 rows. If not, well, you'll probably see the reason.

Also, you could post trigger code you used to do what you are doing.

Just to verify: you did execute query at the end, didn't you?

P.S. Oh, yes - forgot to say: try to recompile the form (All: Ctrl + Shift + K) and see what happens.

[Updated on: Tue, 29 October 2013 05:08]

Report message to a moderator

Re: Data Not Showing [message #599829 is a reply to message #599828] Tue, 29 October 2013 05:10 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
use get_block_query(<block name>, last_query) to get the exact select statement submitted to the DB.
Also does the block have any list items, check boxes or radio groups. If so check those items support the values in the corresponding columns for the records that don't display.
Re: Data Not Showing [message #599830 is a reply to message #599828] Tue, 29 October 2013 05:26 Go to previous messageGo to next message
oradev10
Messages: 7
Registered: October 2013
Junior Member
I also know the query returns 6 rows because of the on-count trigger
DECLARE
total_records Number;
begin
Count_Query;
total_records := Get_Block_Property('EVENT_RETURN_GROUP', Query_Hits);
message('In on-count ' || total_records);
message('In on-count ' || total_records);
end;

The when-new-block-instance trigger has the exec query
count_query;
Execute_query;
message('In new block - last query '||:System.last_query);
message('In new block - last query '||:System.last_query);

I have moved the default_where around and always with the same results. It's currently in pre-query
Set_Block_Property('EVENT_RETURN_GROUP',DEFAULT_WHERE,'e_return_e_no=12353');
I temporarily hard-coded it to be sure there weren't any parentheses errors.

Without the default_where the post_query fires. With it - it doesn't fire but I still get 6 rows in my query_hits.

I'm not useing get_block_query(<block name>, last_query) . I am using ||:System.last_query
Re: Data Not Showing [message #599831 is a reply to message #599830] Tue, 29 October 2013 05:29 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
If count_query works then it's probably due to list_items, check boxes or radio groups, check them.
Re: Data Not Showing [message #599832 is a reply to message #599831] Tue, 29 October 2013 05:37 Go to previous messageGo to next message
oradev10
Messages: 7
Registered: October 2013
Junior Member
Wow you were absolutely right. When I changed the 2 list items to text items it all started populating. I don't understand why but I am going to start to researching it now that I know the triggers are all ok. Thanks very very much !!
Re: Data Not Showing [message #599834 is a reply to message #599832] Tue, 29 October 2013 05:47 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
It's simple.
Say you have a list item with two values - Y and N
And you have a row in the table with a value for that column of S.
The list item can't handle that value so the whole record is silently rejected.
If you set the mapping of other values property that will allow the list item to display the record, but really should make sure the data always matches up.

And the exact same logic applies to check boxes and radio groups.
Re: Data Not Showing [message #599835 is a reply to message #599834] Tue, 29 October 2013 05:51 Go to previous messageGo to next message
Littlefoot
Messages: 21808
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Today I learnt something new! Didn't know that these records are silently rejected so - thank you for the explanation!
Re: Data Not Showing [message #599843 is a reply to message #599835] Tue, 29 October 2013 06:35 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
Unsurprisingly I learnt that one the hard way years ago and if memory serves it took a couple of days to work out what the problem was. It still amazes me forms doesn't pop up an error when it can't display a record, I'd call that a forms bug personally.

This issue is the main reason why I always tell people not to try and dynamically populate list items. If the list has different data in different circumstances then sooner or later you will end up with records that can't be displayed.
Re: Data Not Showing [message #599903 is a reply to message #599843] Wed, 30 October 2013 02:38 Go to previous messageGo to next message
oradev10
Messages: 7
Registered: October 2013
Junior Member
Thanks very much for that clear explanation. It is very much appreciated.
icon14.gif  Re: Data Not Showing [message #602217 is a reply to message #599816] Sun, 01 December 2013 14:49 Go to previous message
bluetooth420
Messages: 146
Registered: November 2011
Senior Member
Thanks cookiemonster.

You message is very helpful for me too today. Smile

Thanks once again
Previous Topic: Multiple Comm Port
Next Topic: Lov not work
Goto Forum:
  


Current Time: Thu Apr 25 21:53:43 CDT 2024