The problem with this is that I am working with a Microsoft product that has
a mind of its own.  The SQL statement looks like this:
        SELECT
        *
        FROM
        TABLE
        for xml auto,elements

It returns a one column result whose name is
XML_F52E2B61-18A1-11d1-B105-00805F49916B and the xml is broken up to a
certain number of characters per line. What I want to do is to put that back
together as a single xml string that I can get my hands on, but because of
the name that Microsoft creates, I can't loop through it with Cold Fusion.

If anyone has any suggestions on how to get at this strange Microsoft column
with Cold Fusion, I would greatly appreciate it.  Thanks.

-----Original Message-----
From: Scott, Andrew [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 17, 2001 9:37 PM
To: CF-Talk
Subject: RE: Varaible Names with "-"

You could do the following if you don't have control of the DB:-)

<cfquery name="qtest: datasource="datasource">
 select `field-name` as FieldName from TableName
</cfquery>

Notice the ` which is located under the tilda(~) key this will return the
fieldname as it was written in the DB. However you can't use this with CF,
so using the as command this will rename the field to anything you want it
to be.

So you could then reference it instead of qtest.field-name, but as
qtest.FieldName instead.

Hope this helps:-)



regards

Andrew Scott
Senior Cold Fusion Application Developer
ANZ Business eCommerce
* Ph 8615 6018
* [EMAIL PROTECTED]

-----------------------------------------------------------------------
> This e-mail and any attachments to it (the "Communication") is
confidential and is for the use only of the intended recipient. The
Communication may contain copyright material of Australia and New Zealand
Banking Group Limited ABN 11 005 357 522 ("ANZ"), or any of its related
entities or of third parties. If you are not the intended recipient of the
Communication, please notify the sender immediately by return e-mail, delete
the Communication, and do not read, copy, print, retransmit, store or act in
reliance on the Communication. Any views expressed in the Communication are
those of the individual sender only, unless expressly stated to be those of
ANZ. ANZ does not guarantee the integrity of the Communication, or that it
is free from errors, viruses or interference.


-----Original Message-----
From: Warrick, Mark [mailto:[EMAIL PROTECTED]]
Sent: 18 January 2001 10:09
To: CF-Talk
Subject: RE: Varaible Names with "-"


This probably isn't the answer you're looking for, but you should rename the
column.  That's just plain bad database design to begin with.  And there's
no need to add on another layer of unnecessary programming when all you've
gotta do is rename the field.

---mark


--------------------------------------------------------------
Mark Warrick
Phone: (714) 547-5386
Fax: (714) 972-2181
Personal Email: [EMAIL PROTECTED]
Personal URL: http://www.warrick.net
Business Email: [EMAIL PROTECTED]
Business URL: http://www.fusioneers.com
ICQ: 346566
--------------------------------------------------------------


> -----Original Message-----
> From: Troy Hiltbrand [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 17, 2001 10:00 AM
> To: CF-Talk
> Subject: Varaible Names with "-"
>
>
> Is there any way to pull out the information about a query column
> that has a
> "-" in it?  The problem is that with SQL Server 2000, when you do a "for
>  xml" select statement, the column name that is returned has "-"s in it.
> From the documentation in SQL Server 2000, I am not seeing a name
> to rename
> that.  I am trying to pull out the xml from this query, but in order to do
> this, I need to get at the data with a column name that has a "-"
> in it.  If
> anyone has any suggestions, please let me know.  Thanks.
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to