ORDER BY - block property [message #314676] |
Thu, 17 April 2008 08:09  |
**credo**
Messages: 4 Registered: April 2008
|
Junior Member |
|
|
good day.
here's my problem.
i have a form module which displays columns from
table A and table B. since most of the displayed columns are
from table A, i created a base table block having table A as
the data source. for the required columns from table B, i do a post query. however i need to sort the displayed records using
a column from table B. is there a way i can do this?
pls help. thanks.
|
|
|
Re: ORDER BY - block property [message #314687 is a reply to message #314676] |
Thu, 17 April 2008 08:45   |
Kaeluan
Messages: 179 Registered: May 2005 Location: Montreal, Quebec
|
Senior Member |
|
|
Instead of using post query to display value from Table B, why not using a view that will already contain your data from table A and Table B and base you block on this view instead. this way it will be easy to set the order clause.
|
|
|
Re: ORDER BY - block property [message #314713 is a reply to message #314687] |
Thu, 17 April 2008 10:08   |
solisdeveloper
Messages: 48 Registered: March 2008 Location: Mexico
|
Member |
|
|
Well I'm not quiet sure of your situation but I think you can't sort records from table B based on a field from table A unless they are both included in the same SELECT statement.
Anyway, you can use the following code to programatically set the where condition:
set a DEFAULT_WHERE property, and execute the query like this:
DECLARE
vWhere VARCHAR2 (2000);
BEGIN
vWhere := 'employeeid = ' || :blk_emps.it_empid;
SET_BLOCK_PROPERTY('BLK_emps, DEFAULT_WHERE,vWhere);
go_block ('blk_emps');
Clear_Block;
Execute_Query;
END;
Then you can use SET_BLOCK_PROPERTY and modify the ORDER BY clause like this
SET_BLOCK_PROPERTY('BLK_emps, ORDER_BY, 'emphiredate DESC');
Hope that any of these helps.
Regards!
Solis.
|
|
|
Re: ORDER BY - block property [message #314818 is a reply to message #314676] |
Thu, 17 April 2008 20:59  |
**credo**
Messages: 4 Registered: April 2008
|
Junior Member |
|
|
thanks a lot. using a view gave me an idea. since i don't have the priv to create an object in the DB, i tried using a join as my data source. but i'm encountering FRM-40501. i'll just post a new thread for this. again, thanks.
|
|
|