A PowerBuilder library (.pbl file) is a binary file containing PowerBuilder objects such as DataWindows and functions.
Although you can browse all objects in PowerBuilder, and edit the source code when you convert the application from Oracle to SQL Server, it is useful to export a libary to source code and then use a tool to automate the conversion.
For example, you can use SQLExtract tool to extract all SQL statements from PowerBuilder source code for assessment, analysis, or conversion.
A PowerBuilder library contains PowerBuilder objects that exported to the following files:
Open a workspace in PowerBuilder IDE, select a library, then select an object and right-click Export option:
Then Save dialog appears that shows the file name and file extension. For example, when exporting the application object:
You have to repeat this operation for each object in all libraries.
You can use Library Painter to speed up export a little bit. It still requires confirmation to save each object, but at least now you can select all objects within a library and click single Export.
Go to Tools → Library Painter, select a libary on disk, select all object in the library, and right-click Export:
You can also write a PowerScript program to automate export of objects from a library (.pbl file). PowerBuilder provides LibraryExport and FileWrite functions.
For example, to export the DataWindow object d_countries from pb_demo1.pbl library, and save it to d_countries.srd file, you can use the following script:
String ls_dw Integer li_FileNum // Export the DataWindow object to string ls_dw = LibraryExport("d:\demo\pb_demo1.pbl", "d_countries", ExportDataWindow!) // Save to the file li_FileNum = FileOpen("d:\export\pb_demo1\d_countries.srd", TextMode!, Write!, LockWrite!, Replace!) FileWrite(li_FileNum, ls_dw)
Additionally, you can use LibraryDirectory function to get a list of the objects in a PowerBuilder library, and then call LibraryExport for each object.
Resources to assist you with Oracle to SQL Server migration for PowerBuilder applications:
SQLines offers services to convert PowerBuilder applications from Oracle to Microsoft SQL Server. For more information, please Contact Us.