Wednesday, August 05, 2009

ORA-04044: procedure, function, package, or type is not allowed here

Always check out the original article at http://www.oraclequirks.com for latest comments, fixes and updates.

This exception occurs when you specify a custom function (or packaged function as shown below) as default value for a table column.
create table test4044 (
code varchar2(10) default dbms_random.string('x',10));

Error at Command Line:2 Column:26
Error report:
SQL Error: ORA-04044: procedure, function, package, or type is not allowed here
The workaround is to create a BEFORE INSERT trigger:
create or replace
TRIGGER BI_test4044
before insert on test4044
for each row
begin
:new.code := dbms_random.string('x',10));
end;

See message translations for ORA-04044 and search additional resources.

No comments:

yes you can!

Two great ways to help us out with a minimal effort. Click on the Google Plus +1 button above or...
We appreciate your support!

latest articles