Retrive data from attribute spaced attribute.

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

  1. #1

    Default Retrive data from attribute spaced attribute.

    Hi.

    I'm retrieving data from an excel sheet.
    But one of the attributes is name "Phone private".

    This is a problem when I want to write out the value.

    Of cause it fails if I do this #Data. Phone private#.

    How can I retrieve that value? Is it possible.

    I would prefer not to rename the attribute in the excel sheet.

    Best regards,
    Morten


    kruse Guest

  2. Similar Questions and Discussions

    1. Add attribute to tag
      What files do i look for to modify to add attributes to a tag? I want it to suggest more attributes when i open specific tags. I've been trying to...
    2. Dot path to data attribute question
      HI!! I have a question about what the best way is to build a dot path to a data attribute. I am trying to get the data in this attribute ...
    3. Looking For Hide Attribute
      I'm looking for a way to hide a field from being displayed. Currently I have it set as READONLY, but some users are confused and think the field is...
    4. Retrieving XML attribute using XML::XPath::Node::Attribute
      Hi I am trying to retrieve an attribute of a particular node from my XML using "XML::XPath::Node::Attribute", but couldn't come across on how to...
    5. Add Attribute to <TD>
      Does anybody know how to add the html 'nowrap' attribute to a particular column in a datagrid? This doesn't work, because I suspect the...
  3. #2

    Default Re: Retrive data from attribute spaced attribute.

    Try this...

    <cfquery datasource="xyz" name="Data">
    select [phone private] as phone from testTable
    </cfquery>

    <cfoutput>
    #Data.phone #
    </cfoutput>
    reenaroy Guest

  4. #3

    Default Re: Retrive data from attribute spaced attribute.

    Originally posted by: reenaroy
    Try this...

    <cfquery datasource="xyz" name="Data">
    select [phone private] as phone from testTable
    </cfquery>

    <cfoutput>
    #Data.phone #
    </cfoutput>

    I guess that that would work.
    But for me it is not possible to do so because I dont know what data the sheet
    will contain.

    I retrieve the data like this.

    <cfquery name="GetImportData" datasource="Excel">
    SELECT *
    FROM [sheet1$]
    IN '#Form.FileName#' 'EXCEL 5.0;'
    </cfquery>
    The sheet can be 5 differet type and therfore I waunt use use your example
    because I then had to make 5 different queryes and if a field in the sheet was
    altered i had to change the query too.

    Any other ideas?


    kruse Guest

  5. #4

    Default Re: Retrive data from attribute spaced attribute.

    Hi Kruse

    Use QoQ for this. Full code will look like this

    <cfquery name="GetImportData" datasource="Excel">
    SELECT * FROM [sheet1$] IN '#Form.FileName#' 'EXCEL 5.0;'
    </cfquery>

    <cfquery dbtype="query" name="Data">
    select [phone private] as phone from GetImportData
    </cfquery>

    <cfoutput>
    #Data.phone #
    </cfoutput>


    reenaroy 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