Re: Forms Set_Block_Property

From: Michael J. Moore <mNiOcShPaAeMl.j.moore_at_wcom.com>
Date: 2000/08/10
Message-ID: <K9Hk5.1226$jq1.19919_at_pm02news.wcom.com>#1/1


You need to have single quotes around the %whatever%, and ASC does not work for Oracle, you will need an "order by" clause to get a sort.

In order to get the single quotes you may need to do something like

Set_Block_Property(blk_id, DEFAULT_WHERE, ' PACRESULT.TELEFONE1 LIKE ''%' || :findpac.item_contacto || '%'' ');

All of the quotes in the above line are single-quote marks.

"Breno de Avellar Gomes" <brenogomes_at_ieee.org> wrote in message news:3992D0C8.17B79EA8_at_ieee.org...
> Hello All,
>
> I am trying to set where clause for a block. The code follows error
 description.
> If a leave the field blank the condition is set properly, otherwise it
 gives me
> FRM-40505 error: unable to perform query.
>
> What I am doing wrong ?
>
> I appreciate any suggestions.
>
> Thanks in advance.
>
> DECLARE
> blk_id Block;
> BEGIN
> blk_id := Find_Block('PACRESULT');
> IF NOT Id_Null(blk_id) THEN
> IF (:findpac.item_contacto IS NOT NULL) THEN
> Set_Block_Property(blk_id, DEFAULT_WHERE, ' PACRESULT.TELEFONE1 LIKE
 %' ||
> :findpac.item_contacto || '% ASC');
> ELSE
> Set_Block_Property(blk_id,DEFAULT_WHERE, '');
> END IF;
> Set_Block_Property(blk_id,ORDER_BY, 'CLIENTE');
> GO_BLOCK('PACRESULT');
> EXECUTE_QUERY;
> ELSE
> Message('O bloco PACRESULT não existe.');
> RAISE Form_Trigger_Failure;
> END IF;
> END;
>
> --
> ----------------------------------------------------
> | -°) (°- |
> | /\\ Linux the choice of the GNU generation //\ |
> | _\_v v_/_ |
> ----------------------------------------------------
>
> Breno de Avellar Gomes
> Database Applications & Internet Developer
>
> Arquivo-Sistemas de Bases de Dados
> P. O. Box 5006
> EC Municipio
> 4017-001 Porto
> Portugal
>
> brenogomes_at_ieee.org
> brenogomes_at_acm.org
> Cellular phone: 351-917383469
> Cellular messages: 917383469_at_sms.telecel.pt
> ICQ # 35567342
>
> Toll free fax and answering machine from USA
> 1-888-EXCITE2 extension 291-303-8152
>
> Outside USA (international fares apply)
> 1-917-463-3173
Received on Thu Aug 10 2000 - 00:00:00 CEST

Original text of this message