Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

error in syntax .check manual

518497Sep 10 2008 — edited Sep 10 2008
Hi
I am getting on value of variable(sj) from database and storing in list and using that value to get ID from same table.
Now problem ---- if value of variable (psj = yyuyu "ghgh jkjkj" ghghg ) OR (psj=hjhjhj 'hjhjh jkjkj' hhjhjh).It gives error "you have error in syntax......." .(because of presence of sigle or double quote.how to correct this .I am newbie


i tried both but same result
a)String psj=(String)kjk.get(y);
resultsetnt=statement.executeQuery("select ID from tbl where Text='"+psj+"'");
b)String psj=(String)kjk.get(y);
resultsetnt=statement.executeQuery("select ID from tbl where Text=\""+psj+"\""); where id continas integer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 8 2008
Added on Sep 10 2008
6 comments
239 views