CF,

On 10/24/2003 at 14:53, you wrote:

CC> I have been using a CFMAIL tag with a query results set.  I
CC> specify the TO field to be the var representing the column in the
CC> db containing the email address. That works fine.

CC> Now I want to create a testMode state for testing and want to
CC> change the TO field based on if I'm in TestMode or not.

CC> What I've tried... * putting <CFIF> inside the CFMAIL tag *
CC> putting a var inside the CFMAIL tag for the TO value and trying to
CC> cfset it prior to the CFMAIL tag but the problem is, in one case I
CC> want to send to a fixed address (mine) but still using the query
CC> list so therefore send myself multiple copies of the same email,
CC> one for each row in the query results set. In the other case I
CC> want to actually use the query var for the email address which is
CC> itself a var.  I've tried using #Evaluate(DE())# functions but no
CC> success.

CC> I also want to limit the query to a smaller set of rows from the
CC> email list using MAXROWS parameter of CFMAIL tag. Again, tried
CC> using a var inside the CFQUERY tag like so: <cfquery
CC> name="qGetAlertList" #maxrowsparam# datasource=#DSN_DB#
CC> dbtype="ODBC"> but it throws an error.

How about doing your test mode switching in your SQL:

<cfquery...>
select <cfif not testmode>dbcolumnname<cfelse>'[EMAIL PROTECTED]' as dbcolumnname</cfif>
...
<cfif testmode>limit n</cfif>;
</cfquery>

Not sure what database platform you're using, but see if you can
specify your row limit within your SQL (PostgreSQL uses the 'limit'
keyword) instead of using maxrows="n".

~ Ubqtous ~

[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to