Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 608225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:26:25+00:00 2026-05-13T17:26:25+00:00

What do others do to simplify the creation of simple, serial surrogate keys populated

  • 0

What do others do to simplify the creation of simple, serial surrogate keys populated by a SEQUENCE (a.k.a. GENERATOR) in Firebird >= 2.1? I finc the process comparatively arduous:

For example, in PostgreSQL, I simply type:

pg> CREATE TABLE tbl (
  >   id SERIAL NOT NULL PRIMARY KEY,
  > ...

In MySQL, I simply type:

my> CREATE TABLE tbl (
  >   id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
  > ...

But in Firebird I type:

fb> CREATE TABLE tbl (
  >   id BIGINT NOT NULL PRIMARY KEY,
  > ...

fb> CREATE SEQUENCE tbl_id_seq;

fb> SET TERM !!;
  > CREATE TRIGGER tbl_id_trg FOR tbl
  > ACTIVE BEFORE INSERT POSITION 0
  > AS
  > BEGIN
  >   IF ((new.id IS NULL) OR (new.id <= 0)) THEN
  >   BEGIN
  >     new.id = GEN_ID(tbl_id_seq, 1);
  >   END
  > END !!
  > SET TERM ; !!

… and I get pretty bored by the time I reach trigger definition. However, I routinely make SEQUENCE-backed ID fields for temporary, development and throw-away tables. What do others do to simplify this? Work with an IDE? Run a pre-processing, in-house perl script over the DDL file? Etc.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T17:26:25+00:00Added an answer on May 13, 2026 at 5:26 pm

    Use IBExpert and you can make it in 4 clicks

    I think SEQUENCE is in the SQL Standard.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm curious how others have solved this problem, and what problems might lurk behind
Looking to see what others do with 3rd party (vendor) java documents? Do they
Unlike some others, my Android SDK setup went smoothly on my new Windows 7
I am curious how others would handle this situation. I have a domain layer
As suggested by (among others) Kazi Manzur Rashid in this blog post , I
As noted by others , in Java, with the default W3C DOM libraries, one
On all others versions of platform I use this: BrowserFieldConfig cfg = new BrowserFieldConfig();
I'm curious how others do it, or if there's an easier way... I'm having
I was wondering what approaches others might have for testing domain services against a
I know about Allow Triggers to Fire Others server setting that allows the action

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.