Skip to content

G-2510: Avoid using the LONG and LONG RAW data types.

Major

Portability

Reason

long and long raw data types have been deprecated by the Oracle Database since version 8i - support might be discontinued in future Oracle Database releases.

There are many constraints to long datatypes in comparison to the lob types.

Example (bad)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
create or replace package example_package is
   g_long long;
   g_raw long raw;

   procedure do_something;
end example_package;
/

create or replace package body example_package is
   procedure do_something is
   begin
      null;
   end do_something;
end example_package;
/

Example (good)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
create or replace package example_package is
   procedure do_something;
end example_package;
/

create or replace package body example_package is
   g_long clob;
   g_raw  blob;

   procedure do_something is
   begin
      null;
   end do_something;
end example_package;
/