Consultor Eletrônico



Kbase P14982: Example in page 5-25 of the SQL-92 Guide and Reference cannot compile in Progress 9.1x
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   30/07/2008
Status: Verified

SYMPTOM(s):

Example in page 5-25 of the SQL-92 Guide and Reference cannot compile

Receiving compile error creating get_sal2 Stored Procedure Example

=== SQL Exception 1 ===
SQLState=HY000
ErrorCode=-20141
[JDBC Progress Driver]:error in compiling the stored procedure

FACT(s) (Environment):

Progress 9.1D
Progress 9.1C
Progress 9.1B
All Supported Operating Systems

CAUSE:

This line of code is missing in the example.
IMPORT
import java.math.*;

FIX:

The corrected version of the example in the Documentation is the following :

CREATE PROCEDURE get_sal2 ()
IMPORT
import java.math.BigDecimal;
BEGIN
StringBuffer ename = new StringBuffer (20) ;
BigDecimal esal = new BigDecimal (2) ;
SQLCursor empcursor = new SQLCursor ( "SELECT Name, Cust-Num FROM pub.Customer" ) ;
empcursor.open () ;
do
{
empcursor.fetch ();
if (empcursor.found ())
{
ename = (StringBuffer) empcursor.getValue (1, CHAR);
esal = (BigDecimal) empcursor.getValue (2, NUMERIC);
}
} while (empcursor.found ()) ;
empcursor.close () ;
END