create or replace function handle_increment_stats (appt_id varchar, status varchar) returns void as $$
if status = 'Pending'
begin
update clinic_stats
set pending_appointments = pending_appointments + 1
where id = appt.id
end
$$ language sql volatile;
create or replace function handle_increment_stats (appt_id varchar, status varchar) returns void as $$
if status = 'Pending'
begin
update clinic_stats
set pending_appointments = pending_appointments + 1
where id = appt.id
end
$$ language sql volatile;