OK, here's another "humble" suggestion that folks might want to consider
for a future version: Support an "upgrade <object>" syntactically
parallel to "create <object>". The "upgrade" version, however, takes
the existing object, compares it to the described object, and makes any
changes necessary. If they are the same, nothing happens.
I did this in the original Netfrastructure implementation. It was close
to magical. The development GUI would generate SQL upgrade syntax in a
command window when the table was double clicked. All you had to do was
tweak the table definition and execute the statement. Very, very cool.
And it meant that I never had to really learn the dreadful SQL "alter
<object>" syntax. Ugh.
On 9/1/2013 7:43 AM, Robbert-Jan wrote:
Hi,
I like your opinion on the following sql improvement before I submit a
JIRA request:
For domains it is possible to alter multiple changes in one statement.
For example:
CREATE DOMAIN MyDomain INTEGER DEFAULT 0 NOT NULL
ALTER DOMAIN MyDomain TO MyDomain2 TYPE BIGINT SET DEFAULT 1 NULL /*
changes both name, type, default value and nullability */
For columns it is not possible to specify more than one change in the
ALTER COLUMN clause.
For example, this is *not* allowed:
ALTER TABLE MyTable ADD MyColumn INTEGER DEFAULT 0 NOT NULL
ALTER TABLE MyTable ALTER COLUMN MyColumn TO MyColumn2 TYPE BIGINT SET
DEFAULT 1 NULL
In stead, you have to use:
ALTER TABLE MyTable ALTER COLUMN MyColumn To MyColumn2, ALTER COLUMN
MyColumn2 TYPE BIGINT, ALTER COLUMN MyColumn2 SET DEFAULT 1, ALTER
COLUMN MyColumn2 NULL
or use separate statements (following pure SQL standard).
I like to propose to allow multiple changes in one ALTER COLUMN
clause. This is more consistent with the ALTER DOMAIN syntax and more
compact (readable).
What do you think?
Kind regards,
Robert
NL
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel