![]() |
![]() |
![]()
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] |
|
|
![]() |
![]() ![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 8 Pomógł: 0 Dołączył: 21.10.2004 Ostrzeżenie: (0%) ![]() ![]() |
a po co ten select (IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif)
nie lepiej Kod :new:=licznik.nextval;
|
|
|
![]() ![]() |
![]() |
Aktualny czas: 9.10.2025 - 11:54 |