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
 
Start new topic
Odpowiedzi
bartmag
post
Post #2





Grupa: Zarejestrowani
Postów: 15
Pomógł: 0
Dołączył: 1.04.2004
Skąd: Częstochowa

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


Cytat(cinnek @ 2004-05-22 14:01:05)
...

ORA-06502: PL/SQL: numeric or value error: number precision
...

maxvalue 9999

Nie mam konsoli Oracla teraz pod ręką, ale popatrz na to i pokombinuj z tą wartością 9999.
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: 3.10.2025 - 12:22