Reputation: 118
I have a table structure code for PL/SQL as below(this code is just a line of code creation):
"VERSION" NUMBER(10) DEFAULT 1 1 105331 NOT NULL
the problem is with the numbers after DEFAULT. Does anybody know whether it makes sense? If it does, what does it mean? I get a ' missing right parenthesis' error when I run the whole code but when I remove this line it works. (this code has not been written by me and I do not have access to the developer who wrote it)
Upvotes: 0
Views: 473
Reputation: 167982
Does anybody know whether it makes sense?
No, it does not make sense and it is not syntactically valid code.
1
and 105331
are each numbers but combined 1 1 105331
is not a number, its is 3 numbers and that does not make sense to try to put 3 numbers into a single NUMBER
column.
As the SQL parser parses the statement it gets to:
"VERSION" NUMBER(10) DEFAULT 1
And that, so far, is valid and then it reads the next number and that is invalid syntax so Oracle complains about the invalid syntax and suggests that one thing that would be valid would be to terminate the DDL statement with a closing right-parenthesis (which is where the error message comes from).
Typically, a (semantic) version identifier is a string with 3 full-stop delimited numbers indicating major, minor and patch version numbers (and this is not something that you can express as a single decimal number) so you would have:
"VERSION" VARCHAR2(10) DEFAULT '1.1.105331' NOT NULL
Whether or not this makes sense to convert the column to this format is something that you would have to determine as the meaning of the columns is a business decision and not something that we have the domain knowledge to determine; however, your current code is syntactically invalid and we can tell you that is doesn't make sense and that it will not compile.
Upvotes: 2