I have created a table using following code:
CREATE TABLE GLASACKO_MESTO(
"ID_glasackog_mesta" NUMBER(10, 0) PRIMARY KEY,
"Broj_registrovanih_biraca" NUMBER NOT NULL,
"Broj_glasackog_mesta" NUMBER NOT NULL,
"Izborna_jedinica" NUMBER NOT NULL
);
CREATE INDEX GLASACKO_MESTO_BROJ_REG_B ON GLASACKO_MESTO("Broj_registrovanih_biraca");
and also:
CREATE SEQUENCE "GLASACKO_MESTO_ID_SEQ"
MINVALUE 1
MAXVALUE 9999999999
INCREMENT BY 1
START WITH 101
CACHE 5
NOORDER
NOCYCLE;
CREATE OR REPLACE TRIGGER "GLASACKO_MESTO_AUTO_PK"
BEFORE INSERT
ON GLASACKO_MESTO
FOR EACH ROW
BEGIN
:NEW."ID_glasackog_mesta" := GLASACKO_MESTO_ID_SEQ.NEXTVAL;
END;
As i can see, it looks like everything was created successfully, but when try to execute following INSERT command, i get error.
INSERT INTO GLASACKO_MESTO(Broj_registrovanih_biraca,Broj_glasackog_mesta,Izborna_jedinica)
values ('2','3','4');
And also tried setting manualy ID
INSERT INTO GLASACKO_MESTO(ID_glasackog_mesta,Broj_registrovanih_biraca,Broj_glasackog_mesta,Izborna_jedinica)
values (1,'2','3','4');
But it didn't make any difference. How can I fix this?