Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Databases / June 2009

Tip: Looking for answers? Try searching our database.

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

Thread view: 
iryndin - 23 Jun 2009 15:48 GMT
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"/>
Martin Gregorie - 23 Jun 2009 15:54 GMT
> ORA-00905

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

Signature

martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

Lew - 24 Jun 2009 02:44 GMT
iryndin wrote:
> >> ORA-00905

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

<http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_7002.h
tm#i2095331
>
<http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/img_text/create_t
able.htm
>

I'm not seeing the error.

Signature

Lew

Donkey Hottie - 24 Jun 2009 03:44 GMT
> iryndin wrote:
>>>> ORA-00905
[quoted text clipped - 5 lines]
>
> 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.
John B. Matthews - 24 Jun 2009 16:21 GMT
> iryndin wrote:
> > >> ORA-00905
>
> > That's an Oracle error, so RTFM for Oracle SQL syntax.

Always a useful exercise.


> 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>

Signature

John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>

Frank Langelage - 24 Jun 2009 18:42 GMT
>> iryndin wrote:
>>>>> ORA-00905
[quoted text clipped - 25 lines]
> [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%3Aoff
icial&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.
John B. Matthews - 24 Jun 2009 19:43 GMT
> >> 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
[quoted text clipped - 9 lines]
> 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.

Signature

John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>

RedGrittyBrick - 25 Jun 2009 10:58 GMT
> 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>

Signature

RGB

John B. Matthews - 25 Jun 2009 14:44 GMT
> > 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.
[quoted text clipped - 5 lines]
>
> 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-u
sed-on-json-org
>

And this guide to reading the diagrams:

<http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=/db2/rbafz
msthowtous.htm
>

Signature

John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>

Frank Langelage - 24 Jun 2009 07:38 GMT
> while executing via Ant following statement
>
[quoted text clipped - 21 lines]
>     )
> /

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.
iryndin - 24 Jun 2009 12:43 GMT
> while executing via Ant following statement
>
[quoted text clipped - 34 lines]
>          src="${scriptHome}/createSchemaObjects.sql"
>          onerror="abort"/>

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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.