Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
snufse
Constraint Violating Yak Guru
469 Posts |
Posted - 2008-10-13 : 15:27:21
|
Trying to insert a record using variables from a data set. Get error on variable myRow.Item(63).insert into rjadevlib.f5514ar (f1, f2, f3) " values(" & "'" myRow.Item(63) & "'" & "," & "'" & myRow.Item(64) & "'" & "," & "'" & myRow.Item(65) & "'" & ")"The content is:insert into rjadevlib.f5514ar(f1, f2, f3) values('101 Sansbury's Way ','West Palm Beach ','Fl')SQL0104: Token S was not valid. Valid tokens: ) ,.Cause . . . . . : A syntax error was detected at token S. Token S is not a valid token. Is there a way around this? Thank you |
|
|
sakets_2000
Master Smack Fu Yak Hacker
1472 Posts |
Posted - 2008-10-13 : 15:33:52
|
| insert into rjadevlib.f5514ar(f1, f2, f3) values('101 Sansbury''s Way ','West Palm Beach ','Fl') |
 |
|
|
snufse
Constraint Violating Yak Guru
469 Posts |
Posted - 2008-10-13 : 16:58:01
|
| I need to capture and set this reading the variable "myRow.Item(63)". Is there a way to do that? |
 |
|
|
hanbingl
Aged Yak Warrior
652 Posts |
Posted - 2008-10-13 : 17:12:27
|
| REPLACE(MYROW.ITEM(63),'''','''''') |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2008-10-13 : 17:12:57
|
| I think you're building the sql-statement in VB or something like VB.Why don't you use stringreplace-function and do the replace '(single quote) by ''(2 single quote)?WebfredPlanning replaces chance by mistake |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
snufse
Constraint Violating Yak Guru
469 Posts |
Posted - 2008-10-14 : 07:54:42
|
| Thank you guys, I appreciate the response from each of you. Now I have it solved..... |
 |
|
|
|
|
|
|
|