Custom Search : Technical Guides Sybase Oracle UNIX Javascript

Technical Guides

Of Interest

Be responsible for your future
Enter the USA legally!

Visa, Green Card, Citizenship, Passport
Consultation Services

Sybase » DDL » Coding »

Binding Rules to Colunms


Default values for colunms can be specified at the time a table is created, or
afterwards via the modify command.

/* Employee will have a default salary of 10000, and a hire date of today */

create table employee (
emp_id integer not null,
salary money default 0,
hire_dt datetime default getdate()

/* alter the table, so salary starts at 49000 */

ALTER TABLE employee REPLACE salary DEFAULT 49000

/* create a new default; bind the column to your custom default */

create default def_highsal as 55000
sp_bindefault def_highsal,'employee.salary'

-- creating your own custom defaults has a significant advantage:
-- you can actually choose the name of the default.

Sybase : Related Topics

Sybase Web Site
Sybase iAnywhere Mobile Web Site
Oracle Enterprise Web Site

Get the latest Rocket99 news and tech tips via

Site Index About this Guide to Sybase, Oracle, and UNIX Contact Us Advertise on this site

Copyright © 2019 Stoltenbar Inc All Rights Reserved.