Sunday, February 26, 2012

faily to update record

update arinvchg set chgcode =
(select pTable.chgcode from pTable ,arinvchg where pTable.oldchgcode =
arinvchg.chgcode)
As i process the above statment, I got an error about " ld{^_?h_@.
?C?ld{b =B!=B<B<=B>B>= ZAΤld{Χ@.}?A?GO
?C
?yw?C"
[In English, it said , (it return more than one subquery ... etc) _How about
I assume that chgcode is an unique
update arinvchg set chgcode =
(select chgcode from pTable
where pTable.oldchgcode = arinvchg.chgcode)
where exists (select * from pTable where
pTable.oldchgcode = arinvchg.chgcode)
"Agnes" <agnes@.dynamictech.com.hk> wrote in message
news:uC2gcq9SGHA.4340@.tk2msftngp13.phx.gbl...
> update arinvchg set chgcode =
> (select pTable.chgcode from pTable ,arinvchg where pTable.oldchgcode =
> arinvchg.chgcode)
> As i process the above statment, I got an error about "
> ld{^_?h_@.?C?ld{b =B!=B<B<=B>B>=
> ZAΤld{Χ@.}?A?GO?C
> ?yw?C"
> [In English, it said , (it return more than one subquery ... etc) _
>
>|||Hi,
As you didn=B4t explain where the new value should come from, this below
is one of the possible solutions (as your new value for the rest of the
id would be static)
UPDATE SomeTable
SET nameid =3D
YOurnewValue + RIGHT(nameid,18)
HTH, jens Suessmeyer.
http://www.sqlserver2005.de|||On Mon, 20 Mar 2006 12:56:12 +0800, Agnes wrote:

>update arinvchg set chgcode =
>(select pTable.chgcode from pTable ,arinvchg where pTable.oldchgcode =
>arinvchg.chgcode)
>As i process the above statment, I got an error about " ld{^_?h_
@.?C?ld{b =B!=B<B<=B>B>= ZAΤld{Χ@.?}?A?GO
?C
>?yw?C"
>[In English, it said , (it return more than one subquery ... etc) _
>
Hi Agnes,
Hard to say what you should change, since you didn;t post anything about
your tables, data and expected results. Please check www.aspfaq.com/5006
to learn a better way to ask for help in this group.
Anyway, here's a completely wild guess at what might possibly be your
solution:
UPDATE arinvchg
SET chgcode = (SELECT pTable.chgcode
FROM pTable
WHERE pTable.oldchgcode = arinvchg.chgcode)
Hugo Kornelis, SQL Server MVP

No comments:

Post a Comment