On Thu, 7 Dec 2000 [EMAIL PROTECTED] wrote:
> --------------------------- Command entered ----------------------------
> UPDATE product A SET prnbr =(select kodebaru from pindahkode where
> kodelama=A.prnbr)
> WHERE prmenbr=377
Mestinya sih, kalau mau nyoba satu baris aja:
UPDATE product A SET prnbr =(select kodebaru from pindahkode where
kodelama=377)
Soalnya, update...where emang syntax error, mestinya:
update ...
from ...
where ...
> ------------------------------------------------------------------------
> DB21034E The command was processed as an SQL statement because it was not
> a
> valid Command Line Processor command. During SQL processing it returned:
> SQL0811N The result of a scalar fullselect, SELECT INTO statement, or
> VALUES
> INTO statement is more than one row. SQLSTATE=21000
^^^^^^^^^^^^^^^^^^^^
Problem di databasenya tuh, di datanya; "select kodebaru from
pindahkode..." menghasilkan lebih dari satu baris, padahal, buat
dimasukkan ke "update product A set = ...", hasil dari select di atas itu
harus satu baris, tidak lebih.
Untuk melihat kodeproduct mana yang lebih dari satu, bisa menggunakan:
select distinct kodebaru from pindahkode
having count(kodebaru) > 1
Oki
--------------------------------------------------------------------------------
Utk berhenti langganan, kirim email ke [EMAIL PROTECTED]
Informasi arsip di http://www.linux.or.id/milis.php3
Pengelola dapat dihubungi lewat [EMAIL PROTECTED]