Steve,

You can build your complete SQL in variables in a results action, 
modifying the SELECT list, the FROM list, and the WHERE conditions 
according to some IF conditions. Of course, you will have to SELECT 
the ov_id3 column from the appropriate BASKET row first, to set up 
your if conditions.  Then, if you have the SQL you want in @@local
$StevesQuery, you can, in your directDBMS action, just put

<@VAR local$StevesQuery encoding="none">

Bill

On Mon, 17 Feb 2003 23:00:10 -0600, Fogelson, Steve wrote:

>In the following DBMS action, b2.OV_ID3 may be null. Is there a way 
in the
>WHERE clause to not include "AND (o5.OV_ID = b2.OV_ID3)" if 
"b2.OV_ID3 is
>null".
>
>If so, would it also be neccessary to not include "o5.OV_Name as 
`Option3`"
>in the SELECT clause?
>
>If so, how would I eliminate this?
>
>Thanks
>
>Steve Fogelson
>Internet Commerce Solutions
>
>SELECT p1.P_ID,
>  p1.P_SKU,
>  p1.P_Part_Number,
>  p1.P_Name,
>  p1.P_Price1 as `Price`,
>  b2.B_Quantity,
>  b2.B_ItemNumber,
>  p1.V_ID,
>  b2.OV_ID1,
>  o3.OV_Name as `Option1`,
>  b2.OV_ID2,
>  o4.OV_Name as `Option2`,
>  b2.OV_ID3,
>  o5.OV_Name as `Option3`
>
> FROM Products p1, Basket b2, OptionValue o3, OptionValue o4, 
OptionValue o5
> WHERE (b2.B_ShopperID = <@var user$U_ID>)
>  AND (p1.P_Disable Is Null)
>  AND (b2.P_ID = p1.P_ID)
>  AND (o3.OV_ID = b2.OV_ID1)
>  AND (o4.OV_ID = b2.OV_ID2)
>  AND (o5.OV_ID = b2.OV_ID3)
> ORDER BY b2.B_ItemNumber ASC
>_________________________________________________________
_______________
>TO UNSUBSCRIBE: send a plain text/US ASCII email to 
[EMAIL PROTECTED]
>                with unsubscribe witango-talk in the message body





________________________________________________________________________
TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED]
                with unsubscribe witango-talk in the message body

Reply via email to