查找是否有相同的记录 select count(YPBH) from table where YPBH='df' 'df'表示textbox1的值 如果记录数大于1就有重复的
你的问题不清楚“然后顺序录入下面的一些字段”什么意思? 要是没其他数据的话 建个构成应该可以了。 通过flag_out来判断是否操作成功 create or replace procedure test(YPBH_in in integer, flag_out out integer) is begin select count(YPBH) into YPBH_in from tb; if YPBH_in > 0 then flag_out:=0; elsif YPBH_in = 0 then insert into tb(YPBH) values(YPBH_in); commit; flag_out:=1; end if end test;
select count(YPBH) from table where YPBH='df'
'df'表示textbox1的值
如果记录数大于1就有重复的
要是没其他数据的话 建个构成应该可以了。
通过flag_out来判断是否操作成功
create or replace procedure test(YPBH_in in integer, flag_out out integer)
is
begin
select count(YPBH) into YPBH_in from tb;
if YPBH_in > 0 then
flag_out:=0;
elsif YPBH_in = 0 then
insert into tb(YPBH) values(YPBH_in);
commit;
flag_out:=1;
end if
end test;