Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: SQL-Select problem

Re: SQL-Select problem

From: Arjan van Bentem <avbentem_at_DONT-YOU-DAREdds.nl>
Date: Sun, 28 Mar 1999 22:27:44 +0200
Message-ID: <7dm3c1$23g$1@weber.a2000.nl>


vpanzer wrote
> I migrated an Access-DB-Table with an AutoValue ID-Field

Oracle does not support auto increment fields -- if that is what you used in Access. You need to create a sequence and write a trigger to get the field filled automatically:

    create sequence t_table_id_seq;

    create or replace trigger bi_t_table

        before insert on t_table
        for each row
    begin
        if :new.persid is null then
            select t_table_id_seq.nextval
            into :new.persid
            from dual;
        end if;

    end bi_t_table;
    /
    show errors

Arjan. Received on Sun Mar 28 1999 - 14:27:44 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US