Db Table with hyphenated column headings

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

  1. #1

    Default Db Table with hyphenated column headings

    I have a table I can only read from. (Vendor) It has colum headings with things
    like MIDDLE-NAME or NAME-ID. Of course, when you do a
    <CFOUTPUT>#MIDDLE-NAME#</CFOUTPUT>, it gives a VARIABLE MIDDLE not found.
    Question: How do you access a table's column headings that are illegal varibale
    names? Currently, we are at CF 6.1.

    mccldo Guest

  2. Similar Questions and Discussions

    1. different column boarders within a table
      It is easy to change the thicknesses of all columns and rows in a table but how to change the thickness of some of the columns and only the vertical...
    2. add column to table with sql
      Does anyone know the SQL syntax to add a column to an existing Access table?
    3. Datagrid render column headings. ASPX Page Model. Events
      I have written a usercontrol which I drop onto aspx pages in my project, this usercontrol performs changes on the content of various aspx controls...
    4. How do I create a YES/NO column in my table?
      I use this code to create a table dynamically... strSQL = "CREATE TABLE (FirstName TEXT(30), LastName TEXT(20));" conn.execute(strSQL) This...
    5. Repeating column headings
      In my ASP programs, I would give style="display:table-header-group" in thead tags. This would make the thead repeat on all pages when I printed a...
  3. #2

    Default Re: Db Table with hyphenated column headings

    You can alias the column name in your query, then use the alias in you
    CFOUTPUT. You will also probably need to enclose the "bad" name within brackets
    within the query, such as in the following example.

    SELECT [middle-name] AS middle_name,
    [name-id] AS name_id
    FROM yourtable
    blah, blah

    Then

    <CFOUTPUT> #middle_name# #name_id# </cfoutput>...etc.

    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