pdbname, ldbname, and alias

From our experience and looking at some of the sample code, it appears to me that Proparse is going to do everything in terms of the ldbname and the pdbname has no significance.

What is not clear to me is what role alias has here. I see the code to define aliases and I am using a modified version of that, but my experience is that aliases are used mostly for things like pointing to multiple DBs as DICTDB.

Does this mean that one should define an alias of DICTDB to the ldbname
which will be DICTDB? Is there a reason to define other aliases?


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
john's picture

Re: pdbname, ldbname, and alias

Some applications make use of database aliases in the source code, for whatever reasons. The database aliases must be defined before that code will compile properly. The same is true for parsing the code - Proparse needs to know about those aliases to parse the code correctly. (I.e. In the code, table names are prefixed with db alias name instead of ldbname.) As far as Proparse is concerned, that's the only role a database alias has.
Except DICTDB of course. The "config dump" routines that come with Proparse list the meta-schema under DICTDB, just in case the source code references the meta schema.


tamhas's picture

Yeah, in my code I am

Yeah, in my code I am treating DICTDB as if it were a separate database. Currently, I am building both the ABL2DB files for the schema and proparse.schema from the .df files. DICTDB is separate because it could be different DBs depending on what has happened. This means that I only need to define metaschema which is actually used.

My understanding is that one can actually define more than one alias for the same DB. Does Proparse handle that?


Cringer's picture

From my new-found

From my new-found understanding of aliases, in order to effectively use aliases you should always qualify your tables with the alias name so that the compiler knows which Alias to use. If it doesn't have the qualification it will use whichever buffer it has available first - which will be a direct database connection, and not the Alias one. As a result proparse should technically handle multiple aliases fine because the tables would need to be qualified properly. If that makes sense.