1 declare 2 cnta int; 3 begin 4 select count(*) into cnta from AS_SPJG where spid = :new.spid; 5 if cnta = 0 then 6 INSERT INTO AS_SPJG(SPID, 7 PRICE, 8 PRICE1, 9 REGION, 10 LASTTIME, 11 UP_STATUS) 12 select :new.spid, 13 0, 14 0, 15 '', 16 17 to_char(sysdate, 'YYYY-MM-DD HH24:MI:SS'), 18 0 19 20 FROM dual a; 21 end if; 22 end;
朋友们,请问还有其它的方法吗? ,这么写也太费劲了