reload from ubm
This commit is contained in:
parent
0301883d49
commit
8fee2548a4
17
reload/hunt.sql
Normal file
17
reload/hunt.sql
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
copy (
|
||||||
|
select
|
||||||
|
to_char(r."Date",'mm/dd/yy') "Date"
|
||||||
|
,r."Reference Number"
|
||||||
|
,r."Payee Name"
|
||||||
|
,r."Memo"
|
||||||
|
,r."Amount"
|
||||||
|
,r."Category Name"
|
||||||
|
from
|
||||||
|
tps.trans
|
||||||
|
join lateral jsonb_populate_record(null::tps.hunt, rec) r on true
|
||||||
|
where
|
||||||
|
srce = 'HUNT'
|
||||||
|
order by
|
||||||
|
r."Date" asc
|
||||||
|
) to
|
||||||
|
'C:\users\fleet\downloads\hunt.csv' with (format csv, header true);
|
40
reload/huntdef.json
Normal file
40
reload/huntdef.json
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
{
|
||||||
|
"name": "hunt",
|
||||||
|
"source": "client_file",
|
||||||
|
"loading_function": "csv",
|
||||||
|
"constraint": [
|
||||||
|
"{Date}"
|
||||||
|
],
|
||||||
|
"schema": [
|
||||||
|
{
|
||||||
|
"key": "Date",
|
||||||
|
"type": "date",
|
||||||
|
"column_name":"Date"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "Reference Number",
|
||||||
|
"type": "numeric",
|
||||||
|
"column_name":"Reference Number"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "Payee Name",
|
||||||
|
"type": "text",
|
||||||
|
"column_name":"Payee Name"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "Memo",
|
||||||
|
"type": "text",
|
||||||
|
"column_name":"Memo"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "Amount",
|
||||||
|
"type": "text",
|
||||||
|
"column_name":"Amount"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "Category Name",
|
||||||
|
"type": "text",
|
||||||
|
"column_name":"Cateogry Name"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
4299
reload/mapval.json
Normal file
4299
reload/mapval.json
Normal file
File diff suppressed because it is too large
Load Diff
@ -1 +1 @@
|
|||||||
curl -H "Content-Type: application/json" -X POST -d@./vals.json http://localhost:81/mapval_set
|
curl -H "Content-Type: application/json" -X POST -d@//mnt/c/Users/fleet/Documents/tps_etl/reload/mapval.json http://localhost:81/mapval_set
|
Loading…
Reference in New Issue
Block a user