Home » Developer & Programmer » Forms » Oracle Block Re Order Problem
Oracle Block Re Order Problem [message #628279] Sat, 22 November 2014 07:52 Go to next message
irfankundi786@yahoo.com
Messages: 269
Registered: February 2009
Location: pakistan
Senior Member
i have three block one is A which the master block another is B which the Detail of the A block and third one is C which is the Detail of Block A.All the Three block is tabular.in Block i want to re order in such manner that all those record comes first which have foustZnd the data in third block C and nullable values comes last how i can reordered the First block A.
Re: Oracle Block Re Order Problem [message #628281 is a reply to message #628279] Sat, 22 November 2014 08:59 Go to previous messageGo to next message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Here's what I think: ordering records can be done by setting data block's ORDER BY clause. As you (in advance) don't know which records will be retrieved in master block A, you'll have to set ORDER BY for that block (using SET_BLOCK_PROPERTY). It means that you'll have to calculate how many detail records are there in block C for selected A records.

Furthermore, as you still don't know which records are retrieved in the block A, you'll have to wait until query is executed, then find A block's LAST_QUERY (using GET_BLOCK_PROPERTY), extract its WHERE clause and use it in an ORDER BY clause while calculating number of C records (as you have to join tables A and C).

Once you do that, use that ORDER BY in SET_BLOCK_PROPERTY for the A block and re-execute query.

Looks awful and very complicated. I wouldn't want to do that.


A simpler version might be basing A block on a view instead of a table; that view would contain table A records + one additional column: number of detail C records for each A. Doing so, a simple ORDER BY clause could be used directly in data block's Property Palette. Much better I'd say.
Re: Oracle Block Re Order Problem [message #628282 is a reply to message #628281] Sat, 22 November 2014 09:09 Go to previous messageGo to next message
irfankundi786@yahoo.com
Messages: 269
Registered: February 2009
Location: pakistan
Senior Member
there is any simple method to do this?
Re: Oracle Block Re Order Problem [message #628284 is a reply to message #628282] Sat, 22 November 2014 09:13 Go to previous messageGo to next message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Apart from the one I already described? Maybe, but I can't think of any at the moment. Hopefully, someone else will.
Re: Oracle Block Re Order Problem [message #628329 is a reply to message #628284] Mon, 24 November 2014 02:59 Go to previous message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
The view option LF suggests is the only simple option as far as I can see. You could also base the block on a procedure, but that's more complicated than using the view.
Previous Topic: Oracle 11gR2 forms and Report Installation - Error in Installation Progress
Next Topic: dependent LOV in oracle forms
Goto Forum:
  


Current Time: Sat Apr 20 02:43:14 CDT 2024