Consultor Eletrônico



Kbase P46728: Trying to connect to a database then use the database connec
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/7/2003
Status: Unverified

SYMPTOM(s):

Trying to connect to a database then use the database connection in the same procedure

Unknown database name <db name>. (855)

Unknown or ambiguous table <table>. (545)

CAUSE:

It is not possible to connect to a database in a procedure and then execute code against the database. When code is compiled the .r code stores within it a list of what databases must already be connected for the code to run. At runtime, the database this .r code needs to have connected before the .r code will execute is not connected because the code to connect to it is inside of the .r code itself.

FIX:

Break out the code that does the connection to the database into a separate .p then run that .p file before attempting to run the .p which manipulates that database.