How to use joins on Pro*C 10g?
-
16-09-2020 - |
Вопрос
While using inner join on Pro*C I am getting the below error:
PCC-S-02201, Encountered the symbol "inner" when expecting one of the following:
I've just used a simple inner join. When I searched for solution, I was told that 10g doesn't support these kind of syntax and I should use dynamic SQL instead. Is that true? How to achieve inner join using dynamic SQL?
Решение
ProC 10g version doesn't allow inner/outer joins. If you want to have these, you will have to upgrade your ProC compiler.
If you use, 11g you can use the solution suggested here: http://forums.oracle.com/forums/thread.jspa?threadID=665519
Другие советы
Use the old syntax.
Instead of: SELECT * FROM TABLE1 INNER JOIN TABLE2 ON TABLE1.PK = TABLE2.FK
Use this: SELECT * FROM TABLE1, TABLE2 WHERE TABLE1.PK = TABLE2.FK
For OUTER JOINS just use the (+) sign on the side you want to be nullable:
Instead of: SELECT * FROM TABLE1 LEFT JOIN TABLE2 ON TABLE1.PK = TABLE2.FK
Use this: SELECT * FROM TABLE1, TABLE2 WHERE TABLE1.PK = TABLE2.FK (+)