As a last resort I have in the past written out and cfincluded a file based on
the contents of a database field. Obviously there are some security and
performance implications, but the ability to have CF interpret code (and not
just an expression) from a database can sometimes come in handy.
: I figured it out, but if you have a more elegant solution, I'm open to
: suggestions.
: Here's my current solution.
: <cfquery name="myQuery" datasource="dataSource">
: select myText from welcome_statements
: </cfquery>
: <cfoutput>#evaluate("#de(myQuery.myText)#")#</cfoutput>
: Thanks.
: mf
: -----Original Message-----
: From: Fennell, Mark P.
: Sent: Tuesday, June 30, 2009 4:57 PM
: To: '[email protected]'
: Subject: CF in the database?
: Greetings all,
: I'm trying to figure out a way in CF7 to store CF variables in the database to
: be selected out later and evaluated just like regular CF variables.
: For example, and I know this is a stupid example, but it's simple and makes
: the point, let's assume I have a database table called welcome_statements and
: it has a single column that contains string data such as "Welcome,
: #cookie.user_name#." In my home.cfm file, I write a query like select my_text
: from welcome_statements and have a CFOUTPUT block like
: <cfoutout>#myQuery.my_text#</cfoutput>. I've tried using various combinations
: of evaluate() and de() and replacing the # in the database with something
: that is replaced on evaluation in the query and in the cfoutput. All to no
: avail.
: I know you're wondering, "Why would you want to do a fool thing like that?"
: Well, I'm trying to figure out how to allow users to write form letters or MS
: Word-like mail-merge documents. I imagine it would be simpler in CF than to
: write some manner of database function/procedure which is why I'm asking for
: your assistance.
: Many thanks in advance.
: mf
: mark fennell
: athens regional medical center
: athens, ga
: -----------------------------------------------------------------------
: This email is intended only for the named recipient(s). It may contain
: information that is proprietary, confidential or otherwise prohibited from
: disclosure. If you are not the named addressee, you are not authorized to
: read, print, retain, copy or disseminate this message or any part of it. If
: you have received this message in error, please reply immediately by email or
: telephone me at 706-475-4357 and delete all copies of the message.
: -----------------------------------------------------------------------
: -------------------------------------------------------------
: To unsubscribe from this list, manage your profile @
: http://www.acfug.org?fa
Mischa Uppelschoten
VP of Technology
The Banker's Exchange, LLC.
4200 Highlands Parkway SE
Suite A
Smyrna, GA 30082-5198
Phone: (404) 605-0100 ext. 10
Fax: (404) 355-7930
Web: www.BankersX.com
Follow this link for Instant Web Chat:
http://www.bankersx.com/Contact/chat.cfm?Queue=MUPPELSCHOTEN
---------- Original Message ----------
FROM: "Fennell, Mark P." <[email protected]>
TO: <[email protected]>
DATE: Tue, 30 Jun 2009 17:07:15 -0400
SUBJECT: [ACFUG Discuss] NEVERMIND RE: CF in the database?
I figured it out, but if you have a more elegant solution, I'm open to
suggestions.
Here's my current solution.
<cfquery name="myQuery" datasource="dataSource">
select myText from welcome_statements
</cfquery>
<cfoutput>#evaluate("#de(myQuery.myText)#")#</cfoutput>
Thanks.
mf
-----Original Message-----
From: Fennell, Mark P.
Sent: Tuesday, June 30, 2009 4:57 PM
To: '[email protected]'
Subject: CF in the database?
Greetings all,
I'm trying to figure out a way in CF7 to store CF variables in the database to
be selected out later and evaluated just like regular CF variables.
For example, and I know this is a stupid example, but it's simple and makes the
point, let's assume I have a database table called welcome_statements and it
has a single column that contains string data such as "Welcome,
#cookie.user_name#." In my home.cfm file, I write a query like select my_text
from welcome_statements and have a CFOUTPUT block like
<cfoutout>#myQuery.my_text#</cfoutput>. I've tried using various combinations
of evaluate() and de() and replacing the # in the database with something that
is replaced on evaluation in the query and in the cfoutput. All to no avail.
I know you're wondering, "Why would you want to do a fool thing like that?"
Well, I'm trying to figure out how to allow users to write form letters or MS
Word-like mail-merge documents. I imagine it would be simpler in CF than to
write some manner of database function/procedure which is why I'm asking for
your assistance.
Many thanks in advance.
mf
mark fennell
athens regional medical center
athens, ga
-----------------------------------------------------------------------
This email is intended only for the named recipient(s). It may contain
information that is proprietary, confidential or otherwise prohibited from
disclosure. If you are not the named addressee, you are not authorized to read,
print, retain, copy or disseminate this message or any part of it. If you have
received this message in error, please reply immediately by email or telephone
me at 706-475-4357 and delete all copies of the message.
-----------------------------------------------------------------------
-------------------------------------------------------------
To unsubscribe from this list, manage your profile @
http://www.acfug.org?fa
-------------------------------------------------------------
To unsubscribe from this list, manage your profile @
http://www.acfug.org?fa=login.edituserform
For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------