Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

sql insert statement

 
Gary Guion
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 +"')";
 
Daniel Dunleavy
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.
 
Vikas Aggarwal
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic