I created a function in PowerBuilder.NET Hello World. The project compiled as Helloworld.dll, generated in C# from the PowerBuilder utility. Inside Helloworld, I made the non-visual n_cst_helloworld. Inside the non-visual, I made the object function of_hello(). These are the issues I encountered when trying to access Helloworld.n_cst_helloworld.of_hello() in an external function on SQL Anywhere.
The external function uses CLR and is called in Interactive SQL right now.
Here is the script I'm trying to launch in iSQL (through ASA):
ALTER PROCEDURE "DBA"."ext_helloworld"()
EXTERNAL NAME
'helloworld.dll::Helloworld.n_cst_helloworld.of_hello( )'
LANGUAGE CLR
Then, I use the following in iSQL:
START EXTERNAL ENVIRONMENT CLR;
CALL ext_helloworld();
Which then gives me the following error:
Could not execute statement. Procedure 'ext_helloworld' terminated with unhandled exception 'Method 'Helloworld.n_cst_helloworld.of_hello' not found.'
SQLCODE = -91
So, I know that I have the object in the correct folder, and registered through REGASM and all that, otherwise it would give me the error of "object not found" that I'd seen before.
I'm confused because it seems that SQL Anywhere knows that the object n_cst_helloworld exists, but it doesn't recognize the methods that were generated using the PowerBuilder.NET utility. I don't know how to proceed to be able to use this method through ASA.
Currently I'm using ASA 12, PB12, PB.NET and have both 3.5 and 4.0 installed.
How .NET Deployment Works
When you deploy a .NET project, PowerBuilder compiles existing or newly developed PowerScript® code into .NET assemblies.
At runtime, the generated .NET assemblies execute using the .NET Common Language Runtime (CLR). PowerBuilder’s .NET compiler technology is as transparent as the P-code compiler in standard PowerBuilder client-server applications.
Deploying PowerBuilder runtime files
The simplest way to deploy PowerBuilder runtime DLLs and .NET assemblies to production servers or target computers is to use the PowerBuilder Runtime Packager tool. The Runtime Packager creates an MSI file that installs the files you select, registers any self-registering DLLs, and installs the .NET assemblies into the global assembly cache (GAC).
See full document PB.NET runtimes HERE on Sybase Infocenter
Checklist for Deployment
Verify that production servers and target computers meet all requirements for running the .NET targets that you deploy from PowerBuilder Classic.
Checklist for all .NET targets
For deployment of all .NET target types (Windows Forms, Web Forms, .NET Assembly, .NET Web Service), production servers or target computers must have:
- The Windows XP SP2, Windows Vista, Windows 2008, or Windows 7 operating system
.NET Framework 4.0
- The Microsoft Visual C++ runtime libraries msvcr71.dll, msvcp71.dll, msvcp100.dll, msvcr100.dll, and the Microsoft .NET Active Template Library (ATL) module, atl71.dll
- PowerBuilder .NET assemblies in the global assembly cache (GAC)
- PowerBuilder runtime dynamic link libraries in the system path
- See Deploying PowerBuilder runtime files.
See full set of deployment checklist documents HERE on Sybase Infocenter