Overview

Top  Next

Oracle PL/SQL as it is seen by Progress Programmer

 

       In Progress we usually define variables in the header of the program and then goes the main body. In PL/SQL there are three sections: DECLARE (optional) for declaration of variables, constants, cursors and user-defined exceptions. BEGIN for main processing. EXCEPTION (optional) to handle any exceptions that may be raised in the processing section. And the END;

 

 

Oracle

Progress

DECLARE

v_last_name VARCHAR2 (30);

BEGIN

SELECT last_name

INTO v_last_name

FROM guests;

EXCEPTION

WHEN OTHERS THEN …

END;

DEFINE VARIABLE v_last_name as CHARACTER.

 

FIND FIRST guests.

 

 

IF NOT AVAILABLE guests THEN …

ASSIGN v_last_name = guests.last_name

 

       Identifiers in Oracle should start with a character and are up to 30 characters long. They could include dollar ($), pound (#) and underscore (_). Unlike Progress identifiers could not have a dash (-).

       Like Progress PL/SQL is case-insensitive. DECLARE, declare and DeCLare are all the same. However, data is case-sensitive. So the record “Dmitri” is not the same as “dmitri”.

 

1