Home » Database » DB_DataObject » Bug #5416
joinAdd(): AS definition causes error with Oracle
Details
| Submitted | 2005-09-15 15:20 UTC |
|---|---|
| From | roehr at zilleon dot com |
| Assigned | alan_k |
| Status | Closed |
| Package | DB_DataObject |
| PHP Version | Irrelevant |
| OS | WInXP / Oracle 9.1 |
| Roadmaps | (Not assigned) |
Comments
[2005-09-15 15:20 UTC] roehr at zilleon dot com
Description:
------------
The AS keyword causes an error with Oracle when using aliases with joins.
Please remove "AS" - it is not needed for MySQL either - or make the definition database-specific.
I have seen bug #2319 but it causes the error even if the alias is not equal to the table name (see below).
Thanks and best regards,
Torsten Roehr
Test script:
---------------
SELECT * FROM synonym_material
LEFT JOIN pharmacopoeia_mat_join_synonym AS pm_j_sm_1
ON pm_j_sm_1.synonym_material_id=synonym_material.synonym_material_id
WHERE pm_j_sm_1.pharmacopoeia_material_id = 1
Line 2964:
$fullJoinAs = "AS {$joinAs}";
Expected result:
----------------
$fullJoinAs = $joinAs;
Actual result:
--------------
$fullJoinAs = "AS {$joinAs}";
[2005-09-16 08:40 UTC] roehr at zilleon dot com
Yes, this causes an error, too:
select * from location as location2
ORA-00933: SQL command not properly ended
"as" only seems to work for column aliases but not for table aliases with Oracle 9 - as far as I can tell.
Thanks for replying so quickly, Alan.