Subject Re: Inserting new record and using a unique generated number - help
Author bossman@i4free.co.nz
<<<<SNIPPED>>>>
> In InterBase, everything is done under transaction control. A
transaction provides a set of conditions that isolates one unit of
work on the database from another. Once the transaction starts,
nothing that happens on the client gets written into the database
until that unit of work gets committed.
>

So I could use a transaction on the Trigger (from memory - I'm at wok
writting this <g> there is a option to use transaction in the
declaration of the trigger) would this then solve the problem of not
seeing the value on the screen ?

<<<<SNIPPED>>>>
> > If i used the domain CUSTNUM and had no table column define as
> > custnum it'd be a "sin".
>
> A domain is just a "user-defined data type". It's a convenient way
to encapsulate all of the behaviour you want onto a specific sort of
column - constraints like NOT NULL, UNIQUE, or CHECK VALUE(),
defaults, character set, collation order...along with data type of
course. It's not a sin to create a domain and then not use it (even
if it's a waste of space! <g>)
>

See your point on that.

> >SO if i create them both (as shown in the
> > original message) how do i get the domain name CUSTNUM to
control
> > the table column ?.
>

> After the fact, you can't. You create the domain first and commit
it. Once it exists, you use it in place of the data type when you
define the column, e.g.
>
> CREATE DOMAIN CUSTNUM AS INTEGER;
>
> /* Table: CUSTOMERS, Owner: SYSDBA */
>
> CREATE TABLE CUSTOMERS
> (
> LASTNAME CHAR(30), /* CHARACTER SET ASCII, */
> FIRSTNAME CHAR(30), /* CHARACTER SET ASCII, */
> HOMEPHONE CHAR(15), /* CHARACTER SET ASCII, */
> CUSTNUM CUSTNUM,
> );


Yup I remember reading something about this in the docs i've got.

I think the biggest hurdle for me is not so much the sql
understanding the "client" side of programming. and learning to
understand the concept of Bussiness Rules.

many thanks for your help, I think i'll start and have a look at
other programs that are available to Win32 developers (like myself).

Dave Lilley

Ps your a GOD send to folk like myself who are novices/have to C/S
work.