Subject Re: [firebird-support] Is SYSDBA cast in stone?
Author Helen Borrie
At 06:25 AM 23/04/2004 +0000, you wrote:
>Two questions, really:
>
>1. Can I create an fdb file (for FB1.5) where DB Owner is other than
>SYSDBA (if yes, is the significant characters restricted to 6).

Any user can be an owner. User names are restricted to 31 "legal" characters.

There are several ways to create databases with non-sysdba owners.
1. log into isql or your favourite admin tool as that user and create the
database interactively.
or
2. as sysdba, run a script or isql or other admin command
create database 'path-to-dbname'
user 'SomeUser' password 'xxxxxxx'

...or, from the command line, bin directory, restore a backup, as follows:

3. gbak -create /path/to/gbak/filename.fbk /path/to/new/filename.fdb -user
SomeUser -password xxxxxxx


>2. Does firebird 1.5 support triggers on columns:
>
>at the moment for table foo:
>CREATE TRIGGER FooTrigger for Foo ACTIVE BEFORE INSERT AS
>
>for column bar on table foo can I say something like:
>CREATE TRIGGER FooTrigger for bar of Foo ACTIVE BEFORE INSERT AS

Firebird doesn't insert columns: it inserts rows. Likewise, it updates
rows and deletes rows. There is no such thing as "inserting a column"
(except ADDing a new column to a table of course).

So all triggers are row level. You can have as many triggers as you like.

So if you want to customise a column value during insert, do

create trigger FooTrigger for Foo
active before insert as
begin
if (new.bar is null) then
new.bar = 'blah';
end

...just whatever you need.

Have you considered getting hold of the LangRef.pdf manual?
/hb