Consultor Eletrônico



Kbase 20578: How to identify compilation errors when running a stored procedure in SQL Explorer?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   28/10/2008
Status: Verified

GOAL:

How to identify compilation errors when running a stored procedure in SQL Explorer?

GOAL:

How to find out what piece of code is causing compilation errors when creating a Stored Procedure or JAVA Trigger in SQL-92?

GOAL:

How to avoid the error: "error in compiling the stored procedure" during the creation of a Stored Procedure in SQL-92?

FACT(s) (Environment):

Progress 9.x
OpenEdge 10.x

FIX:

When a SQL-92 Stored Procedure or Trigger is added and/or modified, it is written temporarily to a text file with the name <owner-name>_<procedure-name>_SP.java. e.g.: MYUSER_MYTEST_SP.java

This is then compiled with the JAVA compiler. If the compilation is successful, the bytecode is then read into the schema of the Database and the .java and .class files are removed from the hard disk.

If the .java file does not compile successfully, it is left in the client working directory and one can then compile the program using a JAVA compiler (javac) in order to see what the actual compilation errors are.

To be able to compile the .java file manually, one will need to add %DLC%\java\prosp.jar (for Progress 9.1D or higher) or %DLC%\java\progress.zip (for Progress 9.1C or before) in the CLASSPATH environment variable.

Next, the stored procedure code will have to be altered using a SQL-92 client editor such as SQL Explorer. It is possibly better to fully write and debug the code manually using the JAVA compiler and the .java file. Then, once it is correct, cut and paste it into the SQL-92 client in order to create the necessary trigger.

If the .java file is compiled properly via the JAVA compiler, that means that no compilation errors were found in the program. Then, check out Primus Solution 20575, "Error in Compiling the Stored Procedure" for further investigation.