Home » Developer & Programmer » Forms » Null Record Problem of Cursor
Null Record Problem of Cursor [message #200249] Mon, 30 October 2006 00:50 Go to next message
jadoo83
Messages: 26
Registered: October 2006
Location: Mumbai
Junior Member
Hi,
I am fetching 24 records from database into cursor which finally add null record at the end of cursor;so, in all 25 records are there and i have to display only 24 records and i am displaying it into text item which displays 24 records. But whenever i m scrolling into that text item till the last record that null record comes into existence and all other records get shifted to one row up.

So, is there any way to hide this null record evenif i scroll into text item?

My code for diplaying record is:

for x into c
loop
:text_item:=c.value;
next_record;
end loop;
delete_record;


Re: Null Record Problem of Cursor [message #200250 is a reply to message #200249] Mon, 30 October 2006 00:55 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Please read the following:
Populate block using cursor
http://www.orafaq.com/forum/m/605/67467/?srch=populate+block+cursor+create_record#msg_605
and my feelings about it.
http://www.orafaq.com/forum/m/134237/67467/?srch=populate+block+cursor+create_record#msg_134237

Loading data into a block MANUALLY
http://www.orafaq.com/forum/m/111031/67693/#msg_111031
MANUAL previous and next master key record retrieval
http://www.orafaq.com/forum/m/111031/67693/#msg_111031
Sample MANUAL get employees form
http://www.orafaq.com/forum/t/52330/67467/

David
Re: Null Record Problem of Cursor [message #200253 is a reply to message #200250] Mon, 30 October 2006 01:26 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I'm not sure if I understood the problem correctly, but *perhaps* it is just a navigation problem; could you try to add such a code into, for example, 'KEY-DOWN' trigger (used when you scroll down using an arrow-down key):
IF :system.last_record = 'TRUE' THEN
   MESSAGE('Last record');
   RAISE FORM_TRIGGER_FAILURE;
   -- or, to avoid a message, simply put "NULL;" instead of those 2 lines
ELSE
   DOWN;
END IF;
What do you think about it, David?
Re: Null Record Problem of Cursor [message #200296 is a reply to message #200253] Mon, 30 October 2006 04:43 Go to previous messageGo to next message
jadoo83
Messages: 26
Registered: October 2006
Location: Mumbai
Junior Member
Yes it is a navigation problem and your solution i.e. 'KEY-DOWN' trigger is working.

Thanx both of You for guiding me.

Jitendra
Re: Null Record Problem of Cursor [message #200419 is a reply to message #200296] Mon, 30 October 2006 19:33 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
If the empty record had been truly added to the array by the manual approach the 'Key-Down' solution would not work as the empty record would actually exist.

David
Re: Null Record Problem of Cursor [message #200451 is a reply to message #200419] Mon, 30 October 2006 23:56 Go to previous messageGo to next message
jadoo83
Messages: 26
Registered: October 2006
Location: Mumbai
Junior Member
As far as my knowledge is concerned, in CURSORS an empty record is added automatically which indicates the End of Record for that cursor.
So, its not manually added empty record.
Re: Null Record Problem of Cursor [message #200453 is a reply to message #200451] Tue, 31 October 2006 00:11 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Jitendra,

You said
in all 25 records are there

Either you have 24 records and an end-of-cursor or you have 25 records - you can't have both.

I suggest that you stop thinking that there is an empty record at the end of the cursor and start thinking that there is an end-of-cursor marker which can be picked up by the various condition handlers.

David

Upd: Spelling.

[Updated on: Tue, 31 October 2006 17:20]

Report message to a moderator

Re: Null Record Problem of Cursor [message #200546 is a reply to message #200453] Tue, 31 October 2006 05:44 Go to previous message
jadoo83
Messages: 26
Registered: October 2006
Location: Mumbai
Junior Member
Hi David,

You are right. I have 24 records plus END OF CURSOR.

Thanks for correcting me.

Jitendra
Previous Topic: Change value of text item at run-time
Next Topic: SQL*Forms 3.0.16 conversion question
Goto Forum:
  


Current Time: Fri Sep 20 12:32:58 CDT 2024