Sudah saya coba dua metode tsb,
Untuk command anda tsb, UDB-IBM tidak mau errornya seperti
UPDATE PRODUCT INNER JOIN PINDAHKODE ON PRNBR=KODELAMA SET PRNBR = KODEBARU
WHERE PRMENBR=377;
------------------------------------------------------------------------
DB21034E The command was processed as an SQL statement because it was not
a
valid Command Line Processor command. During SQL processing it returned:
SQL0104N An unexpected token "JOIN PINDAHKODE ON PRNBR=KODELAMA" was found
following "UPDATE PRODUCT INNER". Expected tokens may include: "<space>".
SQLSTATE=42601
Terus saya coba buka Microsoft Access saya Connect link table to ODBC
database yaitu database DB2, saya update pakai perintah seperti anda, tapi
ada error message, field could not updateable,
Apa ada metode lain yang bisa bantu?
Please respond to [EMAIL PROTECTED]
To: <[EMAIL PROTECTED]>
cc: (bcc: Ahmad Juniar/Kawan_Lama)
Subject: Re: [programming] Help. SQL Update melibatkan 2 tabel?
Maap... moga-moga ini ngebantu...
coba begini:
update product inner join pindahkode on product.kodeproduct =
pindahkode.kodelama set product.kodeproduct = pindahkode.kodebaru
regards,
>
> Maap, tanya tentang SQL language,
>
> Ada 2 tabel :
> -Tabel Product berisi field kodeproduct, harga
> - Tabel Pindahkode berisi field kodelama, kodebaru
>
> saya mau mengupdate field kodeproduct pada tabel product, dengan field
> kodebaru pada tabel pindahkode.
> Field kodelama = field kodeproduct.
>
> yang sudah saya lakukan begini tapi semuanya syntax error :
> - update product set kodeproduct = (select kodebaru from product,
> pindahkode where kodeproduct=kodelama)
> - update product, pindahkode set kodeproduct=kodebaru where
> kodelama=kodeproduct
>
> Mohon direvisi, Gimana caranya ?
>
>
> Thanks in advance.
>
> Ahmad Juniar
>
--------------------------------------------------------------------------------
Utk berhenti langganan, kirim email ke [EMAIL PROTECTED]
Informasi arsip di http://www.linux.or.id/milis.php3
Pengelola dapat dihubungi lewat [EMAIL PROTECTED]