Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"default clause" and "column constraint " in a column definition statement [CORE3300] #3667

Closed
firebird-automations opened this issue Jan 4, 2011 · 4 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Derryck welas (welas)

"SQL:standaard " says i can use "default clause" and/or "column constraint " in a column definition.
dont know if this worked before but i'm using FB 2.5.0 at the moment.

example:
CREATE TABLE test (
id BIGINT NOT NULL ,
description VARCHAR(100) NOT NULL DEFAULT 'test',
PRIMARY KEY (id)
);

Error: *** IBPP::SQLException ***
Context: Statement::Prepare( CREATE TABLE test (
id BIGINT NOT NULL ,
description VARCHAR(100) NOT NULL DEFAULT 'test',
PRIMARY KEY (id)
) )
Message: isc_dsql_prepare failed

SQL Message : -104
Invalid token

Engine Code : 335544569
Engine Message :
Dynamic SQL Error
SQL error code = -104
Token unknown - line 3, column 37
DEFAULT

=======
2003 sql ref:
<column definition> ::=
<column name> [ <data type> | <domain name> ] [ <reference scope check> ]
[ <default clause> | <identity column specification> | <generation clause> ]
[ <column constraint definition> ... ] [ <collate clause> ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

In Firebird, The DEFAULT clause must precede the column constraint. And as far as I see, your quote from the SQL standard confirms that.

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Won't Fix [ 2 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: Derryck welas (welas)

I see your point , thanks !

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant