mirror of
https://github.com/acedanger/budget-database.git
synced 2025-12-05 22:50:13 -08:00
moving to postgres
This commit is contained in:
13
postgres/procedures/import_budget_from_import.sql
Normal file
13
postgres/procedures/import_budget_from_import.sql
Normal file
@@ -0,0 +1,13 @@
|
||||
CREATE OR REPLACE PROCEDURE public.update_budget_from_import()
|
||||
LANGUAGE plpgsql
|
||||
AS $procedure$
|
||||
begin
|
||||
truncate public.budgetdetails;
|
||||
|
||||
insert into public.budgetdetails (trxdescription, trxdate, trxamount)
|
||||
select description, cast(dt as date) as dt_converted, amount
|
||||
from public.budgetimport;
|
||||
|
||||
end
|
||||
$procedure$;
|
||||
GRANT EXECUTE ON PROCEDURE public.update_budget_from_import() TO acedanger;
|
||||
Reference in New Issue
Block a user