![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, This runs on 9.02 - but not on V11 (because I read deprecation in V10) Object Error: [Sybase][ODBC Driver][SQL Anywhere]Transact-SQL outer joins are currently disabled Driver String: Select INNHEAD.company, custnumber, INNHEAD.city, INNHEAD.state, INNHEAD.phone, recommended, passcode2,deleted,INNVAR.COMPANY from DBA.INNHEAD,DBA.INNVAR where (DBA.INNVAR.VARID =* DBA.INNHEAD.VARCONNECT AND DBA.INNVAR.VARID <> 0) AND INNHEAD.Company like '%test%' order by INNHEAD.COMPANY,INNHEAD.CITY a) Should I just reenable it this -or b) Rewrite this ... and if so, what is the proper rewrite for it And why is this deprecated? Just curious so I understand. Thank you. |
#3
| |||
| |||
|
|
Hi, This runs on 9.02 - but not on V11 (because I read deprecation in V10) Object Error: [Sybase][ODBC Driver][SQL Anywhere]Transact-SQL outer joins are currently disabled Driver String: Select INNHEAD.company, custnumber, INNHEAD.city, INNHEAD.state, INNHEAD.phone, recommended, passcode2,deleted,INNVAR.COMPANY from DBA.INNHEAD,DBA.INNVAR where (DBA.INNVAR.VARID =* DBA.INNHEAD.VARCONNECT AND DBA.INNVAR.VARID <> 0) AND INNHEAD.Company like '%test%' order by INNHEAD.COMPANY,INNHEAD.CITY a) Should I just reenable it this -or b) Rewrite this ... and if so, what is the proper rewrite for it And why is this deprecated? Just curious so I understand. Thank you. |
#4
| |||
| |||
|
|
You could just set it back on for now ... but given this state, then next time you upgrade you will most likely need to visit this again and there the redress may only be to address the syntax. T/SQL outer joins are historical, encumbered with old behaviour and are non-standard in behaviour. Move the join to the From clause as in this rewrite Select INNHEAD.company, . . . From DBA.INNHEAD inh left outer joint DBA.INNVAR inv on inv.VARID = inh.VARCONNECT where inv.VARID <> 0 AND inh.Company like '%test%' order by inh.COMPANY,inh.CITY; -- note my use of table aliases is only a convenience for me and not required. Select INNHEAD.company, custnumber, INNHEAD.city, INNHEAD.state, INNHEAD.phone, recommended, passcode2,deleted,INNVAR.COMPANY from DBA.INNHEAD,DBA.INNVAR where (DBA.INNVAR.VARID =* DBA.INNHEAD.VARCONNECT AND DBA.INNVAR.VARID <> 0) AND INNHEAD.Company like '%test%' order by INNHEAD.COMPANY,INNHEAD.CITY "Robert Paresi" <FirstInitialLastName (AT) innquest (DOT) com> wrote in message news:4adf21cf$1 (AT) forums-1-dub (DOT) .. Hi, This runs on 9.02 - but not on V11 (because I read deprecation in V10) Object Error: [Sybase][ODBC Driver][SQL Anywhere]Transact-SQL outer joins are currently disabled Driver String: Select INNHEAD.company, custnumber, INNHEAD.city, INNHEAD.state, INNHEAD.phone, recommended, passcode2,deleted,INNVAR.COMPANY from DBA.INNHEAD,DBA.INNVAR where (DBA.INNVAR.VARID =* DBA.INNHEAD.VARCONNECT AND DBA.INNVAR.VARID <> 0) AND INNHEAD.Company like '%test%' order by INNHEAD.COMPANY,INNHEAD.CITY a) Should I just reenable it this -or b) Rewrite this ... and if so, what is the proper rewrite for it And why is this deprecated? Just curious so I understand. Thank you. |
#5
| |||
| |||
|
|
where inv.VARID <> 0 |
|
Thank you. I rewrote the query as you suggested. -Robert "Nick Elson [Sybase iAnywhere]" <@nick@dot@elson@at@sybase@dot@com@ wrote You could just set it back on for now ... but given this state, then next time you upgrade you will most likely need to visit this again and there the redress may only be to address the syntax. T/SQL outer joins are historical, encumbered with old behaviour and are non-standard in behaviour. Move the join to the From clause as in this rewrite Select INNHEAD.company, . . . From DBA.INNHEAD inh left outer joint DBA.INNVAR inv on inv.VARID = inh.VARCONNECT where inv.VARID <> 0 AND inh.Company like '%test%' order by inh.COMPANY,inh.CITY; -- note my use of table aliases is only a convenience for me and not required. Select INNHEAD.company, custnumber, INNHEAD.city, INNHEAD.state, INNHEAD.phone, recommended, passcode2,deleted,INNVAR.COMPANY from DBA.INNHEAD,DBA.INNVAR where (DBA.INNVAR.VARID =* DBA.INNHEAD.VARCONNECT AND DBA.INNVAR.VARID <> 0) AND INNHEAD.Company like '%test%' order by INNHEAD.COMPANY,INNHEAD.CITY "Robert Paresi" <FirstInitialLastName (AT) innquest (DOT) com> wrote in message news:4adf21cf$1 (AT) forums-1-dub (DOT) .. Hi, This runs on 9.02 - but not on V11 (because I read deprecation in V10) Object Error: [Sybase][ODBC Driver][SQL Anywhere]Transact-SQL outer joins are currently disabled Driver String: Select INNHEAD.company, custnumber, INNHEAD.city, INNHEAD.state, INNHEAD.phone, recommended, passcode2,deleted,INNVAR.COMPANY from DBA.INNHEAD,DBA.INNVAR where (DBA.INNVAR.VARID =* DBA.INNHEAD.VARCONNECT AND DBA.INNVAR.VARID 0) AND INNHEAD.Company like '%test%' order by INNHEAD.COMPANY,INNHEAD.CITY a) Should I just reenable it this -or b) Rewrite this ... and if so, what is the proper rewrite for it And why is this deprecated? Just curious so I understand. Thank you. |
#6
| |||
| |||
|
|
Thank you. I rewrote the query as you suggested. -Robert "Nick Elson [Sybase iAnywhere]" <@nick@dot@elson@at@sybase@dot@com@> wrote in message news:4adf26ff$1 (AT) forums-1-dub (DOT) .. You could just set it back on for now ... but given this state, then next time you upgrade you will most likely need to visit this again and there the redress may only be to address the syntax. T/SQL outer joins are historical, encumbered with old behaviour and are non-standard in behaviour. Move the join to the From clause as in this rewrite Select INNHEAD.company, . . . From DBA.INNHEAD inh left outer joint DBA.INNVAR inv on inv.VARID = inh.VARCONNECT where inv.VARID <> 0 AND inh.Company like '%test%' order by inh.COMPANY,inh.CITY; -- note my use of table aliases is only a convenience for me and not required. Select INNHEAD.company, custnumber, INNHEAD.city, INNHEAD.state, INNHEAD.phone, recommended, passcode2,deleted,INNVAR.COMPANY from DBA.INNHEAD,DBA.INNVAR where (DBA.INNVAR.VARID =* DBA.INNHEAD.VARCONNECT AND DBA.INNVAR.VARID <> 0) AND INNHEAD.Company like '%test%' order by INNHEAD.COMPANY,INNHEAD.CITY "Robert Paresi" <FirstInitialLastName (AT) innquest (DOT) com> wrote in message news:4adf21cf$1 (AT) forums-1-dub (DOT) .. Hi, This runs on 9.02 - but not on V11 (because I read deprecation in V10) Object Error: [Sybase][ODBC Driver][SQL Anywhere]Transact-SQL outer joins are currently disabled Driver String: Select INNHEAD.company, custnumber, INNHEAD.city, INNHEAD.state, INNHEAD.phone, recommended, passcode2,deleted,INNVAR.COMPANY from DBA.INNHEAD,DBA.INNVAR where (DBA.INNVAR.VARID =* DBA.INNHEAD.VARCONNECT AND DBA.INNVAR.VARID <> 0) AND INNHEAD.Company like '%test%' order by INNHEAD.COMPANY,INNHEAD.CITY a) Should I just reenable it this -or b) Rewrite this ... and if so, what is the proper rewrite for it And why is this deprecated? Just curious so I understand. Thank you. |
#7
| |||
| |||
|
|
Thank you. I rewrote the query as you suggested. -Robert "Nick Elson [Sybase iAnywhere]" <@nick@dot@elson@at@sybase@dot@com@> wrote in message news:4adf26ff$1 (AT) forums-1-dub (DOT) .. You could just set it back on for now ... but given this state, then next time you upgrade you will most likely need to visit this again and there the redress may only be to address the syntax. T/SQL outer joins are historical, encumbered with old behaviour and are non-standard in behaviour. Move the join to the From clause as in this rewrite Select INNHEAD.company, . . . From DBA.INNHEAD inh left outer joint DBA.INNVAR inv on inv.VARID = inh.VARCONNECT where inv.VARID <> 0 AND inh.Company like '%test%' order by inh.COMPANY,inh.CITY; -- note my use of table aliases is only a convenience for me and not required. Select INNHEAD.company, custnumber, INNHEAD.city, INNHEAD.state, INNHEAD.phone, recommended, passcode2,deleted,INNVAR.COMPANY from DBA.INNHEAD,DBA.INNVAR where (DBA.INNVAR.VARID =* DBA.INNHEAD.VARCONNECT AND DBA.INNVAR.VARID <> 0) AND INNHEAD.Company like '%test%' order by INNHEAD.COMPANY,INNHEAD.CITY "Robert Paresi" <FirstInitialLastName (AT) innquest (DOT) com> wrote in message news:4adf21cf$1 (AT) forums-1-dub (DOT) .. Hi, This runs on 9.02 - but not on V11 (because I read deprecation in V10) Object Error: [Sybase][ODBC Driver][SQL Anywhere]Transact-SQL outer joins are currently disabled Driver String: Select INNHEAD.company, custnumber, INNHEAD.city, INNHEAD.state, INNHEAD.phone, recommended, passcode2,deleted,INNVAR.COMPANY from DBA.INNHEAD,DBA.INNVAR where (DBA.INNVAR.VARID =* DBA.INNHEAD.VARCONNECT AND DBA.INNVAR.VARID <> 0) AND INNHEAD.Company like '%test%' order by INNHEAD.COMPANY,INNHEAD.CITY a) Should I just reenable it this -or b) Rewrite this ... and if so, what is the proper rewrite for it And why is this deprecated? Just curious so I understand. Thank you. |
#8
| |||
| |||
|
|
Nick has unfortunately demonstrated precisely why we have deprecated TSQL outer joins in the SQL Anywhere; the rewritten query below is not semantically equivalent to your original TSQL one. The additional predicate in the WHERE clause, where inv.VARID <> 0 because it is NULL-intolerant, effectively turns the query into an inner join because that predicate will eliminate null-supplied rows (from the inv (or INNVAR) table) where inv.VARID would be NULL. A correct rewriting would be Select INNHEAD.company, . . . From DBA.INNHEAD inh left outer join DBA.INNVAR inv on ( inv.VARID = inh.VARCONNECT and inv.VARID <> 0) Where inh.Company like '%test%' order by inh.COMPANY, inh.CITY; Examples of this begin on page 7 of the whitepaper. Glenn Robert Paresi wrote: Thank you. I rewrote the query as you suggested. -Robert "Nick Elson [Sybase iAnywhere]" <@nick@dot@elson@at@sybase@dot@com@ wrote You could just set it back on for now ... but given this state, then next time you upgrade you will most likely need to visit this again and there the redress may only be to address the syntax. T/SQL outer joins are historical, encumbered with old behaviour and are non-standard in behaviour. Move the join to the From clause as in this rewrite Select INNHEAD.company, . . . From DBA.INNHEAD inh left outer joint DBA.INNVAR inv on inv.VARID = inh.VARCONNECT where inv.VARID <> 0 AND inh.Company like '%test%' order by inh.COMPANY,inh.CITY; -- note my use of table aliases is only a convenience for me and not required. Select INNHEAD.company, custnumber, INNHEAD.city, INNHEAD.state, INNHEAD.phone, recommended, passcode2,deleted,INNVAR.COMPANY from DBA.INNHEAD,DBA.INNVAR where (DBA.INNVAR.VARID =* DBA.INNHEAD.VARCONNECT AND DBA.INNVAR.VARID <> 0) AND INNHEAD.Company like '%test%' order by INNHEAD.COMPANY,INNHEAD.CITY "Robert Paresi" <FirstInitialLastName (AT) innquest (DOT) com> wrote in message news:4adf21cf$1 (AT) forums-1-dub (DOT) .. Hi, This runs on 9.02 - but not on V11 (because I read deprecation in V10) Object Error: [Sybase][ODBC Driver][SQL Anywhere]Transact-SQL outer joins are currently disabled Driver String: Select INNHEAD.company, custnumber, INNHEAD.city, INNHEAD.state, INNHEAD.phone, recommended, passcode2,deleted,INNVAR.COMPANY from DBA.INNHEAD,DBA.INNVAR where (DBA.INNVAR.VARID =* DBA.INNHEAD.VARCONNECT AND DBA.INNVAR.VARID <> 0) AND INNHEAD.Company like '%test%' order by INNHEAD.COMPANY,INNHEAD.CITY a) Should I just reenable it this -or b) Rewrite this ... and if so, what is the proper rewrite for it And why is this deprecated? Just curious so I understand. Thank you. -- Glenn Paulley Director, Engineering (Query Processing) Sybase iAnywhere Blog: http://iablog.sybase.com/paulley EBF's and Patches: http://downloads.sybase.com choose SQL Anywhere Studio >> change 'time frame' to all To Submit Bug Reports: http://case-express.sybase.com SQL Anywhere Studio Supported Platforms and Support Status http://my.sybase.com/detail?id=1002288 Whitepapers, TechDocs, and bug fixes are all available through the Sybase iAnywhere pages at http://www.sybase.com/products/datab...chnicalsupport |
![]() |
| Thread Tools | |
| Display Modes | |
| |