Home » Developer & Programmer » Forms » How to get to the last record or refreshing a block...
How to get to the last record or refreshing a block... [message #664895] |
Thu, 10 August 2017 05:28 |
|
Claraviolet
Messages: 8 Registered: August 2017
|
Junior Member |
|
|
Hi guys,
I have googled quite some time and I have tried looping all the records like,
first_record;
loop
exit when GET_BLOCK_PROPERTY(block_name, TOP_RECORD) = l_top_rec;
next_record;
end loop;
go_record(l_top_rec);
loop
exit when :SYSTEM.CURSOR_RECORD = l_cur_rec or :SYSTEM.LAST_RECORD = 'TRUE';
next_record;
end loop;
Still it's just making modifying all the records based on the first record.
So, I have tried this,
first_record;
loop
exit when :SYSTEM.LAST_RECORD = 'TRUE';
next_record;
end loop;
go_record(l_top_rec);
loop
exit when :SYSTEM.CURSOR_RECORD = l_cur_rec or :SYSTEM.LAST_RECORD = 'TRUE';
next_record;
end loop;
it's giving me null value in an aggregate function.
So, I have just tried execute_query followed by go_record(l_top_rec) but even that is giving me the null value in aggregate column.
So, I am out of ideas.
it would be great if you just refresh a block but if now, I wouldn't mind executing the entire query and going to that particular record.
So, can you guys help me?
Thanks in advance.
|
|
|
|
|
|
|
Re: How to get to the last record or refreshing a block... [message #664924 is a reply to message #664923] |
Fri, 11 August 2017 07:02 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
I'd say that "block" is the data block (based on a table). Therefore, once you entered values into block items and saved them, they are now stored in the database AND they are visible on the screen.
So, why are you trying to display those values using a querying mechanism?
Anyway: if there's a unique identifier for that record (such as ID), you could use it in PRE-QUERY trigger to set the criteria. First, in PRE-INSERT trigger, create the ID valueselect seq_name.nextval into :global.id from dual;
:block.id := :global.id; Then, in PRE-QUERY trigger, use that value:Alternatively, you could use SET_BLOCK_PROPERTY and its ONETIME_WHERE property.
|
|
|
Re: How to get to the last record or refreshing a block... [message #664925 is a reply to message #664924] |
Fri, 11 August 2017 07:04 |
|
Claraviolet
Messages: 8 Registered: August 2017
|
Junior Member |
|
|
Littlefoot wrote on Fri, 11 August 2017 07:02I'd say that "block" is the data block (based on a table). Therefore, once you entered values into block items and saved them, they are now stored in the database AND they are visible on the screen.
So, why are you trying to display those values using a querying mechanism?
Anyway: if there's a unique identifier for that record (such as ID), you could use it in PRE-QUERY trigger to set the criteria. First, in PRE-INSERT trigger, create the ID valueselect seq_name.nextval into :global.id from dual;
:block.id := :global.id; Then, in PRE-QUERY trigger, use that value:Alternatively, you could use SET_BLOCK_PROPERTY and its ONETIME_WHERE property.
Due to the requirement, when the user updates stuff, the values should get refreshed.
There is no unique identifier for the record unfortunately.
|
|
|
|
|
|
Re: How to get to the last record or refreshing a block... [message #664929 is a reply to message #664927] |
Fri, 11 August 2017 07:49 |
joy_division
Messages: 4963 Registered: February 2005 Location: East Coast USA
|
Senior Member |
|
|
Claraviolet wrote on Fri, 11 August 2017 08:16Littlefoot wrote on Fri, 11 August 2017 07:08Quote:
Due to the requirement, when the user updates stuff, the values should get refreshed.
OK, but *what* do you want to refresh? Values you currently see on the screen are "refreshed", aren't they?
No. It's hard to explain but the values are not consistent. So, I would like to refresh them.
I would say so. Your explanation is terrible an no one knows what you are talking about. You might, but no one else does. Try again, and don't just repeat the same thing. I have a feeling you just do not know how forms work and are doing inserts and updates in your code when forms handles all of that inherently without any code.
|
|
|
|
Re: How to get to the last record or refreshing a block... [message #664931 is a reply to message #664929] |
Fri, 11 August 2017 07:53 |
|
Claraviolet
Messages: 8 Registered: August 2017
|
Junior Member |
|
|
joy_division wrote on Fri, 11 August 2017 07:49Claraviolet wrote on Fri, 11 August 2017 08:16Littlefoot wrote on Fri, 11 August 2017 07:08Quote:
Due to the requirement, when the user updates stuff, the values should get refreshed.
OK, but *what* do you want to refresh? Values you currently see on the screen are "refreshed", aren't they?
No. It's hard to explain but the values are not consistent. So, I would like to refresh them.
I would say so. Your explanation is terrible an no one knows what you are talking about. You might, but no one else does. Try again, and don't just repeat the same thing. I have a feeling you just do not know how forms work and are doing inserts and updates in your code when forms handles all of that inherently without any code.
Well, i have strict policies to follow. So i couldn't give more info. I apologize for that. You are right. I am totally new to forms. I know bsic stuff as it is similar to reports builder but that's about it.
|
|
|
|
|
|
|
Goto Forum:
Current Time: Wed Jan 22 11:03:52 CST 2025
|