Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Trigger
cinnek
post
Post #1





Grupa: Zarejestrowani
Postów: 48
Pomógł: 0
Dołączył: 3.12.2003

Ostrzeżenie: (0%)
-----


Witam

Tworze takiego triggera:

[sql:1:a4d5732cbe]
create or replace trigger trr_opiekunowie
before insert on opiekunowie
for each row
begin
if :new.o_id is null then
select licznik.nextval into :new.o_id from dual;
end if;
end;
/
[/sql:1:a4d5732cbe]

ten triger to cos wrodzaju autoimcrement w mySqlu
i niestety robiąc inserta ,takiego gdzie w miejscu o_id mam NULL dostaje błędy:

ORA-06502: PL/SQL: numeric or value error: number precision too large
ORA-06512: at "DIVINF_12_7.TRR_OPIEKUNOWIE", line 3
ORA-04088: error during execution of trigger 'DIVINF_12_7.TRR_OPIEKUNOWIE'


Czy może ktos wie dlaczego

aha licznik tworze tak:
[sql:1:a4d5732cbe]
create sequence licznik minvalue 0 maxvalue 9999 increment by 1 start with 5;[/sql:1:a4d5732cbe]
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 24.08.2025 - 21:38