Hi everybody,
I feel stupid even having to ask such a simple question but here it goes.
I'm trying to write a update statement in SQl, but it ain't working so I thought I'd let someone have a look at it because they'll find my error faster then I will.
Here is the code:
prodDesc & prodNum are variables;
java.lang.String updateString;
updateString = " UPDATE PRODUCT_TBL" +
" SET DESCRIPTION = "+ prodDesc +
" WHERE PRODUCT_NUM = "+ prodNum;
System.out.println(updateString);
java.sql.Statement statement = connection.createStatement();
statement.execute(updateString);
And this is the error I'm getting:
java.sql.SQLException: Column "TEST" not found in table at position 38. UPDATE PRODUCT_TBL SET DESCRIPTION = Test WHERE PRODUCT_NUM = 980001
thanks is advance
I feel stupid even having to ask such a simple question but here it goes.
I'm trying to write a update statement in SQl, but it ain't working so I thought I'd let someone have a look at it because they'll find my error faster then I will.
Here is the code:
prodDesc & prodNum are variables;
java.lang.String updateString;
updateString = " UPDATE PRODUCT_TBL" +
" SET DESCRIPTION = "+ prodDesc +
" WHERE PRODUCT_NUM = "+ prodNum;
System.out.println(updateString);
java.sql.Statement statement = connection.createStatement();
statement.execute(updateString);
And this is the error I'm getting:
java.sql.SQLException: Column "TEST" not found in table at position 38. UPDATE PRODUCT_TBL SET DESCRIPTION = Test WHERE PRODUCT_NUM = 980001
thanks is advance