» tagged pages
» logout
Firebird
Return to .NET Firebird

Firebird Generators: Everything you wanted to know

Tags Applied to this Entry

1 person has tagged this page:

This is a very nice article about Firebird generators: Firebird Generator Guide

Show what a Generator is in Firebird and how and why to use it. This is the attempt to collect all relevant information about Generators in a single document - hope it works, too... Who should read it?

Read this article if you:

  • are not familiar with the concept of Generators
  • have questions on using them
  • want to make an Integer column behave like an "AutoInc" field as found in other RDBMSs
  • are looking for examples on how to use Generators for IDs or other tasks
  • want to know the Firebird word for a "sequence" in Oracle ;-)

Table of contents:

Chapter 1: Generator basics

  1. What is a Generator?
  2. Where are Generators stored?
  3. What is the maximum value of a Generator?
  4. How many Generators are available in one database?
  5. Generators and Transactions
  6. SQL Syntax overview for Generators

Chapter 2: Using Generators (in general)

  1. How to create a Generator ("Insert")
  2. How to get the current value
  3. How to generate a new value
  4. How to set a Generator to a certain value
  5. How to drop a Generator

Chapter 3: Using Generators to create unique row IDs

  1. Why row IDs at all?
  2. One for all or one for each?
  3. Can you re-use Generator values?
  4. Generators for IDs or AutoInc fields
  5. Why you should get an ID Generator value *before* you insert a new record
  6. Why it is difficult to maintain a "pure" sequence (without gaps)

Chapter 4: Using Generators with IBObjects

  1. How to manually get a generator value and/or change it
  2. How to let IBO do the ID work for you

Chapter 5: What else to do with Generators ( and why most of it won't work ;-)

  1. Request for more ideas
  2. Generators for numbering "solitaire" processes, i.e. naming output files
  3. Generators as "usage counters" for Triggers / SPs to provide basic statistics
  4. Generators to simulate "Select count(*) from..."
  5. Generators to monitor / control long-running StoredProcs

Glossary

Search Firebird Questions .NET:
Sequence
Generator

Username:
Password:
(or Cancel)