• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Himai Minh
  • Carey Brown
  • salvin francis

sql insert statement

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can someone tell me what is wrong with this insert statement.
String sql = "INSERT INTO IT_REQUEST (REQUESTID, EMPLOYEEID REQUESTDATE, PRIORITY, TYPE, DESCRIPTION, STARTDATE, COMPLETED, STATUS, MISEMPLOYEE, ACTIVE, CREATEDDATE, CREATEDBY, MODIFIEDDATE, MODIFIEDBY, DELETEINDICATOR, MODIFIEDINDICATOR, EMPNAME, EMPEMAIL) VALUES ( '"+ requestIdInt +"', '"+ zero +"', '"+ reqDate +"', '"+ zero +"', '"+ reqType +"', '"+ reqDesc +"','"+ reqDate +"', '"+ n +"', '"+ open +"', '"+ assignto +"', '"+ y +"', '"+ reqDate +"', '"+ vgm +"', '"+ reqDate +"', '"+ vgm +"','"+ n +"', '"+ n +"', '"+ empName +"', '"+ empEmail +"')";
 
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What database are you using?
What error are you receiving?
What does the string look like after this statement?
Are all the required fields in the insert statement?
Are all the numeric fields number, strings -- strings, dates in date format for the database
Dan
[This message has been edited by Daniel Dunleavy (edited June 21, 2001).]
 
Gary Guion
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oracle 8.1.6
yes all fields are there. I am using Vignette API's, but I am primarily concerned with the insert syntax. The more I look I think that it is due to the bean that is running the query...
 
Daniel Dunleavy
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you take the result string and run it using Toad (or whatever you have) you can eliminate you insert syntax.
Since I can't see your DDL, I can't tell if you have everything set right.
For instance ... should you be using the to_date(...) for your dates fields? If you just have them defined as varchar2 in your database, then you wouldn't have to.
So take a sample of the string as it comes out of your statement and run it in Oracle. Then you can eliminate that as the culprit.
Dan
 
Gary Guion
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks.
 
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The integer values to ba added to the database should be writtenm as "+<some-variable>+" and not like '"+<some-variable>+"'.


------------------
Vikas Aggarwal
Technology Associate
Shakun Global Networks
www.vikinsa.com
 
Don't listen to Steve. Just read this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic