Master-Detail and aliased field names => ora-00904
Posted: Mon 02 Jul 2007 09:34
Dear Crlab-Team,
I have a problem with ODAC-Master-Detail linking and I hope you can help me.
Here's how to hit that problem:
1) Open the "MasterDetail" Demo in the ODAC win32 demos
2) Change quMaster like this:
SELECT d.DeptNo as myAliasDeptNo, D.*,RowId FROM Dept D
3) Change quDetail like this:
SELECT e.DeptNo as myAliasDeptNo, E.*,RowId
FROM Emp E
4) Select quDetail in the Objectinspector and edit its MASTERFIELDS property
5) => in the Dialog link the two "myAliasDeptNo" and save the whole thing
Now if I run the demo, I get an "ora-00904 invalid column name".
The problem is that ODAC is building a dynamic WHERE clause with the
aliased field names, which leads to an invalid sql-statement.
Of course in this demo, the alias-stuff is not needed at all, but there
are situations, where aliasing field names is essential.
Please find the modified MasterDetail-project here:
http://www.waeberd.ch/files/MasterDetaildw.zip
Any hint is very welcome, thanks a lot!
Best regards,
Daniel
I have a problem with ODAC-Master-Detail linking and I hope you can help me.
Here's how to hit that problem:
1) Open the "MasterDetail" Demo in the ODAC win32 demos
2) Change quMaster like this:
SELECT d.DeptNo as myAliasDeptNo, D.*,RowId FROM Dept D
3) Change quDetail like this:
SELECT e.DeptNo as myAliasDeptNo, E.*,RowId
FROM Emp E
4) Select quDetail in the Objectinspector and edit its MASTERFIELDS property
5) => in the Dialog link the two "myAliasDeptNo" and save the whole thing
Now if I run the demo, I get an "ora-00904 invalid column name".
The problem is that ODAC is building a dynamic WHERE clause with the
aliased field names, which leads to an invalid sql-statement.
Of course in this demo, the alias-stuff is not needed at all, but there
are situations, where aliasing field names is essential.
Please find the modified MasterDetail-project here:
http://www.waeberd.ch/files/MasterDetaildw.zip
Any hint is very welcome, thanks a lot!
Best regards,
Daniel