i'm trying to create an auto increment within table vpo_main for column
named id defined as below:

$sth = $dbh->prepare("create table vpo_main
(
       id          INTEGER PRIMARY KEY,
       refnum      VARCHAR(50),
       date_post   VARCHAR(50),
       description VARCHAR(50),
       releasea     LONG,

etc
################

$seq='CREATE SEQUENCE vpo_main_id_seq START WITH 1 ORDER';
$sth = $dbh->prepare($seq);
$sth->execute();

$trigger="CREATE TRIGGER vpo_main_auto_increment
         BEFORE INSERT ON vpo_main FOR EACH ROW
         BEGIN
              SELECT vpo_main_id_seq.NextVal INTO :NEW.id FROM DUAL;
         END;";

$dbh->do($trigger);

the sequence does not appear to be working

any suggestions on whats wrong?

regards
peewee

Reply via email to