MIDRANGE dot COM Mailing List Archive



Home » MIDRANGE-L » June 2008

Re: SQL: NOT NULL DEFAULT



fixed

Wilt, Charles wrote:
<<SNIP>>
/* Create table. v6r1 */
CREATE TABLE to-file LIKE from-file
RCDFMT rcdfmt-name ;

ALTER TABLE to-file ADD COLUMN H3_CREATED_BY FOR COLUMN H3CRTUSER VARCHAR(18) NOT NULL IMPLICITLY HIDDEN DEFAULT USER;

ALTER TABLE to-file ADD COLUMN H3_CREATED_TIMESTAMP FOR COLUMN H3CRTTIMST TIMESTAMP NOT NULL IMPLICITLY HIDDEN DEFAULT CURRENT_TIMESTAMP;

<<SNIP>>

I assume there is no requirement to add the two fields separately; i.e. that there is no restriction with IMPLICITLY HIDDEN on ADD COLUMN?

If not, then FWiW, like for any ALTER, the best approach is to combine the maximum amount of alter activity into one request. Two ALTER requests is a very poor choice when data exists, since the data will be copied for each request. Of course the example was with an empty table, so there is no data movement to be concerned with.

Regards, Chuck





Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2014 by MIDRANGE dot COM and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available here. If you have questions about this, please contact