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 / October 2004

Tip: Looking for answers? Try searching our database.

Inserting 444.44 into a DECimal(11,2) defined database field does not work

Thread view: 
Arnold Peters - 19 Oct 2004 23:05 GMT
When I try to insert a record into  a database I got a SQLException

java.sql.SQLException: Unexpected token: 444.0 in statement [

The database column is defined DECimal(11,2) and the value is of type double and value 444.44

Why does the database not accept this value ?

Arni
Ann - 19 Oct 2004 23:45 GMT
> When I try to insert a record into  a database I got a SQLException
>
[quoted text clipped - 5 lines]
>
> Arni

The database is using DECIMAL.

Change the database column definition to be double(11,2).
Luke Webber - 19 Oct 2004 23:56 GMT
More information required. What is the full SQL command sequence, and
what DBMS are you using? It's probably not the constant value that's at
fault here, but your SQL syntax.

Luke

> When I try to insert a record into  a database I got a SQLException
>
[quoted text clipped - 5 lines]
>
> Arni
Paul Lutus - 20 Oct 2004 06:58 GMT
> When I try to insert a record into  a database I got a SQLException
>
[quoted text clipped - 4 lines]
>
> Why does the database not accept this value ?

Because of a problem in the code you forgot to post?

Signature

Paul Lutus
http://www.arachnoid.com

Tor Iver Wilhelmsen - 20 Oct 2004 08:07 GMT
> java.sql.SQLException: Unexpected token: 444.0 in statement [
[...]
> Why does the database not accept this value ?

It does not get that far: The error message comes from the SQL parser.

Why didn't you post the SQL statement you tried to execute?
steph - 20 Oct 2004 09:45 GMT
which rdbms ?

what is exactely the code ?

Le 20/10/2004 00:05, Arnold Peters a écrit :

> When I try to insert a record into  a database I got a SQLException
>
[quoted text clipped - 5 lines]
>
> Arni

Signature

stephane
retirez les lettres majuscules et le 666 de l'adresse pour l'utiliser.

Jørn Hansen - 20 Oct 2004 20:36 GMT
> When I try to insert a record into  a database I got a SQLException
>
[quoted text clipped - 5 lines]
>
> Arni

What is your regional setup? Should it be 444,0 instead of 444.0...


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



©2008 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.