Ask a Question related to Coldfusion Database Access, Design and Development.
-
web-eng #1
Dynamic Where variable
I'm attempting to create a complete "Where" statement and save it to a variable.
It works fine when comparing a numeric field against a number but errors when
comparing a text field with text.
Using MS Access and CF7.
Suggestions please.
This code works.
<cfset where_variable = "where people.id =" 1>
<cfquery name="staff" datasource="company">
SELECT people.*
FROM people
#where_variable#
</cfquery>
This code doesn't
<cfset where_variable = "where people.first_name = 'bob' ">
<cfquery name="staff" datasource="company">
SELECT people.*
FROM people
#where_variable#
</cfquery>
web-eng Guest
-
Dynamic number of variable
Hello, I have a visual c++ application that puts data(variables) into a txt file, and every time it runs, it puts a different number of variables... -
Dynamic Variable ... how can I ?
Hi ! I need to disabled some buttons. Here's some AWEFUL code I have : for (i=1996; i<=2004; i++) { if (_root.year_array == false) { if... -
Dynamic Text Variable
Yes. Set up a field so that a script will change whatever variable the dynamic text field is linked to. -
evaluating dynamic variable
Hi, I'm having trouble evaluating a dynamic variable. I want to check if the variable $_POST is an empty string, as you'll see from the code.... -
Dynamic variable assignments
Here is a code segment for a frames page. I want to be able to change a frame source page depending on the browser. This is what I tried but it... -
PaulH *TMM* #2
Re: Dynamic Where variable
web-eng wrote:
#preserveSingleQuotes(where_variable)#> <cfquery name="staff" datasource="company">
> SELECT people.*
> FROM people
> </cfquery>PaulH *TMM* Guest
-
-
raulriera #4
Re: Dynamic Where variable
I know that solved ur error, but I tried using that and it doesnt work for me
<cfset lineaSQL = lineaSQL & " AND Usuario.sexo = '" & formulario.sexo & "'">
WHERE #PreserveSingleQuotes(lineaSQL)#
Trows an error
Error Executing Database Query.
[Macromedia][SQLServer JDBC Driver][SQLServer]Invalid column name 'm'
that "m" is the data of that formulario.sexo variable
raulriera Guest
-
web-eng #5
Re: Dynamic Where variable
Try <cfset lineaSQL = lineaSQL & " AND Usuario.sexo = " '#formulario.sexo#' >
web-eng Guest



Reply With Quote

