Hi All, My requirement is that I have a variable like title = "Hello world" and my insert statement is like insertSQL = "INSERT INTO TblCategory (CategoryKey, Title, ContentTypeKey) "; insertSQL += " VALUES(" + key + ", " + title + "," + contTypeKey + ")"; when I was trying to insert in oracle the title varible is expecting ''. Please help me out... how can I resolve it. thanks Regards Sham SQL: INSERT INTO TblCategory (CategoryKey, Title, ContentTypeKey) VALUES(19, Helloworld,2)
Hey sham.. I guess Title is of VARCHAR type.. in your table definition.. Then it should be : insertSQL += " VALUES(" + key + ", " +"'"+title +"'"+"," + contTypeKey + ")"; hope this helps..
If you don't want to worry about these types of issues then you should switch to PreparedStatements and let the JDBC Driver handle them. You would then get the additional performance benefit of precompiled statements.