Home » Developer & Programmer » Forms » Order by the control block data using oracle 10g form
Order by the control block data using oracle 10g form [message #581877] Thu, 11 April 2013 09:00 Go to next message
irfankundi786@yahoo.com
Messages: 212
Registered: February 2009
Location: pakistan
Senior Member

I have two block....both are the control block..
in first block i select the date and in second block the data of that date is populated.but the data is populated
using cursor in when-button-pressed trigger of that first block button...
in cursor the data is selected and placed in field of detail block using into clause.... each field..
.and one item of detail block is srno which is create in post-query of detail block using
:sysyem.trigger_record.

Now i want after populated the detail block the data is sorted desc one of the field of the detail block...
Can this possible using set_block_property() of block although the block is control block if yes where i should do
this??????

Please explian...????
Re: Order by the control block data using oracle 10g form [message #581878 is a reply to message #581877] Thu, 11 April 2013 09:07 Go to previous messageGo to next message
cookiemonster
Messages: 10853
Registered: September 2008
Location: Rainy Manchester
Senior Member
You'd have to clear the block and repopulate it with a cursor.
Re: Order by the control block data using oracle 10g form [message #581879 is a reply to message #581878] Thu, 11 April 2013 09:22 Go to previous messageGo to next message
irfankundi786@yahoo.com
Messages: 212
Registered: February 2009
Location: pakistan
Senior Member

but with the cursor of repopulate ...how the block is in desc by one field..because if i use again the same cursor to poulate than whats this benefits???
if i write a cursor in button when-button-trigger in first block like this code....
go_block('');
cursor emp_cur is
select empno,date,sal
from emp;
begin
for i in cur loop
select i.empno,i.date,i.sal
into :empno,:date,:sal
from emp
end loop
end;
this loop populate the block which is controll block..

syntax error should be ignored ...i wana to explain what i want to do...
this is not the actual query i have another query but the concept is that...
how i can do this...
Re: Order by the control block data using oracle 10g form [message #581880 is a reply to message #581879] Thu, 11 April 2013 09:26 Go to previous messageGo to next message
cookiemonster
Messages: 10853
Registered: September 2008
Location: Rainy Manchester
Senior Member
By writing a cursor that gets the data in the correct order.
There's no way round this if you're using control blocks.
Re: Order by the control block data using oracle 10g form [message #581882 is a reply to message #581880] Thu, 11 April 2013 10:09 Go to previous messageGo to next message
irfankundi786@yahoo.com
Messages: 212
Registered: February 2009
Location: pakistan
Senior Member

is there any other way that after populating the block the data is re order.....?????
any way....
Re: Order by the control block data using oracle 10g form [message #581885 is a reply to message #581882] Thu, 11 April 2013 10:27 Go to previous messageGo to next message
irfankundi786@yahoo.com
Messages: 212
Registered: February 2009
Location: pakistan
Senior Member

is there???
Re: Order by the control block data using oracle 10g form [message #581912 is a reply to message #581885] Thu, 11 April 2013 14:23 Go to previous messageGo to next message
cookiemonster
Messages: 10853
Registered: September 2008
Location: Rainy Manchester
Senior Member
Loop over block.
Copy each row into an array.
clear block.
Loop over block again taking data from array in correct order and sticking it back in the datablock.

Using the cursor is far simpler.

Re: Order by the control block data using oracle 10g form [message #581931 is a reply to message #581912] Fri, 12 April 2013 00:11 Go to previous message
Littlefoot
Messages: 19329
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
... while using a data block is the right way to do that (as it seems that cursor's select statement is based on a single table) (and even if it is not, a view is an option).
Previous Topic: LIST OF COUNTRIES
Next Topic: Create lov and recordgroup dynamically
Goto Forum:
  


Current Time: Tue Jul 29 16:13:05 CDT 2014

Total time taken to generate the page: 0.09972 seconds