Welcome to the course blog for CS485.
I need that. I've been struggling with that for a while
<3 MySQL :)
Here's a useful link:http://www.firebirdsql.org/manual/generatorguide-sqlsyntax.htmlHere's another one:http://www.firebirdsql.org/manual/generatorguide-basics.html
Link to the auto-incrementinghttp://firebirdsql.org/dotnetfirebird/blog/2005/01/migration-from-mysql-i.html
Here is code that creates an auto-incrementer for a table called MENUITEM. By default the counter will start at 1.CREATE SEQUENCE create_item_id;SET TERM !;CREATE TRIGGER set_item_id FOR MENUITEMACTIVE BEFORE INSERT POSITION 0ASBEGIN new.ID = gen_id(create_item_id, 1);END!SET TERM;!
Post a Comment
5 comments:
I need that. I've been struggling with that for a while
<3 MySQL :)
Here's a useful link:
http://www.firebirdsql.org/manual/generatorguide-sqlsyntax.html
Here's another one:
http://www.firebirdsql.org/manual/generatorguide-basics.html
Link to the auto-incrementing
http://firebirdsql.org/dotnetfirebird/blog/2005/01/migration-from-mysql-i.html
Here is code that creates an auto-incrementer for a table called MENUITEM. By default the counter will start at 1.
CREATE SEQUENCE create_item_id;
SET TERM !;
CREATE TRIGGER set_item_id FOR MENUITEM
ACTIVE BEFORE INSERT POSITION 0
AS
BEGIN
new.ID = gen_id(create_item_id, 1);
END!
SET TERM;!
Post a Comment