0
CREATE TABLE "Ticket_particije" (
    ticket_id number,
    datum_kreiranja_ticketa date,
    zalba_id number,
    prodavac_id number,
    pristupni_ugovor_id number,
    constraint pk_ticketparticije primary key (ticket_id),
    constraint fk_ticketparticije_zalba foreign key (zalba_id) references "Zalba" (zalba_id),
    constraint fk_ticketparticije_prodavac foreign key (prodavac_id) references "Prodavac" (prodavac_id),
    constraint fk_ticketparticike_pugovor foreign key (pristupni_ugovor_id) references "PristupniUgovor" (pristupni_ugovor_id)
);
PARTITION BY RANGE (datum_kreiranja_ticketa)
(
PARTITION ticketi_2017_kvartal1 values
LESS THAN (TO_DATE('01-MAR-2017','dd-MON-yyyy')),
PARTITION ticketi_2017_kvartal2 values
LESS THAN (TO DATE('01-JUN-2017','dd-MON-yyyy')),
PARTITION ticketi_2017_kvartal3 values
LESS THAN (TO_DATE('01-SEP-2017','dd-MON-yyyy')),
PARTITION ticketi_2017_kvartal4 values
LESS THAN (TO_DATE('01-DEC-2017','dd-MON-yyyy'))
);

Error:

ORA-00928 missing SELECT keyword

Don't mind "unknown" words, database is on Serbian language. If you need any other information, no worries, I will post it. Thanks in advance.

juergen d
  • 201,996
  • 37
  • 293
  • 362

1 Answers1

1

To start with, remove the semi-colon before the "partition by range" clause. Then, there is a missing underscore between TO & DATE at "TO DATE('01-JUN-2017','dd-MON-yyyy'))"

Try this :

CREATE TABLE "Ticket_particije" (
    ticket_id number,
    datum_kreiranja_ticketa date,
    zalba_id number,
    prodavac_id number,
    pristupni_ugovor_id number,
    constraint pk_ticketparticije primary key (ticket_id),
    constraint fk_ticketparticije_zalba foreign key (zalba_id) references "Zalba" (zalba_id),
    constraint fk_ticketparticije_prodavac foreign key (prodavac_id) references "Prodavac" (prodavac_id),
    constraint fk_ticketparticike_pugovor foreign key (pristupni_ugovor_id) references "PristupniUgovor" (pristupni_ugovor_id)
)
PARTITION BY RANGE (datum_kreiranja_ticketa)
(
PARTITION ticketi_2017_kvartal1 values
LESS THAN(TO_DATE('01-MAR-2017','DD-MON-YYYY')),
PARTITION ticketi_2017_kvartal2 values
LESS THAN(TO_DATE('01-JUN-2017','DD-MON-YYYY')),
PARTITION ticketi_2017_kvartal3 values
LESS THAN(TO_DATE('01-SEP-2017','DD-MON-YYYY')),
PARTITION ticketi_2017_kvartal4 values
LESS THAN(TO_DATE('01-DEC-2017','DD-MON-YYYY'))
);
Darzen
  • 1,105
  • 3
  • 13
  • 29
  • Darzen, thanks for an answer. After seeing what you mentioned, my "mistakes" that caused an error were "starting ones", and since I'm starting with oracle, it's fine for me. Now I'm getting error "ORA-00439 feature not enabled: Partitioning". I understand that's because I'm using Enterprise edition :( Anyways thanks for your reply, it solved my problem. – Hesitation Dec 25 '17 at 09:51
  • 1
    @MarkoBuljandric i think you meant you're using `Standart` but NOT `Enterprise` edition. By the way, @Darzen deserves to have a vote up, doesn't he? – Barbaros Özhan Dec 25 '17 at 18:48