From: Robin H. Johnson Date: Thu, 23 Feb 2012 02:50:51 +0000 (-0800) Subject: Script to fetch all shortcodes to CSV file. X-Git-Url: https://git.sitka.bclibraries.ca/gitweb/?p=sitka%2Fsitka-tools.git;a=commitdiff_plain;h=9c8cd3acb86b7cd9fc4192358594c90cc66950fb;ds=sidebyside Script to fetch all shortcodes to CSV file. --- diff --git a/marc_export_custom/fetch-shortcodes.sh b/marc_export_custom/fetch-shortcodes.sh new file mode 100755 index 0000000..fb8f6f4 --- /dev/null +++ b/marc_export_custom/fetch-shortcodes.sh @@ -0,0 +1,11 @@ +#!/bin/bash +psql -Upostgres -U evergreen evergreen -h db1.bclibraries.ca -o shortcodes.csv \ +-c "COPY ( + SELECT + a.shortname,a.name,b.shortname AS parent + FROM actor.org_unit a + JOIN actor.org_unit b + ON (a.parent_ou = b.id) + ORDER BY shortname + ) TO STDOUT WITH CSV HEADER QUOTE AS '\"' FORCE QUOTE shortname, name, parent;" +