Updated on 2024-05-14 GMT+08:00

Basic PL/SQL Syntax

Table 1 PL/SQL operators

No.

Oracle

GaussDB

1

+

Supported.

2

:=

Supported.

3

=>

Supported.

4

%

Supported.

5

'

Supported.

6

.

Supported.

7

||

Supported.

8

/

Supported.

9

**

Not supported.

10

(

Supported.

11

)

Supported.

12

:

Supported.

13

,

Supported.

14

<<

Supported.

15

>>

Supported.

16

/*

Supported.

17

*/

Supported.

18

*

Supported.

19

"

Supported.

20

..

Supported.

21

=

Supported.

22

<>

Supported.

23

!=

Supported.

24

~=

Supported.

25

^=

Supported.

26

<

Supported.

27

>

Supported.

28

<=

Supported.

29

>=

Supported.

30

@

Supported.

31

--

Supported.

32

;

Supported.

33

-

Supported.

Table 2 Logical operators

No.

Oracle

GaussDB

1

NOT

Supported.

2

AND

Supported.

3

OR

Supported.

Table 3 Comparison expressions

No.

Oracle

GaussDB

1

IS [NOT] NULL

Supported.

2

LIKE

Supported.

3

BETWEEN

Supported.

4

IN

Supported.

Table 4 CASE expressions

No.

Oracle

GaussDB

1

simple CASE

Supported.

2

searched CASE

Supported.

Table 5 Parameters related to variable declaration

No.

Oracle

GaussDB

Difference

1

%TYPE

Supported, with differences.

  • GaussDB does not support record%type.
  • GaussDB does not support pkg.record%type and schema.pkg.record%type as the input and output parameter types.
  • In GaussDB, Table/View.column.column%type or schema.Table/View.column.column%type cannot be nested with one or more layers as variable types or input/output parameter type.
  • In GaussDB, record.column.column%type and pkg.record.column.column%TYPE cannot be nested with a column type of records at one or more layers as the variable type or input/output parameter type.

2

%ROWTYPE

Supported, with differences.

  • When GaussDB has multiple CNs, the %ROWTYPE and %TYPE attributes of the temporary table cannot be declared in a stored procedure. The temporary table is valid only in the current session. During compilation, other CNs cannot view the temporary table of the current CN. Therefore, if there are multiple CNs, the system displays a message indicating that the temporary table does not exist.
  • GaussDB does not support view%rowtype and schema.view%rowtype as the input and output parameter types.
  • GaussDB does not support the package.cursor%rowtype as the input and output parameter types.