Re: Max Length and Query Length in Forms 6.0

From: Matt B. <mcb_at_fightspam.sd.znet.com>
Date: 2000/06/07
Message-ID: <sju585ja2t5128_at_corp.supernews.com>#1/1


"jay vajramani" <jvajrama_at_ford.com> wrote in message news:393D259F.FF7828C4_at_ford.com...
> Hi, I am converting forms from 4.5 to 6.0
> One problem I am encountering is that:
> I have a base table block and a field in it ( say partbase ) had Maximum
 Length
> property set to 8 and Query length is set to 56.
> In enter-query mode - pre-query- trigger - I am populating this field to
> :block1.partbase := '#LIKE || ''''|| '3600'||'''' ;
> It gives me a numeric or value error in this trigger.
> But the same thing works perfectly in forms 4.5
> THis looks like a bug in FOrms 6.0.
> One workaround is increasing the Maximum Length of the field.
> Any other smart soultion to this without changing the properties?
> Let me know.
> Thanks
> Jay

We've had similar problems with a Forms 3.0 to 5.0 conversion. We redid our code on PRE-QUERY to instead modify the where clause for the block rather than use that pound-sign stuff that Forms 5.0 didn't seem to like:

  1. Create a control item in a control block (like 240 characters long) and populate it with the block's default where-clause on PRE-FORM or WHEN-NEW-FORM-INSTANCE:
:control_block.control_item := get_block_property('blockname', default_where);

[Quoted] 2. On PRE-QUERY of the block, concatenate your criteria above with the default_where that's in your control item:

IF <your extra criteria> is not null THEN   IF :controlblock.controlitem is null then     set_block_property('blockname',default_where, <your extra criteria>);   ELSE
    set_block_property('blockname',default_where,:controlblock.controlitem || ' [Quoted] AND ' || <your extra criteria>);
  END IF;
END IF; This is good because even if your block has no default_where now, if someone adds one at a later date, you're covered. <g!>

-Matt Received on Wed Jun 07 2000 - 00:00:00 CEST

Original text of this message