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 |
pragyapandey9789
Starting Member
6 Posts |
Posted - 2013-12-18 : 11:45:22
|
Hi guys!The query doesn't execute somehow and error comes quoted string not ending properly..can't get where's the mistake..plz help!!update oojobdefn set additional_networkentities='select networkentity_id from networkentity where nsc_id=:NSC and entitytype_id=6 and active='Y' and networkcode like 'Sales Zone%' and networkentity_id!=6120union allselect networkentity_id from networkentity where networkentity_id=6000'where additional_networkentities='select networkentity_id from networkentity where networkentity_id =6121union all select networkentity_id from networkentity where networkentity_id =6122 union all select networkentity_id from networkentity where networkentity_id =6123 union all select networkentity_id from networkentity where networkentity_id =6124 union all select networkentity_id from networkentity where networkentity_id =6128 union allselect networkentity_id from networkentity where networkentity_id =6129 union all select networkentity_id from networkentity where networkentity_id =6130 union allselect networkentity_id from networkentity where networkentity_id =6131 union all select networkentity_id from networkentity where networkentity_id =6132union all select networkentity_id from networkentity where networkentity_id =6133 union all select networkentity_id from networkentity where networkentity_id =6000' |
|
Bustaz Kool
Master Smack Fu Yak Hacker
1834 Posts |
Posted - 2013-12-18 : 11:50:18
|
You have apostrophes embedded in your string ('Y'). You can solve this be using two single quotes (''Y''). The string itself would still use a single single quote.It looks like you also have an extra apostrophe near the "6000" on line six.=================================================No, no, you're not thinking, you're just being logical. -Niels Bohr |
 |
|
pragyapandey9789
Starting Member
6 Posts |
Posted - 2013-12-18 : 11:52:31
|
thanks a lot!!but what about Sales Zone?? do i have to use 2 single quotes as well.. |
 |
|
pragyapandey9789
Starting Member
6 Posts |
Posted - 2013-12-18 : 12:02:35
|
the apostrophe near 6000 is to end the value given for additional_networkentities column.. |
 |
|
|
|
|