CREATE TABLE t_topic (
topicId NUMBER(
topicTitle VARCHAR
topicContent varchar
topicAuthor VARCHAR
topicBoaId NUMBER(
topicHits NUMBER(
topicElite NUMBER(
topicTop NUMBER(
topicLock NUMBER(
topicDel NUMBER(
topicPubTime DATE NOT NULL
topicReNum NUMBER(
topicReUser VARCHAR
topicReTime DATE
topicIp VARCHAR
PRIMARY KEY (topicId)
);
Create Sequence t_topic_Id_sequence
INCREMENT BY
START WITH
NOMAXVALUE
NOCYCLE;
CREATE OR REPLACE TRIGGER t_topic_Id_trigger //觸發器
BEFORE INSERT
ON t_topic
FOR EACH ROW
DECLARE
newId NUMBER(
BEGIN
SELECT t_topic_Id_sequence
:new
END;
From:http://tw.wingwit.com/Article/program/Oracle/201311/16738.html