Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: ORACLE FORMS 4.5, how to use SORT in SQL query inside of When-Button-Pressed Trigger

Re: ORACLE FORMS 4.5, how to use SORT in SQL query inside of When-Button-Pressed Trigger

From: Kenton Ho <kjho_at_novice.uwaterloo.ca>
Date: 1997/03/10
Message-ID: <01bc2d82$f594cf60$12706181@kjho>#1/1

You can also do a few other things too:

  1. Use a control block with buttons that have the same name as the items which you want to sort
  2. Reference the button name itself (:SYSTEM.TRIGGER_ITEM) and place this value into the order by section of the viewing block (SET_BLOCK_PROPERTY)
  3. Go to the block, and execute a query....

This gives you generic code....

  I.e. with button control block:             :control.item1
       and designated display block:       :ordered

 When-button-pressed: (On Control block level)

DECLARE     v_item VARCHAR2(200)
:=SUBSTR(:SYSTEM.TRIGGER_ITEM,INSTR(:SYSTEM.TRIGGER_ITEM,'.')+1); BEGIN        SET_BLOCK_PROPERTY('ordered',ORDER_BY,v_item);

     GO_BLOCK('ordered');
     CLEAR_BLOCK(NO_VALIDATE);
     EXECUTE_QUERY;

END; This code will take the item1, and use 'item1' for the restriction on the order by for the query on the block named 'ordered'

Note: :SYSTEM.TRIGGER_ITEM returns the block and the item, so a substr, and instr are used to isolate just the item name....

Hope this gives more help....

Kenton

Jens U. Veigel <jens_at_deutschware.com> wrote in article <33219f8b.171413269_at_news.aud.alcatel.com>...
> Hi Pro's
>
> I have put push buttons with the colums names accross my Form, where
> I'm displaying a table in tabular format, in order for the user to
> sort by column name. I'm trying to get a simple SQL query inside of a
> When-Button-Pressed Trigger going. I'm getting weired errors, like
> you cannot do this here etc... Does this button need to be in a
> control block ? Right now I have it in the same canvas.
>
> I found nothing on this subject in the helpfile, any sample PL code
> would be appreciated. I'm almost done with my application.
>
> All I want to do is:
>
> select table.column1
> table.column2,
> table.colum3
> from table
> sort by table.column2
>
> inside a When-Button-Pressed-Trigger
> on a already displayed querry/table in Forms 4.5
> (basicaly resorting on demand by column#)
>
> All your help is appreciated!!!!
> Thanks
>
> Jens
> jens_at_deutschware.com
>
>
>
Received on Mon Mar 10 1997 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US