white devles is trying kill me

Posted by durkadurka005 on 19-Feb-2012 15:42

faq u white devles!

All Replies

Posted by Thomas Mercer-Hursh on 19-Feb-2012 16:20

Triggers?

Posted by gus on 20-Feb-2012 09:15

Use a sequence in the following manner:

INSERT INTO pub.customer VALUES (

    customer_sequence.NEXTVAL,

    ’USA’,

    ’BackCountry Equipment’,

    ’Sugar Hill Road’,

    ’12A’,

    ’Franconia’,

    ’NH’,

    ’03242’,

    ’Dan Egan’,

    ’603-762-2121’,

    ’Kirsten Ulmner’,

    10000.00,

    500.00,

    ’net 10’,

    0,

    ’contact monthly’

);

Posted by Thomas Mercer-Hursh on 20-Feb-2012 13:03

The functionality you want is a function of the database, not the language used to access it.   I associate this kind of autogenerated sequential id with toy databases like Access.  I've never missed it in millions of lines of ABL.

Posted by Thomas Mercer-Hursh on 20-Feb-2012 15:27

The problem with putting stuff like this in the database or triggers is that one then has the logic in two or more places.  Put it all into the application in a data access layer and you can go one place to see relationships, constraints, sources, etc.

Posted by Thomas Mercer-Hursh on 20-Feb-2012 19:01

My point is that when you look at the data access code, you can't see the autonumber.  It just happens.  I'd rather have it all in one place.

Come to PUG Challenge Americas and I will be presenting on a data access layer for ABL.

Posted by Thomas Mercer-Hursh on 21-Feb-2012 11:25

My point is that nowhere there do you see ID being assigned a value.  Only from a comment or looking in the dictionary are you going to know how it gets a value and what kind of value it is.

This thread is closed