Link to home
Start Free TrialLog in
Avatar of John500
John500Flag for United States of America

asked on

USING curly braces ' { } ' as part of JOIN

Need help understanding the purpose or use of the braces in this statement:

SELECT .....
FROM    TABLE_1 A,  TABLE_2 B,  TABLE_3 C,
             { oj { oj TABLE_4 D  LEFT OUTER JOIN
             TABLE_5 E ON D.umLocationID = E .umLocationID } LEFT OUTER JOIN
             TABLE_6 F ON D.umLocationID = F.umLocationID } INNER JOIN
WHERE
...

How would this query be interpreted?  Isn't there an easier way to do what's trying to be done here?  

I take it the notation ' oj ' means to do an OUTER JOIN on the results of the statement located inside the braces ?

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Kevin Cross
Kevin Cross
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The braces enclose ODBC escape sequences. This syntax was intended to allow you to write ODBC queries that were independent of the target database SQL dialect. See
http://support.microsoft.com/kb/142930 
Avatar of John500

ASKER

Ok, so if I remove the 'oj' syntax,  does that have any impact on the results?  If I run this query in the editor, I get data back.  If I take off the 'oj' syntax and the associated braces, I get no data back.  I don't get any errors but I don't get any data?

What am I missing?

Thanks
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
when you say take off, exactly what is the syntax you have left?
please clarify that you are using SQL server 2008 and editor you are referring to is SQL management studio.  Paste the query you are using that returns no data and can try to help troubleshoot -- but should take a look here at syntax: http:#a32358114
Avatar of John500

ASKER

Thanks!

 I got it to work and it was something stupid.