CFQUERY error Anyone see an error!

Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default CFQUERY error Anyone see an error!

    I have a problem,this query will not do what I need it to. It keeps giving me
    an error, as shown below. I have tried everything I know to fix it... and
    nothing has fixed it.

    The table contains information
    emailaddress,fname,lname,streetaddress,city,state, zip,hphone,wphone,mphone as
    well as a Primary Automated number called "ParentCode"

    Anyone have any ideas on how to fix this?

    Error Executing Database Query.
    [Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft
    Access Driver] Syntax error (missing operator) in query expression
    'Ucase(emailaddress) = Ucase(Bob@a.com)'.

    The error occurred in
    D:\www\a\l\allsaintsnurseryschool.com\www\registra tion3.cfm: line 104

    102 : <cfquery datasource="allsaints" name="email">
    103 : SELECT DISTINCT emailaddress FROM registeredparents
    104 : WHERE Ucase(emailaddress) = Ucase(#SESSION.emailaddress#)
    105 : </cfquery>

    ryanstokes1234 Guest

  2. Similar Questions and Discussions

    1. Creation of triggers using <CFQUERY> tag is giving error
      Hi, I am creating triggers and stored procedure on ORACLE data base using <CFQUERY>. <CFQUERY DATASOURCE="CRM"> create or replace trigger...
    2. Simple WHERE clause in CFQUERY Has error executingdatabase query
      Hello, I'm sort of new to CF, but have been doing this enough that this is very frustrating! I'm using the standalone version of ColdFusion 6.1 on...
    3. CF Instance and cfquery login error
      We are trying to create a new instance and when we set up the database it verifies in the cfadmin, but when we go to look at the website, we get a...
    4. Error executing a cfquery update statement. PLEASE HELP
      I have been over and over this. I am trying to update a simple table. I took this script from the same server using a different DSN. I keep...
    5. error invalid characters in my cfquery?
      The list. What is that datatype your passing the list to? Is it an numeric based or string? If it is a string (char, varchar, ntext, nvarchar,...
  3. #2

    Default Re: CFQUERY error Anyone see an error!

    102 : <cfquery datasource='allsaints' name='email'> 103 : SELECT DISTINCT
    emailaddress FROM registeredparents 104 : WHERE Ucase(emailaddress) =
    Ucase(#SESSION.emailaddress#) 105 : </cfquery> More your ucase pound to the
    outside and put some ' ' around it may help alittle

    Knum Guest

  4. #3

    Default Re: CFQUERY error Anyone see an error!

    Aren't UCase and LCase the CF functions and UPPER and LOWER the SQL Functions?

    WHERE UPPER(emailaddress) = '#UCase(SESSION.emailaddress)#'

    HTH
    Zoe
    zoeski80 Guest

  5. #4

    Default Re: CFQUERY error Anyone see an error!

    Since his error message indicates an Access database, UCase and LCase are valid
    functions for both ColdFusion and Access, so either of these will work. Don't
    forget the single quotes around the text parameter!

    <cfquery datasource="allsaints" name="email">
    SELECT DISTINCT emailaddress
    FROM registeredparents
    WHERE Ucase(emailaddress) = Ucase('#SESSION.emailaddress#')
    </cfquery>

    <cfquery datasource="allsaints" name="email">
    SELECT DISTINCT emailaddress
    FROM registeredparents
    WHERE Ucase(emailaddress) = '#Ucase(SESSION.emailaddress)#'
    </cfquery>

    Phil

    paross1 Guest

  6. #5

    Default Re: CFQUERY error Anyone see an error!

    That said, Phil, shouldn't we just use the ANSI functions to make the query portable? I'd hate to upsize an application that relied on Access-specific functions in all the queries ;^)
    philh Guest

  7. #6

    Default Re: CFQUERY error Anyone see an error!

    Sometimes that happens when migrating from one db to another. I know that going
    from Access to SQL Server is not too bad, but going from Oracle to SQL Server
    or vice versa can be a major pain. I agree that using "standard" function names
    would definitely be preferred, but sometimes it isn't possible. I usually like
    to give multiple examples when there is a choice, especially so that they can
    recognize that there are differences that may trip them up later.

    Phil

    paross1 Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139