This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I am using cascade deletes in DB2 and an error is generated by the DB2 driver. I copied the SQL generated by LightSpeed and tried it against the database from DB2 Maestro. I get the same error. [IBM][CLI Driver][DB2/NT64] SQL0206N "LINEITEMS.PARENTDOCUMENTID" is not valid in the context where it is used. SQLSTATE=42703 The SQL is:
It works if the SQL is changed to:
Notice the "dbo." in front of LineItems,ParentDocumentId in the second WHERE. Can this be fixed in configuration? |
|
|
This looks like a bug - Im assuming you have specified dbo as the schema on your context or as part of the table definition but it isnt being applied correctly as part of that criteria - is it possible to send through a small repro project which triggers this for us to investigate further with?
|
|
|
I did not follow through on this as we moved cascade delete to the database. The issue has re-appeared in another context, where the user is not the owner of the schema "dbo". The generated SQL for a delete is: DELETE FROM dbo.Orders WHERE Orders.OrderId = '55505' This results in a DB2 error SQL0206N "ORDERS.ORDERID" is not valid in the context where it is used. The query works if it is: DELETE FROM dbo.Orders WHERE dbo.Orders.OrderId = '55505' Unfortunately this was discovered on production testing where the database security setup is a lot more restrictive. Basically the table names need to always be fully qualified with the schema name. Is there a setting that will activate this? |
|