Re: DEFAULT value for a DATETIME Column
Posted in 1997
Bappy,
to set a default value in a create table statement for datetime you
must use a 'literal datetime' as the expression.
change your stetement to look like this
XX_STA_DT DATETIME YEAR TO DAY DEFAULT DATETIME(1997-01-27) YEAR TO DAY.
this should work and do what you need.
--
Joseph Cullipher |E-mail: joseph@cannonexpress.com
PO Box 364 |opinions express are those of my own and
Springdale, AR 72764 USA |don't necessarily reflect those of my company
On Thu, 23 Jan 1997, Bappy wrote:
} I am have problem running the following statement
}
}
} CREATE TABLE XX
} (
} XX_ID CHAR(30) NOT NULL,
} XX_NM CHAR(30) DEFAULT 'DEMOGRAPHICS UNAVAILABLE ',
} XX_STA_DT DATETIME YEAR TO DAY DEFAULT '1997-01-23',
} XX_MAX_PMT_AMT DECIMAL(9,0) DEFAULT -1,
} XX_INCL CHAR(1) DEFAULT 'Y'
} )
} ;
}
} It error's out and complains that '1997-01-23' is not in a valid
} format. I gave tried a several other format's i.e. '1997/01/23'. Nothing
} seem to work.
}
} I am running this from a dbaccess session and unsing Informix Online
} 7.1.
}
} Idea anyone?
}
} Thanx.
}
} Bappy
}