f



java.sql.SQLException: ORA-00905: missing keyword

while executing via Ant following statement

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"/>
0
iryndin
6/23/2009 2:48:42 PM
comp.lang.java.databases 3049 articles. 0 followers. samyaksulabh (16) is leader. Post Follow

10 Replies
2902 Views

Similar Articles

[PageSpeed] 54

On Tue, 23 Jun 2009 07:48:42 -0700, iryndin wrote:

> ORA-00905

That's an Oracle error, so RTFM for Oracle SQL syntax.


-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |
0
Martin
6/23/2009 2:54:43 PM
iryndin wrote:
> >> ORA-00905

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
0
Lew
6/24/2009 1:44:05 AM
"Lew" <noone@lewscanon.com> wrote in message
news:h1s0d5$dm0$1@news.albasani.net
> iryndin wrote:
>>>> ORA-00905
>
> 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.

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.


0
Donkey
6/24/2009 2:44:43 AM
iryndin wrote:
> while executing via Ant following statement
> 
> 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")
>     )
> /
> 

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.
0
Frank
6/24/2009 6:38:39 AM
On Jun 23, 6:48=A0pm, iryndin <iryn...@gmail.com> wrote:
> while executing via Ant following statement
>
> CREATE TABLE "ODDO_Securities"
> =A0 =A0 =A0 =A0 (
> =A0 =A0 =A0 =A0 "C_ID" NUMBER =A0NOT NULL,
> =A0 =A0 =A0 =A0 "SYSTEM_ID" NUMBER =A0NOT NULL,
> =A0 =A0 =A0 =A0 "SUBBRANCH_CODE" NUMBER =A0NOT NULL,
> =A0 =A0 =A0 =A0 "OPER_ID" NUMBER,
> =A0 =A0 =A0 =A0 "CC_CODE" NUMBER =A0NOT NULL,
> =A0 =A0 =A0 =A0 "PRICE" DOUBLE,
> =A0 =A0 "NOMINAL" NUMBER =A0NOT NULL,
> =A0 =A0 "ID_TYPE" NUMBER,
> =A0 =A0 "EMITENT_CODE" NUMBER(9),
> =A0 =A0 "PACK_CODE" NUMBER(9),
> =A0 =A0 "BRAND" VARCHAR2,
> =A0 =A0 "LIGATURA_MASS" NUMBER,
> =A0 =A0 "CHEMICAL_MASS" NUMBER,
> =A0 =A0 "HALLMARK" VARCHAR2,
> =A0 =A0 "SPEC_NUMBER" VARCHAR2,
> =A0 =A0 "MANUFACTURER_YEAR" VARCHAR2,
> =A0 =A0 "COUNT" NUMBER =A0NOT NULL,
> =A0 =A0 "NUMBER_FROM" NUMBER =A0NOT NULL,
> =A0 =A0 CONSTRAINT "PK_Security" PRIMARY KEY ("C_ID")
> =A0 =A0 )
> /
>
> I got java.sql.SQLException: ORA-00905: missing keyword .
> What am I missing?
>
> Ant task call is as following:
> <sql driver=3D"${db.jdbc.driver}"
> =A0 =A0 =A0 =A0 =A0url=3D"${db.jdbc.url}"
> =A0 =A0 =A0 =A0 =A0userid=3D"${db.project.user}"
> =A0 =A0 =A0 =A0 =A0password=3D"${db.project.password}"
> =A0 =A0 =A0 =A0 =A0classpathref=3D"oracle.jdbc.path"
> =A0 =A0 =A0 =A0 =A0delimiter=3D"/"
> =A0 =A0 =A0 =A0 =A0src=3D"${scriptHome}/createSchemaObjects.sql"
> =A0 =A0 =A0 =A0 =A0onerror=3D"abort"/>

Guys, I digged out where the problem is =3D)
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
0
iryndin
6/24/2009 11:43:32 AM
> iryndin wrote:
> > >> ORA-00905
> 
> Martin Gregorie wrote:
> > That's an Oracle error, so RTFM for Oracle SQL syntax.

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>
0
John
6/24/2009 3:21:12 PM
John B. Matthews wrote:
>> iryndin wrote:
>>>>> ORA-00905
>> Martin Gregorie wrote:
>>> That's an Oracle error, so RTFM for Oracle SQL syntax.
> 
> 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>

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.
0
Frank
6/24/2009 5:42:23 PM
In article <7af6rvF1v0sfsU1@mid.individual.net>,
 Frank Langelage <frank@lafr.de> 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>
> 
> 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.

-- 
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>
0
John
6/24/2009 6:43:00 PM
John B. Matthews wrote:
> 
> 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.
> 

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
0
RedGrittyBrick
6/25/2009 9:58:49 AM
In article <4a434a59$0$18249$da0feed9@news.zen.co.uk>,
 RedGrittyBrick <RedGrittyBrick@spamweary.invalid> wrote:

> John B. Matthews wrote:
> > 
> > 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.
> 
> 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>

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>

-- 
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>
0
John
6/25/2009 1:44:32 PM
Reply: