4000 char size with function-drived virtual column
I have a virtual column driven by a function, this function returning a varchar2(50)
create or replace
function F_ETAT_PROC_TRANS(pCode varchar2) return varchar2
deterministic
is
val varchar2(50);
begin
begin
select valeur into val from CL_ETAT_PROC_TRANS where code=pCode ;
exception
when no_data_found then
return null;
end;
return val;
end;
/
ALTER TABLE PROCEDURE DROP COLUMN ETAT_PROC;
<...>
ALTER TABLE PROCEDURE ADD
(ETAT_PROC VARCHAR2(50) GENERATED ALWAYS AS (F_ETAT_PROC_TRANS(C_ETAT_PROC))
<...>
);
I have the following message
*
ERROR at line 2:
ORA-12899: value too large for column "ETAT_PROC" (actual: 200, maximum: 4000)
I have tried with many values for ETAT_PROC, every time the "actual value" returned in the message is 4 times the value specified for ETAT_PROC.