Re: Total records in block

From: Valeri Sorokine <vsorokin_at_dd.ru>
Date: Wed, 08 Sep 1999 18:58:38 +0400
Message-ID: <37D6799E.680C54A3_at_dd.ru>


[Quoted] Hi, Maurécio,

What are you going to do with "FRM-40355: Query will retrieve XXX records."? [Quoted] You will have two messages, one yours about counted records and one 40355...

[Quoted] Anyway my point was about using the Count_Query built-in instead of setting "Query All Records" property to True...

Yours truly,
Valeri

P.S. Our users don't press <count_query>, we use Count_Query built-in

     in the KEY-EXEQRY trigger.

Maurécio wrote:
>
> Hi,
>
> that's almost perfect, except that I'd rather not intercepting messages
> in ON-MESSAGE trigger.
> As long as the user has to press <count_query>, it's cleaner (I think)
> to build a KEY-CQUERY (count-query key trigger) with:
>
> declare qt_recs varchar2(10);
> begin
> count_query;
> qt_recs := := Get_Block_Property(NAME_IN('SYSTEM.CURSOR_BLOCK'),
> QUERY_HITS);
> --
> -- do messages here (even if zero records...user may want to know)
> --
> end;
>
> Best regards,
> Maurício.
>
> In article <37CE1A42.B13E1B8C_at_dd.ru>,
> Valeri Sorokine <vsorokin_at_dd.ru> wrote:
> > Maurécio wrote:
> > >
> > > Yes, I surrender, the "thousands of record" make "query all
> > > records" a bad way; dealing with on-message is not one favorite
> > > of mines, though.
> > > If you have issued a count_query, then
> > > "get_block_property('<block_name>', query_hits)" will give you the
> > > number of record (in varechar2 format).
> >
> > Yeah, you are quite right. We use something like this:
> >
> > PROCEDURE On_Message_Trg IS
> > msgnum NUMBER := MESSAGE_CODE;
> > msgtxt VARCHAR2(80) := MESSAGE_TEXT;
> > msgtyp VARCHAR2(3) := MESSAGE_TYPE;
> > tmp_Cnt VARCHAR2(10);
> > tmp_Msg VARCHAR2(80);
> > ...
> > BEGIN
> > IF msgnum = 40355 THEN
> > tmp_Cnt := Get_Block_Property(NAME_IN('SYSTEM.CURSOR_BLOCK'),
> > QUERY_HITS);
> > IF tmp_Cnt != '0' THEN
> > ... we make our message about number of records here ...
> > ...
> > tmp_Msg := '...: '||tmp_Cnt;
> > ...
> > Message(tmp_Msg);
> > END IF;
> > ELSE
> > Message(msgtyp||'-'||TO_CHAR(msgnum)||': '||msgtxt);
> > END IF;
> > EXCEPTION
> > ...
> > END;
> >
> > Hope this helps.
> >
> > Best wishes,
> > Valeri
> >
> > >
> > > Regards,
> > > Maurício.
> > >
> > > Valeri Sorokine <vsorokin_at_dd.ru> wrote:
> > > >
> > > > Yeah, especially in the block with complicated POST-QUERY trigger!
> > > >
> > > > I don't think that a setting the "Query All Records" property to
> > > > True is a very fast solution...
> > > >
> > > > The Forms counts all records easily and fast by Count_Query
> > > > built-in.
> > > >
> > > > Still offer the using Count_Query...
> > > >
> > > > Hope this will help.
> > > >
> > > > Kirill Dylewski wrote:
> > > > >
> > > > > How about query executing time if there are 5000...10000...20000
> > > > > records in block?
> >

<skip>

-- 
Valeri Sorokine
[Quoted] ProSoft, Russia, Moscow, Information Systems Division
Phone: +7 (095) 234 0636 (6 lines) FAX: +7 (095) 234 0640
E-mail: vsorokin_at_dd.ru OR vsorokin_at_prosoft.ru
http://www.dd.ru
Received on Wed Sep 08 1999 - 16:58:38 CEST

Original text of this message