Skip to main content
July 16, 2009
Question

After Migration ,Join Issues in Coldfusion 8

  • July 16, 2009
  • 1 reply
  • 861 views

We have sampe two tables test1 and test100 , Wehile joining both the tables thorugh id. We have two or more columns with same column names in this table. But the values are different.

SELECT  a.ReturnInstructions,b.ReturnInstructions

FROM TEST1 a, TEST100 b
Where  a.ComponentId = b.Id

The query was working fine in coldfusion 4.5 in bringing the different values of the same column name  in development.

But in coldfusion 8, It is not working like that. Its copying the first table column value to the Second column values.

Example:

Table name : Test1

ReturnInstructions         ComponentId

--------------------------------------------

A                                   1

B                                   2

C                                   3

Table name : Test100

ReturnInstructions          ID

-----------------------------------------

X                                   1

Y                                   2

Z                                   3

After joining two tables, we are gettting like below.

ReturnInstructions         ReturnInstructions        

--------------------------------------------

A                                   A

B                                   B

C                                   C

If we look for a solution .We can do an alias for both the columns. that we have to do for the whole application,. Its tedious job ..

can you please let us know. Why the above query was working fine in coldfuion 4.5 and not in coldfusion 8?

    This topic has been closed for replies.

    1 reply

    nikos101
    Inspiring
    July 17, 2009

    Don't you have to use "left join" in there somewhere?

    July 21, 2009

    Hi,

    My question was why it was working in Coldfusion 4.5 and not in Coldfusion 8  i.e., giving two types of resluts

    SELECT  a.ReturnInstructions,b.ReturnInstructions

    FROM TEST1 a, TEST100 b
    Where  a.ComponentId = b.Id

    In Coldfusion 4.5

    Results:

    ReturnInstructions         ReturnInstructions      

    --------------------------------------------

    A                                   X

    B                                   Y

    C                                   Z

    In Coldfusion 8

    Results:

    ReturnInstructions         ReturnInstructions      

    --------------------------------------------

    A                                   A

    B                                   B

    C                                   C

    Inspiring
    July 21, 2009

    I've had similar frustrations with Cold Fusion and more recently, Oracle.  The gist of it is that as these programs get more advanced, they become less tolerant of sloppy code.  I would prefer to have these problems come up when I write the code, so I can get it right before it goes into production.

    In your case, the two fields are ambiguous.  Give your columns aliases.