The fastest easiest way to get it right.

Default and Blank

The most basic kind of automation is supplying a default value for a column. Andromeda supports two types of defaults, a literal default and a blank, or not-null default.

The BLANK Automation

Sometimes you want to make sure that a value does not start out null. For these columns, use the blank automation:

table example:
    # ...details....
    
    column add1:
        automation_id: blank
    column amt:
        automation_id: blank
    column date:
        automation_id: blank

The BLANK automation will provide a type-specific blank value for this column if the user does not supply a value in an INSERT. For all character types this is an empty string. For numerics this is the number zero. For dates there is no concept of a blank value, so this actually stays at null.

The DEFAULT Automation

It is very common to want a column to start out with a literal value. Use the DEFAULT automation for this:

column credi_rating:
    description: Internal Credit Rating
    type_id: numb
    colprec: 4
    colscale: 0
    
table example:
    # ...details....
    
    column flag_active:
        suffix: _active
        automation_id: default
        auto_formula: N
    column credit_rating:
        automation_id: default
        auto_formula: 400
        
    # ALTERNATIVE MINIMUM SYNTAX
    # Most automations can be written this way:
    column flag_active:
        suffix: _active
        auto: default,N
    column credit_rating:
        auto: default,400

User Comments

There are no user comments yet on this page.


Add A Comment

Comments will not appear until after they are moderated. Comments are usually moderated within a few hours on weekdays, but may take longer on weekends and holidays.

Name or nickname: (This will appear with your comment)


Email (this will never be displayed)


Enter your comment here. Use [b] and [/b] for bold, [i] and [/i] for italic, and [pre] and [/pre] for code samples. All literal HTML and PHP that you enter will be escaped out and displayed as you enter it.


Home |  Documentation |  Download |  Credits |  Contact |  Login
Andromeda © Copyright 2004-2010, Licensed under the GPL Version 2