> is this correct or am i missing something?
>
> select *
> from tbl
> where <cfif isdefined(")>
> id = #id#
> </cfif>
> or
> <cfif isdefined(")>
> name = #name#
> </cfif>
Did you intentionally leave out the argument for isdefined? Because if not,
you are definitely missing that:
<cfif isdefined("id")>
Also, what if neither are defined, or either one is not defined? The
resultant select would be
"select * from tbl where or" or
"select * from tbl where id = #id# or" or
"select * from tbl where or name = #name#" or
You'll get a syntax error for any of those statements.
Try:
select *
from tbl
where 1=1 or
<cfif isdefined("id")>
id = #id# or
</cfif>
<cfif isdefined("name")>
name = #name# or
</cfif>
1=1
- Sean
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sean Daniels
Manager, Engineering
Marketplace Technologies
(T) 207.439.6030
(C) 978.764.0799
~~~~~~~~~~~~~~~~~~~~~~~~~~~
http://www.dealforce.com
http://www.dealstream.com
http://www.mergernetwork.com
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.