| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Forms 4.5 Blocks from a view???
In article <5gp4cp$ajq$2_at_diana.ibernet.es>, Dudux <arroniz_at_jet.es> wrote:
>I want to show some records from a table adding a column from another
>table and I need to order by this last column.
>For example, supose that I want all the records of the SCOTT.ITEM
>table and the column DESCRIP of the table SCOTT.PRODUCT
>(they have a comun column->PRODID), and I want to order by the column
>DESCRIP.
>
>Is so easy to do this with a view, it´s possible to do that without a
>view???
Yes, but you cannot use default block processing to query the table. You can write your own select cursor and use it instead of doing the Execute_Query command to populate your block. You then use a loop to fetch rows and populate the block, using Next_Record to move down to each row.
Your select should include the main table's rowid, so you can then update the main table using the block. The order-by item from the other table should be identified in the block as non-base-table.
This method works if you can fetch all records in the query on the first query execution. If you have hundreds of rows, this would take too long. The only alternative would then be to use DBMS_SQL with on-select and on-fetch triggers.
Regards,
Steve Cosner
![]() |
![]() |