Reply to topic
Unusual DB column error
byron
Forum Admin

Joined: 07 Mar 2004
Posts: 160
Location: Newark, DE, USA
Reply with quote
I was doing a query against a MS SQL Server and in my cfquery I was accidentally pulling a column out of the database twice.

SELECT d.*,
p.brand_id as plan_brand_id,
m.mailserver_ip, m.mailserver_address, m.mailserver_ip
FROM domain_info d LEFT OUTER JOIN plan_lookup p ON d.plan_id = p.plan_id
LEFT OUTER JOIN mailserver m on m.mailserver_id = d.mailserver_id
WHERE 1=1 and d.domain_id = 19479

I did a dump of the resulting query and some of the cols had the wrong data values.

I only noticed the mailserver_ip cols and plan_brand_id col having wrong data. Many of the other columns seemed OK.

I guess this is some kind of bug.
RconR


Joined: 08 Apr 2004
Posts: 1
Location: NYC
Reply with quote
Your 2 line has the m.mailserver_ip column twice, look at the beginning and look at the end of that line you will see that you have it twice.
byron
Forum Admin

Joined: 07 Mar 2004
Posts: 160
Location: Newark, DE, USA
Reply with quote
Yes, I did notice this was the problem. It seems to be a CF or ODBC bug of some sort. Having the col twice in my select should not be shifting data in some of the columns. Doing a similar query in Query Analyzer will yield correct results.

Just wanted to post it as a FYI, Very Happy
Unusual DB column error
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Reply to topic