For some reasons I'm getting this error when I select one of criterias (note: this column may contains some null values):
 
"The system has attempted to use an undefined value, which usually indicates a programming error, either in your code or some system code.

Null Pointers are another name for undefined values.

................."

On 19/04/06, George <[EMAIL PROTECTED]> wrote:
Thank you Gareth! It's a case issue. It works like this:
 
lower(Requester) like '%#Lcase(ARGUMENTS.searchstring)#%'
 
I'm using SQL 2000 Engine. I don't know why there is a case sensitive now. I guess it's still CFMX 7 issue cause it used to work.
 
Thanks everyone helping me out.
 
Cheers,
George

 
On 19/04/06, Gareth Edwards <[EMAIL PROTECTED] > wrote:
Is it a case problem? try

 lower(Req_id) = <cfqueryparam value="%#Lcase(ARGUMENTS.searchstring)#%" cfsqltype="cf_sql_integer"/>

What DB Engine are you using?

Cheers
 
Gareth.

George wrote:
It works on this ('=') but not for 'like %'.

On 19/04/06, Steve Onnis <[EMAIL PROTECTED] > wrote:
then strip out the cfparam tags
 
   <CFIF LEN(ARGUMENTS.SearchField) AND LEN(ARGUMENTS.searchstring)>
    WHERE
     <CFSWITCH _expression_="#ARGUMENTS.SearchField#">
      <CFCASE value="Requester">
       Requester = '#ARGUMENTS.searchstring#'
      </CFCASE>
      <CFCASE value="Description">
       Description = '#ARGUMENTS.searchstring#'
      </CFCASE>
      <CFCASE value="jobStatus">
       jobStatus = '#ARGUMENTS.searchstring#'
      </CFCASE>
      <CFDEFAULTCASE>
       Req_id = '#ARGUMENTS.searchstring#'
      </CFDEFAULTCASE>
     </CFSWITCH>
   </CFIF>
 
populate and run the query and see what it ends up looking like.  run it against the database and see if you get anything
-----Original Message-----
From: [email protected] [mailto:[email protected]]On Behalf Of George
Sent: Wednesday, April 19, 2006 1:55 PM
To: [email protected]
Subject: [cfaussie] Re: SQL search in CFMX 7

Hi Steve,
 
I think it's a bit hard to do it without CF. I have to pass parameters (e.g. search strings, criterias). See more codes below.
 
   <CFIF LEN(ARGUMENTS.SearchField) AND LEN(ARGUMENTS.searchstring)>
    WHERE
     <CFSWITCH _expression_="#ARGUMENTS.SearchField#">
      <CFCASE value="Requester">
       Requester = <cfqueryparam value="#ARGUMENTS.searchstring#" cfsqltype="cf_sql_varchar"/>
      </CFCASE>
      <CFCASE value="Description">
       Description = <cfqueryparam value="#ARGUMENTS.searchstring#" cfsqltype="cf_sql_varchar"/>
      </CFCASE>
      <CFCASE value="jobStatus">
       jobStatus = <cfqueryparam value="#ARGUMENTS.searchstring#" cfsqltype="cf_sql_varchar"/>
      </CFCASE>
      <CFDEFAULTCASE>
       Req_id = <cfqueryparam value="#ARGUMENTS.searchstring#" cfsqltype="cf_sql_integer"/>
      </CFDEFAULTCASE>
     </CFSWITCH>
   </CFIF>


George
 
On 19/04/06, Steve Onnis <[EMAIL PROTECTED] > wrote:
how about trying it without the queryparam and see if it works?  and then actually output whatt he query is and run it outside of cf directly on the database.
 
Maybe its not CF at all....maybe it the query or the data itself
 
Steve
-----Original Message-----
From: [email protected] [mailto:[email protected]]On Behalf Of George
Sent: Wednesday, April 19, 2006 12:44 PM
To: [email protected]
Subject: [cfaussie] Re: SQL search in CFMX 7

Hi Dale,
 
Thank you for the suggestion. However, it doesn't work :( (it returns nothing).
 
Regards,
George

 
On 19/04/06, Dale Fraser <[EMAIL PROTECTED]> wrote:

Try this

 

Description LIKE <cfqueryparam value="%#ARGUMENTS.searchstring#%" cfsqltype="cf_sql_varchar"/>

Regards
Dale Fraser


From: [email protected] [mailto: [email protected]] On Behalf Of George
Sent: Wednesday, 19 April 2006 12:17 PM
To: [email protected]
Subject: [cfaussie] SQL search in CFMX 7

 

Hi all,

 

I try to search a database using 'like' operator but it's not working in CFMX 7. Can anyone see what's wrong?

..............

Where

    Description LIKE '%<cfqueryparam value="#ARGUMENTS.searchstring#" cfsqltype="cf_sql_varchar"/>%'

 

Thanks,

George










--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "cfaussie" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cfaussie
-~----------~----~----~----~------~----~------~--~---

Reply via email to