mardi 1 décembre 2015

Trigger to add a row to a table when it is created

I have an sqlite table to store all the topics that exist in my forum. My idea would be, since I have a global topic, to insert a row as I create the table that has the information on the global topic.

Such as:

CREATE TABLE ForumTopic(
   ID INT PRIMARY KEY     NOT NULL,
   NAME           TEXT    NOT NULL,
   CONTENT        CHAR(250),
);

Create trigger "WHEN I CREATE TABLE ForumTopic":
     "automatically add a row that creates the general topic".

Thank you for your help.

Aucun commentaire:

Enregistrer un commentaire