Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
herpmaster #1
PreserveSingleQuotes and Evaluate
Hi all. I've run into a bit of a problem with part of an application. I have
users inputting , what can be, multiple animal (Species) names and have not
run into any trouble until, one of the Species they included had an apostrophe
in its name (Townsend's big-eared bat). Well, that thru my application out of
whack. Here's what I have going on: <CFLOOP from='1'
to='#Session.StateRecordNumber#' index='i'> <cfquery
name='add_ListedSpecies' datasource=#MyDataSource#> INSERT INTO
PUPOtherSpeciesofConcern (PupNumber, CommonName, ScientificName, StateStatus,
Comments) VALUES ('#Session.PUPNumber#',
'#Evaluate('StateSpeciesCommonName' &
i))#','#Evaluate('Session.StateSpeciesScientificNa me' & i)#',
'#Evaluate('Session.SpeciesStateStatus' & i)#',
'#Evaluate('Form.StateComments' & i)#') </cfquery> </CFLOOP> Anyway, if
I am correct, you can not use PreserveSingleQuotes with Evaluate. How do I go
about fixing the problem of potential single quotes? Tnx
herpmaster Guest
-
evaluate string
Hi I hve a list mylist= I am inserting the values dynamically in the string format in the list and the list becomes mylist=] or mylist=] now... -
Evaluate within CFSET
I'm looping through a list of sites. I've written queries to count the number of live and pending articles in tables that begin with the site's... -
Avoiding Evaluate
I'm starting with a formula, which is a string, in a variable. For example, calcFormula = (a + b) / c. I replace parts of the string with numeric... -
PreserveSingleQuotes Not Working in CFQUERY
Just a heads up to those for those using CFSCRIPT within a CFQUERY to compose a Dynamic SQL statement. When you try to use... -
PreserveSingleQuotes() problem
Hi, I have a database in which some of the text in it has a single quote, mainly to show posession, such as " cat's ". Anyway, I can't get this... -
eastinq #2
Re: PreserveSingleQuotes and Evaluate
You may have to do it in two steps.
<cfloop...
<cfset SpeciesName=Evaluate("StateSpeciesCommonName" & i)>
<cfquery...
'#PreserveSingleQuotes(SpeciesName)#'
eastinq Guest



Reply With Quote

