• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

SQL Exception

 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all. I can't figure out what is goin wrong with an INSERT SQL query I am using in a JSP page. Here is the code -

But when I attempt to execute this query, I get an SQLException error saying : Syntax error in INSERT INTO statement.
I have also tried using a prepared statement but I get the same error.
Can anyone help?
Thanks!
 
Ranch Hand
Posts: 1170
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Numerical data should not be wrapped in ' '.
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sometimes you must add database name before the table's name between a dot.
for example: book.order
 
Sheriff
Posts: 67756
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

sometimes you must add database name before the table's name between a dot.


Though this is clearly not one of those times.
 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are there other inserts working for this table? possible that the table name itself is causing the problem, since ORDER is [part of] an ANSI SQL keyword (ORDER BY)?
I remember one time I was working with a field which held a description, and we were getting errors until we renamed it to "descr" instead of "desc" :roll:
Hope this is the problem, because it seems like it would be simple to fix...
-- Jon
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you could use PL/SQL worksheet or someother interface app to test your query b4 you actually add it in your code
or something along those lines
[ March 31, 2004: Message edited by: Dru InHeaven() ]
 
Paper beats rock. Scissors beats tiny ad.
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic