"Ambiguous table" message expected

bohrmann

Member
Hi,

We have a batch working for a long time, which uses one database (db1). Now we want to connect to another db (db2), in the calling .p program I properly deployed it. My problem is that the compiler doesn't indicate any problem, when in certain cases the table names are referred without the db name (both databases contain the same table names). I'm talking about a .i code. For example:

FOR EACH table1 no-lock
WHERE ...:

IF indres then nbrphy = nbrphy + 1.
ELSE DO:
if not_avai_compte = false
then do :
FIND FIRST table2
WHERE ...
no-lock no-error.
...
end.
END.
END.

In the above example the "ambiguous table" error message is displayed in case of table2 only, though table1 can be found in both databases as well. Can anyone explain why this difference (and how it will be decided in case of table1, which db will be referred to)?

Thanks,
Peter
 

RealHeavyDude

Well-Known Member
Do you have both databases connected at compile time? If so and table1 exists in both databases then I would not understand why the compiler does not complain. Do you use define buffers which sometimes use the database prefix?

Heavy Regards, RealHeavyDude.
 

bohrmann

Member
Yes, I'm connected to both db's when compiling. The are no buffers defined in the code.
But is it possible, that table1 was referred to previously with one of the db's, and next time the same db will be interpreted as default?
 

RealHeavyDude

Well-Known Member
Do you mean that the same table1 is referenced in some other place in the same procedure prefixed with the database name? If that's the case then that would explain the behavior.

Heavy Regards, RealHeavyDude.
 

RealHeavyDude

Well-Known Member
Just for the record: I am not 100% positive, but, Progress is notorious for doing such things and it is the only explanation except a bug of course.

Heavy Regards, RealHeavyDude.
 
Top