mysql:7972
From: sato <sato <satot@xxxxxxxxxx>>
Date: Mon, 30 Jun 2003 20:02:01 +0900
Subject: [mysql 07972] Table の更新について
全くの初心者satoと申します。
今まで、ParadoxというDataBaseを使っていました。
レコードの追加の際、二重登録の防止のために
たとえば、もし同じcodeのものがあれば、更新し、
なければ、レコードを追加したいのですが。
このような場合SQLでは、
SELECT ******
としてみて、もし該当するレコードがゼロなら
INSERT *****
と、SQLを二回発行するのでしょうか。
ちなみに、DelphiでParadoxの場合は、
if Table1.Locate('CODE',s_code,[]) then
Table1.Edit
else
begin
Table1.Append;
Table1.Fileds[0].AsInteger:=s_code;
end;
.
.
.
.
みたいにしていました。どうぞよろしくご教示下さい。
--
<>
-> 7972 2003-06-30 20:02 [sato <satot@xxxxxxxx] Table の更新について 7973 2003-06-30 20:55 ┗[A.K.I. <aki@xxxxxxxx] 7980 2003-07-02 09:04 ┗[sato <satot@xxxxxxxx] 7981 2003-07-02 16:19 ┣["Takashi Yamashita" ] 7982 2003-07-02 17:00 ┗[SUGAWARA Hajime <sug]