我坚持做SQL分配......我创建了这个程序
SET SERVEROUTPUT ON;
CREATE OR REPLACE PROCEDURE insert_glaccount
(
account_number_param general_ledger_accounts.account_number%TYPE,
account_description_param general_ledger_accounts.account_description%TYPE
)
AS
BEGIN
INSERT INTO general_ledger_accounts
VALUES (account_number_param, account_description_param);
END;
/
我需要调用该程序并检查重复的帐号。如果有重复,那么我需要输出一条消息。我一直在尝试不同的东西,但似乎没有任何效果。
感谢任何帮助或建议,谢谢
答案 0 :(得分:0)
试试这个
declare
total_row number;
begin
select count(*)
into total_row
from general_ledger_accounts
where conditions whatever you want
if total_row then
...
else
...
end if;