CREATE TABLE "ODDO_Securities"
(
"C_ID" NUMBER NOT NULL,
"SYSTEM_ID" NUMBER NOT NULL,
"SUBBRANCH_CODE" NUMBER NOT NULL,
"OPER_ID" NUMBER,
"CC_CODE" NUMBER NOT NULL,
"PRICE" DOUBLE,
"NOMINAL" NUMBER NOT NULL,
"ID_TYPE" NUMBER,
"EMITENT_CODE" NUMBER(9),
"PACK_CODE" NUMBER(9),
"BRAND" VARCHAR2,
"LIGATURA_MASS" NUMBER,
"CHEMICAL_MASS" NUMBER,
"HALLMARK" VARCHAR2,
"SPEC_NUMBER" VARCHAR2,
"MANUFACTURER_YEAR" VARCHAR2,
"COUNT" NUMBER NOT NULL,
"NUMBER_FROM" NUMBER NOT NULL,
CONSTRAINT "PK_Security" PRIMARY KEY ("C_ID")
)
/
I got java.sql.SQLException: ORA-00905: missing keyword .
What am I missing?
Ant task call is as following:
<sql driver="${db.jdbc.driver}"
url="${db.jdbc.url}"
userid="${db.project.user}"
password="${db.project.password}"
classpathref="oracle.jdbc.path"
delimiter="/"
src="${scriptHome}/createSchemaObjects.sql"
onerror="abort"/>
> ORA-00905
That's an Oracle error, so RTFM for Oracle SQL syntax.
--
martin@ | Martin Gregorie
gregorie. | Essex, UK
org |
Martin Gregorie wrote:
> That's an Oracle error, so RTFM for Oracle SQL syntax.
<http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_7002.htm#i2095331>
<http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/img_text/create_table.htm>
I'm not seeing the error.
--
Lew
It may not be an error, but in Oracle environment, it is usual to define the
table space when creating tables. Other more or less important options too.
Load this into sqlplus and try to execute it.
Then you'll know that DOUBLE is missing a keyword.
Using google or the manuals you can find out that the datatype synonym
is called DOUBLE PRECISION if you want to use this synonym.
Guys, I digged out where the problem is =)
I have to write explicitly the size of VARCHAR2 fields. Example:
"BRAND" VARCHAR2
throws ORA-00905: missing keyword
"BRAND" VARCHAR2(255)
is OK!
Ivan Ryndin,
Java Dev Notes blog: http://jdevnotes.blogspot.com
Always a useful exercise.
Lew wrote:
> I'm not seeing the error.
I had to hunt it down. I've loved railroad-track diagrams since
the days of Jensen & Wirth [1], so I can't resist elaborating.
As the OP determined, the compiler didn't like a VARCHAR2 of
indeterminate size [2]. The corresponding diagram has no path without
it. In contrast, precision and scale for NUMBER are optional, as the
paths show.
Frank Langelage wrote:
> Load this into sqlplus and try to execute it. Then you'll know that
> DOUBLE is missing a keyword. Using google or the manuals you can find
> out that the datatype synonym is called DOUBLE PRECISION if you want
> to use this synonym.
I'm confused. I see BINARY_DOUBLE, which has no qualification, but no
DOUBLE PRECISION. Is DOUBLE perhaps a synonym for BINARY_DOUBLE?
[1]<http://www.inf.ethz.ch/personal/wirth/books/Pascal/>
[2]<http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/sql_elements001.htm>
--
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>
Using [2] and scrolling down to ANSI_supported_datatypes you find DOUBLE
PRECISION.
Using
http://www.google.de/search?hl=de&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&hs=mhW&q=oracle+datatypes+double&btnG=Suche&meta=
you find a lot of other results, e.g.
http://www.psoug.org/reference/datatypes.html.
Changing DOUBLE to DOUBLE PRECISION solved the ORA-00905 error, using an
11g EE on Solaris.
The next error you get is ORA-00906 because of the missing length
definition of varchar2 fields.
So the solution posted by the OP is not completely correct.
> >> Load this into sqlplus and try to execute it. Then you'll know that
> >> DOUBLE is missing a keyword. Using google or the manuals you can find
> >> out that the datatype synonym is called DOUBLE PRECISION if you want
> >> to use this synonym.
> >
> > I'm confused. I see BINARY_DOUBLE, which has no qualification, but no
> > DOUBLE PRECISION. Is DOUBLE perhaps a synonym for BINARY_DOUBLE?
> >
> > [1]<http://www.inf.ethz.ch/personal/wirth/books/Pascal/>
> > [2]<http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/sql_elements001.htm>
>
> Using [2] and scrolling down to ANSI_supported_datatypes you find
> DOUBLE PRECISION.
D'oh, I see it now. Thanks. Sadly, it's not the first time I've
forgotten that the browser's find command can't see pictures!
> http://www.psoug.org/reference/datatypes.html.
Very handy.
> Changing DOUBLE to DOUBLE PRECISION solved the ORA-00905 error, using
> an 11g EE on Solaris.
Ah, the PRECISION part of DOUBLE PRECISION is required.
> The next error you get is ORA-00906 because of the missing length
> definition of varchar2 fields.
>
> So the solution posted by the OP is not completely correct.
ORA-00906: missing left parenthesis; your explanation makes sense.
Amen.
I wish I had a converter to railroad-track diagrams from nasty things
like DTD XSD WSDL :-(
http://www.json.org/ ... <stimpy>Joy!</stimpy>
--
RGB
Cool. I found this on-line generator:
<http://www-cgi.uni-regensburg.de/~brf09510/syntax.html>
And this discussion of the diagrams on the JSON site:
<http://stackoverflow.com/questions/796824/tool-for-generating-railroad-diagram-used-on-json-org>
And this guide to reading the diagrams:
<http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=/db2/rbafzmsthowtous.htm>