String with single quote not saved in DB
I tried to save the single quote within a string. But it always shows error. Find the solution for error on single quote within a string.
Learn the solution for error on single quote within a string
I tried to save the single quote within a string. But it always shows error.
And then I found the solution to that problem. That is, if you add another single quote near to that existing single quote, now you can store easily.
My existing query:
INSERT INTO Barrett(SNo,EleNo,EleName,Type,AttbNo,AttbName,AttbVal,StyleName,StyleType,LISFirst,LISLast,RefEleNo,RefEleName,RefEleType,RefAttbNo,RefAttbName,RefAttbVal,ConAttb,Tag,LibFile,LibItem,LblName,MasPage,LyrName,XMLVer,XPath,GroupStylePath,VarEle,GrpVar,LastVar,SizeAdj,Text1,Text2,Anchor) VALUES(42, 1, 'chapter', 'ROT', '', '', '', 'App' Head', 'P', 'L#RH', '', '', '', '', '', '', '', '', 'B', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '');
Check the string App' Head. So this query was always displayed error message.
Soultion query:
INSERT INTO Barrett(SNo,EleNo,EleName,Type,AttbNo,AttbName,AttbVal,StyleName,StyleType,LISFirst,LISLast,RefEleNo,RefEleName,RefEleType,RefAttbNo,RefAttbName,RefAttbVal,ConAttb,Tag,LibFile,LibItem,LblName,MasPage,LyrName,XMLVer,XPath,GroupStylePath,VarEle,GrpVar,LastVar,SizeAdj,Text1,Text2,Anchor) VALUES(42, 1, 'chapter', 'ROT', '', '', '', 'App'' Head', 'P', 'L#RH', '', '', '', '', '', '', '', '', 'B', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '');
insert into s values (''' k')
Try This..........it gives 'k
Kalyani