Concat problem with SQL

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

  1. #1

    Default Concat problem with SQL

    hi all
    I have a problem when I try to concat 2 fields with a dot, in a query (Oracle
    database).
    here an example :

    <query name="myquery" datasource="mydatasource">
    select field1 || '.' || field2 from mytable
    </query>

    in Toad, this query works correctly. but with coldfusion, an error is thrown
    (could not find FROM keyword)
    first, I thought it was the quotes, but PreserveSingleQuotes changes nothing

    has someone an idea ?

    ps : I'm a french guy, and I'm not quite good to explain problems in english.
    please ask me questions if you don't understand

    thanks

    Shivaan Keldon Guest

  2. Similar Questions and Discussions

    1. Concat two fields in SQL
      I am trying to concatenate two columns in an SQL statement but haven't been having much success: here is the portion of the SQL: ...
    2. Which version supports concat???
      I have a problem with different versions of MySQL supporting concat differently. The portion of the query that uses the concat function looks...
    3. php string concat
      Hello, Simple question here.... I am trying to concatenate 2 strings but it doesn't seem to work. My only experience in in C and VB 6.0. ...
    4. HOW CAN I CONCAT TWO LINEAR LISTS
      I have two linear lists: temp1 = temp1 = I want to combine them into one list i.e result =
    5. dropdownlist-concat two fields-can it be done
      I am not sure how to, or even if you can do this. I have tried several things. I have a drop down list that is databound to a datareader. I wish...
  3. #2

    Default Re: Concat problem with SQL

    I can't seem to duplicate your problem. I am able to concatenate two fields and
    a period with my Oracle 9i database just fine, using CF 6.1 and both the Oracle
    and ODBC socket connections.

    However, you might want to alias the combined field with a new name.

    SELECT field1 || '.' || field2 AS new_field FROM mytable

    Phil

    paross1 Guest

  4. #3

    Default Re: Concat problem with SQL

    It also works when I do it using Oracle 8i and CF7

    Originally posted by: paross1
    I can't seem to duplicate your problem. I am able to concatenate two fields
    and a period with my Oracle 9i database just fine, using CF 6.1 and both the
    Oracle and ODBC socket connections.

    However, you might want to alias the combined field with a new name.

    SELECT field1 || '.' || field2 AS new_field FROM mytable

    Phil



    Dan Bracuk Guest

  5. #4

    Default Re: Concat problem with SQL

    Thaks for your reply

    but I use an alias and I have always the theem erro.

    [Macromedia][Oracle JDBC Driver][Oracle]ORA-00923: FROM keyword not found
    where expected

    I use CF 6.1, and when I change the character . to * or another charater,
    my query run correctly.

    Please can you help me ! I I become crazy

    ps : Sorry for my english

    hebril Guest

  6. #5

    Default Re: Concat problem with SQL

    take baby steps to find the problem. Run these queries in this order until you
    find the error.

    select field1
    select field 2
    select field1, field 2
    select field1 || field2
    select field1 || ' not a dot '
    select field1 || '.'
    select field1 || '. || field2



    Dan Bracuk 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