Symptom
When generating DataWindow objects using SyntaxFromSQL, the generated column names appear as table_name_column_name in some environments, but only as column_name in others. This inconsistency causes runtime errors (column name does not exist) after migrating or upgrading an application.
Environment
All PowerBuilder versions
Cause
The column naming format generated by SyntaxFromSQL depends on the presence or absence of PowerBuilder Catalog tables (the five PB system catalog tables) in the database schema:
- PB Catalog tables exist: SyntaxFromSQL generates column names in the format table_name_column_name.
- PB Catalog tables DO NOT exist: SyntaxFromSQL generates column names in the format column_name.
Resolution
For Oracle Interface Environment
Set PBNoCatalog='YES' in the database parameter configuration:
SQLCA.DBParm = "PBNoCatalog='YES' "
For ODBC Interface Environment
- Open the pbodb.ini file.
- Add or modify PBNoCatalog=YES under the [ORACLE] section (or the section corresponding to your database).
Note: If PB IDE is installed, PB IDE and application use the pbodb.ini located under %LocalAppData%\Appeon\PowerBuilder xxxx by default. If PB IDE is not installed, the pbodb.ini in the runtime directory will be used.
Alternative Workarounds
If you don’t need the PowerBuilder extended attribute system tables (PBCATCOL, PBCATEDT, etc.), please remove them from your database to avoid the issue.
Note: The PowerBuilder catalog tables store metadata such as user-defined column headers and display styles. If custom catalog settings are not used, disabling or removing catalog tables will not affect the application.
If you don’t want PowerBuilder to create these tables, please try any of the following methods:
- Set NoCatalog=1 in PB.ini.
- Open database painter and go to Menu > Design > Options to uncheck the 'Use Extended Attributes' option. The 'Use Extended Attributes' option is checked by default.
Reference
PowerBuilder Catalog Tables User Guide