IB - Developer Center    Forums  Hop To Forum Categories  FOCUS/WebFOCUS    Conditionally adding Conditions to report
Go
New
Search
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Gold member
Posted
Can I include where condition based on the user entered i/p?

WHERE ( DIR_ITEM_MSTR.PARNT_ITEM_F EQ 'Y' )
AND ( DIR_ITEM_MSTR.MRCH_PUBL_F EQ 'Y' )
AND ( ITEM_TYPE_MSTR.ITEM_TYPE_T EQ 'Sellable' )
AND ( CATG_TMPL_ATTR.STAT_C EQ 'R' )
AND (IF &DETAIL EQ 'ALL' THEN (CATG_HDR.CATG_I EQ &SpecifiedTemplate))
AND (ITEM_CATG.BUS_UNIT_C EQ &BusinessUnit)
AND (ITEM_TYPE_INFO.PUBL_DEST_C EQ &PublishDestination);

If detail is All, the I want to add filter criteria on CATG_I.

Can I do it?

Otherwise I may need to repeat the code by changing the where condition.
 
Posts: 77 | Registered: December 22, 2004Reply With QuoteEdit or Delete MessageReport This Post
Platinum Member
Posted Hide Post
I would do this the following way.

-IF &DETAIL NE 'ALL' THEN GOTO NEXT;
WHERE CATG_HDR.CATG_I EQ &SpecifiedTemplate)) ;
-NEXT
WHERE ...
 
Posts: 197 | Registered: June 08, 2003Reply With QuoteEdit or Delete MessageReport This Post
Gold member
Posted Hide Post
-IF &Detail NE 'ALL' THEN GOTO -NEXT;
WHERE ( DIR_ITEM_MSTR.PARNT_ITEM_F EQ 'Y' )
AND ( DIR_ITEM_MSTR.MRCH_PUBL_F EQ 'Y' )
AND ( ITEM_TYPE_MSTR.ITEM_TYPE_T EQ 'Sellable' )
AND ( CATG_TMPL_ATTR.STAT_C EQ 'R' )
AND (ITEM_CATG.BUS_UNIT_C EQ &BusinessUnit)
AND (ITEM_TYPE_INFO.PUBL_DEST_C EQ &PublishDestination);

-NEXT
WHERE ( DIR_ITEM_MSTR.PARNT_ITEM_F EQ 'Y' )
AND ( DIR_ITEM_MSTR.MRCH_PUBL_F EQ 'Y' )
AND ( ITEM_TYPE_MSTR.ITEM_TYPE_T EQ 'Sellable' )
AND ( CATG_TMPL_ATTR.STAT_C EQ 'R' )
AND ( CATG_HDR.CATG_I EQ &SpecifiedTemplate)
AND (ITEM_CATG.BUS_UNIT_C EQ &BusinessUnit)
AND (ITEM_TYPE_INFO.PUBL_DEST_C EQ &PublishDestination);


This is what I tried. But I receive the following error message "0 ERROR AT OR NEAR LINE 307 IN PROCEDURE ADHOCRQ FOCEXEC *
(FOC281) ALPHA ARGUMENTS IN PLACE WHERE NUMERIC ARE CALLED FOR"


After applying conditional where, I want to execute the remaining statement like formatting, etc.

Guide me how can I do it?
 
Posts: 77 | Registered: December 22, 2004Reply With QuoteEdit or Delete MessageReport This Post
Virtuoso
Posted Hide Post
I'm not sure what is giving the numeric error to you however, what version of FOCUS are you using, In our WebF 4.3.6 the length of amper variables names is limited to 12 and I noticed you have a longer one if I am counting correctly.
 
Posts: 1307 | Location: Council Bluffs, IA | Registered: May 24, 2004Reply With QuoteEdit or Delete MessageReport This Post
Gold member
Posted Hide Post
Got it fixed.

Syntax what I was using in the previous code was incorrect.
 
Posts: 77 | Registered: December 22, 2004Reply With QuoteEdit or Delete MessageReport This Post
 Previous Topic | Next Topic powered by eve community  
 

IB - Developer Center    Forums  Hop To Forum Categories  FOCUS/WebFOCUS    Conditionally adding Conditions to report

Copyright © 1996-2008 Information Builders, leaders in enterprise business intelligence.