Re: Size in the Select Statement
Date: Mon, 17 Aug 1998 16:33:55 +0200
Message-ID: <6r9f0q$bvf28_at_reader3.wxs.nl>
Arancha,
Do you mean that you use the SQL-statement in a report-query?
Normally the statement you put there never gets truncated, so I think
somenting else is wrong. Could it be that one of the variables you use has a
value of NULL?
I think that could cause strange behaviour, so you would have to check the
mandatory variables in a before report trigger, and make sure that you get a
valid SQL-statement if on of the other variables is empty.
For example:
Create 3 placeholder columns at the report level called sel_columns, grp_clause and where_clause. Set these fields as character fields with a width large enought to hold your columns, where-clause and group by clause
Next, create a before report trigger as follows:
function Before_Report_Trigger return boolean is begin -- build the columns-clause and the group-by clause: if :AGRUPADOR is not null then
:sel_columns := :AGRUPADOR;
:grp_clause := ' group by ' || :AGRUPADOR;
else
:sel_columns := ' ';
:grp_clause := ' ';
if :LIT_AGRUPADOR is not null then if :AGRUPADOR is not null then :sel_columns := :sel_columns || ', ' || :LIT_AGRUPADOR; else :sel_columns := :LIT_AGRUPADOR; end if; end if; -- now build the where-clause: if :WHERECLAVES is not null then
:where_clause := ' where ' || :WHERECLAVES;
else :where_clause := ' '; if :WHEREFILTRO is not null then if :WHERECLAVES is not null then :where_clause := :where_clause || ' and ' || :WHEREFILTRO ; else :where_clause := ' where ' || :WHEREFILTRO ; end if; end if; end;
now make yout query look like this:
select
&sel_cloumns
from &TABLAINFORME -- this variable should never be null!
&wherclause
&grp_clause
I hope this helps, you can check
http://www.cse.unsw.edu.au/~gylim/30872-x/oun33fi.htm for more info.
Jack
nety Received on Mon Aug 17 1998 - 16:33:55 CEST