-
Notifications
You must be signed in to change notification settings - Fork 6
/
usmai_dw_etl_test.sql
3919 lines (3352 loc) · 166 KB
/
usmai_dw_etl_test.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
--
-- PostgreSQL database dump
--
-- Dumped from database version 9.6.15
-- Dumped by pg_dump version 11.1
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET client_min_messages = warning;
SET row_security = off;
DROP DATABASE usmai_dw_etl_test;
--
-- Name: usmai_dw_etl_test; Type: DATABASE; Schema: -; Owner: postgres
--
CREATE DATABASE usmai_dw_etl_test WITH TEMPLATE = template0 ENCODING = 'UTF8' LC_COLLATE = 'en_US.UTF-8' LC_CTYPE = 'en_US.UTF-8';
ALTER DATABASE usmai_dw_etl_test OWNER TO postgres;
\connect usmai_dw_etl_test
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET client_min_messages = warning;
SET row_security = off;
SET default_tablespace = '';
SET default_with_oids = false;
--
-- Name: dim_bib_rec; Type: TABLE; Schema: public; Owner: usmai_dw
--
CREATE TABLE public.dim_bib_rec (
bib_rec_dim_key bigint NOT NULL,
bib_rec_source_system_id character(9) NOT NULL,
bib_rec_aleph_lbry_cd character varying(5) NOT NULL,
bib_rec_marc_rec_field_cnt smallint NOT NULL,
bib_rec_marc_rec_data_cntnt_len_cnt smallint NOT NULL,
bib_rec_marc_rec_data_cntnt_txt character varying(45000) NOT NULL,
bib_rec_publication_yr_no smallint,
bib_rec_title character varying(100) NOT NULL,
bib_rec_author_name character varying(100),
bib_rec_imprint_txt character varying(100),
bib_rec_isbn_issn_source_cd character varying(5),
bib_rec_isbn_txt character varying(100),
bib_rec_all_associated_issns_txt character varying(100),
bib_rec_oclc_no character varying(500),
bib_rec_marc_rec_leader_field_txt character varying(500) NOT NULL,
bib_rec_type_cd character(1) NOT NULL,
bib_rec_bib_lvl_cd character(1) NOT NULL,
bib_rec_encoding_lvl_cd character(1) NOT NULL,
bib_rec_marc_rec_008_field_txt character varying(500) NOT NULL,
bib_rec_language_cd character(3),
bib_rec_issn character varying(500),
bib_rec_display_suppressed_flag character(1),
bib_rec_acquisition_created_flag character(1),
bib_rec_circulation_created_flag character(1),
bib_rec_provisional_status_flag character(1),
bib_rec_create_dt date NOT NULL,
bib_rec_update_dt date,
rm_rec_type_cd character(1) NOT NULL,
rm_rec_type_desc character varying(30) NOT NULL,
rm_rec_version_no smallint NOT NULL,
rm_rec_effective_from_dt date NOT NULL,
rm_rec_effective_to_dt date NOT NULL,
rm_current_rec_flag character(1) NOT NULL,
em_create_dw_prcsng_cycle_id integer NOT NULL,
em_create_dw_job_exectn_id integer NOT NULL,
em_create_dw_job_name character varying(100) NOT NULL,
em_create_dw_job_version_no character varying(20) NOT NULL,
em_create_user_id character varying(20) NOT NULL,
em_create_tmstmp timestamp without time zone NOT NULL,
em_update_dw_prcsng_cycle_id integer,
em_update_dw_job_exectn_id integer,
em_update_dw_job_name character varying(100),
em_update_dw_job_version_no character varying(20),
em_update_reason_txt character varying(100),
em_update_user_id character varying(20),
em_update_tmstmp timestamp without time zone
)
WITH (autovacuum_enabled='true');
ALTER TABLE public.dim_bib_rec OWNER TO usmai_dw;
--
-- Name: dim_bib_rec_seq; Type: SEQUENCE; Schema: public; Owner: usmai_dw
--
CREATE SEQUENCE public.dim_bib_rec_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.dim_bib_rec_seq OWNER TO usmai_dw;
--
-- Name: dim_date; Type: TABLE; Schema: public; Owner: usmai_dw
--
CREATE TABLE public.dim_date (
clndr_dt_dim_key integer NOT NULL,
clndr_dt date NOT NULL,
clndr_dt_desc character varying(20) NOT NULL,
usmai_fiscal_yr_no smallint NOT NULL,
clndr_yr_no smallint NOT NULL,
clndr_qtr_no smallint NOT NULL,
clndr_mth_no smallint NOT NULL,
clndr_mth_name character varying(9) NOT NULL,
clndr_mth_abrvtn character(3) NOT NULL,
clndr_day_no smallint NOT NULL,
clndr_day_name character varying(9) NOT NULL,
clndr_day_abrvtn character(3) NOT NULL,
clndr_day_in_wk_no smallint NOT NULL,
clndr_day_in_yr_no integer NOT NULL,
clndr_wk_in_mth_no smallint NOT NULL,
clndr_wk_in_yr_no smallint NOT NULL,
clndr_yr_qtr_no smallint NOT NULL,
clndr_yr_mth_no integer NOT NULL,
clndr_yr_day_no integer NOT NULL,
weekday_flag character(1) NOT NULL,
rm_rec_type_cd character(1) NOT NULL,
rm_rec_type_desc character varying(30) NOT NULL,
rm_rec_version_no smallint NOT NULL,
rm_rec_effective_from_dt date NOT NULL,
rm_rec_effective_to_dt date NOT NULL,
rm_current_rec_flag character(1) NOT NULL,
em_create_dw_prcsng_cycle_id integer NOT NULL,
em_create_dw_job_name character varying(100) NOT NULL,
em_create_dw_job_version_no character varying(20) NOT NULL,
em_create_dw_job_exectn_id integer NOT NULL,
em_create_user_id character varying(20) NOT NULL,
em_create_tmstmp timestamp without time zone NOT NULL,
em_update_dw_prcsng_cycle_id integer,
em_update_dw_job_name character varying(100),
em_update_dw_job_version_no character varying(20),
em_update_dw_job_exectn_id integer,
em_update_reason_txt character varying(100),
em_update_user_id character varying(20),
em_update_tmstmp timestamp without time zone
)
WITH (autovacuum_enabled='true');
ALTER TABLE public.dim_date OWNER TO usmai_dw;
--
-- Name: dim_lbry_holding; Type: TABLE; Schema: public; Owner: usmai_dw
--
CREATE TABLE public.dim_lbry_holding (
lbry_holding_dim_key bigint NOT NULL,
lbry_holding_source_system_id character(9) NOT NULL,
lbry_holding_aleph_lbry_cd character(5) NOT NULL,
lbry_holding_marc_rec_field_cnt smallint NOT NULL,
lbry_holding_marc_rec_data_cntnt_len_cnt smallint NOT NULL,
lbry_holding_marc_rec_data_cntnt_txt character varying(45000) NOT NULL,
lbry_holding_action_note character varying(500),
lbry_holding_disply_suppressed_flag character(1) NOT NULL,
lbry_holding_summary_holdings_txt character varying(500),
lbry_holding_supp_summary_holdings_txt character varying(500),
lbry_holding_index_summary_holdings_txt character varying(500),
lbry_holding_loc_call_no_scheme_cd character(1),
lbry_holding_loc_call_no character varying(100),
lbry_holding_loc_public_note character varying(500),
lbry_holding_loc_non_public_note character varying(500),
lbry_holding_create_dt date NOT NULL,
lbry_holding_update_dt date,
lbry_holding_maint_usmai_mbr_lbry_cd character(2) NOT NULL,
lbry_holding_maint_usmai_mbr_lbry_cd_actual_source_txt character varying(500) NOT NULL,
lbry_holding_super_holding_flag character(1) NOT NULL,
rm_rec_type_cd character(1) NOT NULL,
rm_rec_type_desc character varying(30) NOT NULL,
rm_rec_version_no smallint NOT NULL,
rm_rec_effective_from_dt date NOT NULL,
rm_rec_effective_to_dt date NOT NULL,
rm_current_rec_flag character(1) NOT NULL,
em_create_dw_prcsng_cycle_id integer NOT NULL,
em_create_dw_job_exectn_id integer NOT NULL,
em_create_dw_job_name character varying(100) NOT NULL,
em_create_dw_job_version_no character varying(20) NOT NULL,
em_create_user_id character varying(20) NOT NULL,
em_create_tmstmp timestamp without time zone NOT NULL,
em_update_dw_prcsng_cycle_id integer,
em_update_dw_job_exectn_id integer,
em_update_dw_job_name character varying(100),
em_update_dw_job_version_no character varying(20),
em_update_reason_txt character varying(100),
em_update_user_id character varying(20),
em_update_tmstmp timestamp without time zone
)
WITH (autovacuum_enabled='true');
ALTER TABLE public.dim_lbry_holding OWNER TO usmai_dw;
--
-- Name: dim_lbry_item; Type: TABLE; Schema: public; Owner: usmai_dw
--
CREATE TABLE public.dim_lbry_item (
lbry_item_dim_key bigint NOT NULL,
lbry_item_source_system_id character(15) NOT NULL,
lbry_item_adm_no character(9) NOT NULL,
lbry_item_seq_no character(6) NOT NULL,
lbry_item_aleph_lbry_name character(5) NOT NULL,
lbry_item_update_lms_staff_acct_id character varying(10),
lbry_item_create_dt date NOT NULL,
lbry_item_update_dt date NOT NULL,
lbry_item_volume_issue_no character varying(200),
lbry_item_accession_dt date,
lbry_item_page_range_txt character varying(30),
lbry_item_copy_no character(5),
lbry_item_pulication_dt date NOT NULL,
lbry_item_supplemental_matrl_title character varying(30),
lbry_item_expected_arrival_dt date NOT NULL,
lbry_item_actual_arrival_dt date NOT NULL,
lbry_item_acquisition_price_txt character varying(10),
lbry_item_barcode_no character varying(30),
lbry_item_loc_call_no_scheme_cd character(1),
lbry_item_loc_call_no_scheme_desc character varying(50),
lbry_item_loc_call_no character varying(80),
lbry_item_loc_sort_nrmlzd_call_no character varying(80),
lbry_item_loc_temp_designation_flag character(1),
lbry_item_loc_alt_call_no_scheme_cd character(1),
lbry_item_loc_alt_call_no_scheme_desc character varying(50),
lbry_item_loc_alt_call_no character varying(80),
lbry_item_loc_alt_sort_nrmlzd_call_no character varying(80),
lbry_item_enumeration_lvl_1_txt character varying(20),
lbry_item_enumeration_lvl_2_txt character varying(20),
lbry_item_enumeration_lvl_3_txt character varying(20),
lbry_item_enumeration_lvl_4_txt character varying(20),
lbry_item_enumeration_lvl_5_txt character varying(20),
lbry_item_enumeration_lvl_6_txt character varying(20),
lbry_item_alt_enumeration_lvl_1_txt character varying(20),
lbry_item_alt_enumeration_lvl_2_txt character varying(20),
lbry_item_chronology_lvl_1_txt character varying(20),
lbry_item_chronology_lvl_2_txt character varying(20),
lbry_item_chronology_lvl_3_txt character varying(20),
lbry_item_chronology_lvl_4_txt character varying(20),
lbry_item_alt_chronology_txt character varying(20),
lbry_item_circulation_display_note character varying(200),
lbry_item_opac_dislpay_txt character varying(200),
lbry_item_staff_only_display_note character varying(200),
lbry_item_most_recent_loan_event_dt date,
lbry_item_most_recent_loan_event_time smallint,
lbry_item_most_recent_loan_event_type_cd character(2),
lbry_item_most_recent_loan_event_ip_addr character varying(20),
lbry_item_most_recent_return_event_dt date,
lbry_item_most_recent_return_event_time smallint,
lbry_item_most_recent_return_event_type_cd character(2),
lbry_item_most_recent_return_event_ip_addr character varying(20),
lbry_item_most_recent_renew_event_dt date,
lbry_item_most_recent_renew_event_time smallint,
lbry_item_most_recent_renew_event_type_cd character(2),
lbry_item_most_recent_renew_event_ip_addr character varying(20),
rm_rec_type_cd character(1) NOT NULL,
rm_rec_type_desc character varying(30) NOT NULL,
rm_rec_version_no smallint NOT NULL,
rm_rec_effective_from_dt date NOT NULL,
rm_rec_effective_to_dt date NOT NULL,
rm_current_rec_flag character(1) NOT NULL,
em_create_dw_prcsng_cycle_id integer NOT NULL,
em_create_dw_job_exectn_id integer NOT NULL,
em_create_dw_job_name character varying(100) NOT NULL,
em_create_dw_job_version_no character varying(20) NOT NULL,
em_create_user_id character varying(20) NOT NULL,
em_create_tmstmp timestamp without time zone NOT NULL,
em_update_dw_prcsng_cycle_id integer,
em_update_dw_job_exectn_id integer,
em_update_dw_job_name character varying(100),
em_update_dw_job_version_no character varying(20),
em_update_reason_txt character varying(100),
em_update_user_id character varying(20),
em_update_tmstmp timestamp without time zone
)
WITH (autovacuum_enabled='true');
ALTER TABLE public.dim_lbry_item OWNER TO usmai_dw;
--
-- Name: dim_lbry_item_loc; Type: TABLE; Schema: public; Owner: usmai_dw
--
CREATE TABLE public.dim_lbry_item_loc (
lbry_item_loc_dim_key integer NOT NULL,
lbry_item_loc_usmai_mbr_lbry_cd character(2) NOT NULL,
lbry_item_loc_usmai_mbr_lbry_name character varying(70) NOT NULL,
lbry_item_loc_usmai_mbr_lbry_mbrshp_type_cd character varying(10) NOT NULL,
lbry_item_loc_lbry_entity_cd character(5) NOT NULL,
lbry_item_loc_lbry_entity_name character varying(30) NOT NULL,
lbry_item_loc_collection_cd character varying(5) NOT NULL,
lbry_item_loc_collection_name character varying(80) NOT NULL,
rm_rec_type_cd character(1) NOT NULL,
rm_rec_type_desc character varying(30) NOT NULL,
rm_rec_version_no smallint NOT NULL,
rm_rec_effective_from_dt date NOT NULL,
rm_rec_effective_to_dt date NOT NULL,
rm_current_rec_flag character(1) NOT NULL,
em_create_dw_prcsng_cycle_id integer NOT NULL,
em_create_dw_job_exectn_id integer NOT NULL,
em_create_dw_job_name character varying(100) NOT NULL,
em_create_dw_job_version_no character varying(20) NOT NULL,
em_create_user_id character varying(20) NOT NULL,
em_create_tmstmp timestamp without time zone NOT NULL,
em_update_dw_prcsng_cycle_id integer,
em_update_dw_job_exectn_id integer,
em_update_dw_job_name character varying(100),
em_update_dw_job_version_no character varying(20),
em_update_reason_txt character varying(100),
em_update_user_id character varying(20),
em_update_tmstmp timestamp without time zone
)
WITH (autovacuum_enabled='true');
ALTER TABLE public.dim_lbry_item_loc OWNER TO usmai_dw;
--
-- Name: dim_lbry_item_matrl_form; Type: TABLE; Schema: public; Owner: usmai_dw
--
CREATE TABLE public.dim_lbry_item_matrl_form (
lbry_item_matrl_form_dim_key smallint NOT NULL,
lbry_item_matrl_form_cd character varying(5) NOT NULL,
lbry_item_matrl_form_name character varying(50) NOT NULL,
rm_rec_type_cd character(1) NOT NULL,
rm_rec_type_desc character varying(30) NOT NULL,
rm_rec_version_no smallint NOT NULL,
rm_rec_effective_from_dt date NOT NULL,
rm_rec_effective_to_dt date NOT NULL,
rm_current_rec_flag character(1) NOT NULL,
em_create_dw_prcsng_cycle_id integer NOT NULL,
em_create_dw_job_exectn_id integer NOT NULL,
em_create_dw_job_name character varying(100) NOT NULL,
em_create_dw_job_version_no character varying(20) NOT NULL,
em_create_user_id character varying(20) NOT NULL,
em_create_tmstmp timestamp without time zone NOT NULL,
em_update_dw_prcsng_cycle_id integer,
em_update_dw_job_exectn_id integer,
em_update_dw_job_name character varying(100),
em_update_dw_job_version_no character varying(20),
em_update_reason_txt character varying(100),
em_update_user_id character varying(20),
em_update_tmstmp timestamp without time zone
)
WITH (autovacuum_enabled='true');
ALTER TABLE public.dim_lbry_item_matrl_form OWNER TO usmai_dw;
--
-- Name: dim_lbry_item_prcs_status; Type: TABLE; Schema: public; Owner: usmai_dw
--
CREATE TABLE public.dim_lbry_item_prcs_status (
lbry_item_prcs_status_dim_key smallint NOT NULL,
lbry_item_usmai_mbr_lbry_cd character(2) NOT NULL,
lbry_item_prcs_status_cd character(2) NOT NULL,
lbry_item_prcs_status_public_desc character varying(50) NOT NULL,
lbry_item_prcs_status_internal_desc character varying(50) NOT NULL,
rm_rec_type_cd character(1) NOT NULL,
rm_rec_type_desc character varying(30) NOT NULL,
rm_rec_version_no smallint NOT NULL,
rm_rec_effective_from_dt date NOT NULL,
rm_rec_effective_to_dt date NOT NULL,
rm_current_rec_flag character(1) NOT NULL,
em_create_dw_prcsng_cycle_id integer NOT NULL,
em_create_dw_job_exectn_id integer NOT NULL,
em_create_dw_job_name character varying(100) NOT NULL,
em_create_dw_job_version_no character varying(20) NOT NULL,
em_create_user_id character varying(20) NOT NULL,
em_create_tmstmp timestamp without time zone NOT NULL,
em_update_dw_prcsng_cycle_id integer,
em_update_dw_job_exectn_id integer,
em_update_dw_job_name character varying(100),
em_update_dw_job_version_no character varying(20),
em_update_reason_txt character varying(100),
em_update_user_id character varying(20),
em_update_tmstmp timestamp without time zone
)
WITH (autovacuum_enabled='true');
ALTER TABLE public.dim_lbry_item_prcs_status OWNER TO usmai_dw;
--
-- Name: dim_lbry_item_status; Type: TABLE; Schema: public; Owner: usmai_dw
--
CREATE TABLE public.dim_lbry_item_status (
lbry_item_status_dim_key smallint NOT NULL,
lbry_item_usmai_mbr_lbry_cd character(2) NOT NULL,
lbry_item_status_cd character(2) NOT NULL,
lbry_item_status_desc character varying(50) NOT NULL,
rm_rec_type_cd character(1) NOT NULL,
rm_rec_type_desc character varying(30) NOT NULL,
rm_rec_version_no smallint NOT NULL,
rm_rec_effective_from_dt date NOT NULL,
rm_rec_effective_to_dt date NOT NULL,
rm_current_rec_flag character(1) NOT NULL,
em_create_dw_prcsng_cycle_id integer NOT NULL,
em_create_dw_job_exectn_id integer NOT NULL,
em_create_dw_job_name character varying(100) NOT NULL,
em_create_dw_job_version_no character varying(20) NOT NULL,
em_create_user_id character varying(20) NOT NULL,
em_create_tmstmp timestamp without time zone NOT NULL,
em_update_dw_prcsng_cycle_id integer,
em_update_dw_job_exectn_id integer,
em_update_dw_job_name character varying(100),
em_update_dw_job_version_no character varying(20),
em_update_reason_txt character varying(100),
em_update_user_id character varying(20),
em_update_tmstmp timestamp without time zone
)
WITH (autovacuum_enabled='true');
ALTER TABLE public.dim_lbry_item_status OWNER TO usmai_dw;
--
-- Name: dw_prcsing_cycle_job_exectn_id; Type: SEQUENCE; Schema: public; Owner: usmai_dw
--
CREATE SEQUENCE public.dw_prcsing_cycle_job_exectn_id
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.dw_prcsing_cycle_job_exectn_id OWNER TO usmai_dw;
--
-- Name: dw_prcsng_cycle; Type: TABLE; Schema: public; Owner: usmai_dw
--
CREATE TABLE public.dw_prcsng_cycle (
dw_prcsng_cycle_id integer NOT NULL,
dw_prcsng_cycle_planned_dt date NOT NULL,
dw_prcsng_cycle_stat_type_cd character(1) NOT NULL,
dw_prcsng_cycle_freq_type_cd character(2) NOT NULL,
dw_prcsng_cycle_exectn_start_tmstmp timestamp without time zone,
dw_prcsng_cycle_exectn_end_tmstmp timestamp without time zone,
em_create_tmstmp timestamp without time zone NOT NULL,
em_create_user_id character varying(20) NOT NULL,
em_update_tmstmp timestamp without time zone,
em_update_user_id character varying(20),
em_update_reason_txt character varying(100)
)
WITH (autovacuum_enabled='true');
ALTER TABLE public.dw_prcsng_cycle OWNER TO usmai_dw;
--
-- Name: dw_prcsng_cycle_job; Type: TABLE; Schema: public; Owner: usmai_dw
--
CREATE TABLE public.dw_prcsng_cycle_job (
dw_prcsng_cycle_job_name character varying(100) NOT NULL,
dw_prcsng_cycle_job_version_no character varying(20) NOT NULL,
dw_prcsng_cycle_job_purpose_desc character varying(300) NOT NULL,
dw_prcsng_cycle_job_code_object_name character varying(100) NOT NULL,
dw_prcsng_cycle_job_code_object_version_no smallint NOT NULL,
dw_prcsng_cycle_job_code_object_loc_path_txt character varying(200) NOT NULL,
em_create_tmstmp timestamp without time zone NOT NULL,
em_create_user_id character varying(20) NOT NULL,
em_update_tmstmp timestamp without time zone,
em_update_user_id character varying(20)
)
WITH (autovacuum_enabled='true');
ALTER TABLE public.dw_prcsng_cycle_job OWNER TO usmai_dw;
--
-- Name: dw_prcsng_cycle_job_exectn; Type: TABLE; Schema: public; Owner: usmai_dw
--
CREATE TABLE public.dw_prcsng_cycle_job_exectn (
dw_prcsng_cycle_job_exectn_id integer NOT NULL,
dw_prcsng_cycle_job_name character varying(100) NOT NULL,
dw_prcsng_cycle_job_version_no character varying(20) NOT NULL,
dw_prcsng_cycle_id integer NOT NULL,
dw_prcsng_cycle_job_exectn_processed_rec_cnt integer,
dw_prcsng_cycle_job_exectn_success_rec_cnt integer,
dw_prcsng_cycle_job_exectn_suspend_rec_cnt integer,
dw_prcsng_cycle_job_exectn_elapsed_time smallint,
dw_prcsng_cycle_job_exectn_invoking_user_id character varying(20) NOT NULL,
dw_prcsng_cycle_job_exectn_start_tmstmp timestamp without time zone NOT NULL,
dw_prcsng_cycle_job_exectn_end_tmstmp timestamp without time zone,
em_create_tmstmp timestamp without time zone NOT NULL,
em_create_user_id character varying(20) NOT NULL,
em_update_tmstmp timestamp without time zone,
em_update_user_id character varying(20)
)
WITH (autovacuum_enabled='true');
ALTER TABLE public.dw_prcsng_cycle_job_exectn OWNER TO usmai_dw;
--
-- Name: dw_stg_1_mai01_z00; Type: TABLE; Schema: public; Owner: usmai_dw
--
CREATE TABLE public.dw_stg_1_mai01_z00 (
rec_type_cd character(1) NOT NULL,
db_operation_cd character(1) NOT NULL,
rec_trigger_key character(9) NOT NULL,
z00_doc_number character(9),
z00_no_lines character varying(4),
z00_data_len character varying(6),
z00_data character varying(45000),
em_create_dw_prcsng_cycle_id integer NOT NULL,
em_create_dw_job_exectn_id integer NOT NULL,
em_create_dw_job_name character varying(100) NOT NULL,
em_create_dw_job_version_no character varying(20) NOT NULL,
em_create_user_id character varying(20) NOT NULL,
em_create_tmstmp timestamp without time zone NOT NULL
)
WITH (autovacuum_enabled='true');
ALTER TABLE public.dw_stg_1_mai01_z00 OWNER TO usmai_dw;
--
-- Name: dw_stg_1_mai01_z00_field; Type: TABLE; Schema: public; Owner: usmai_dw
--
CREATE TABLE public.dw_stg_1_mai01_z00_field (
rec_type_cd character(1) NOT NULL,
db_operation_cd character(1) NOT NULL,
rec_trigger_key character(9) NOT NULL,
z00_doc_number character(9),
dw_stg_1_marc_rec_field_seq_no smallint NOT NULL,
z00_marc_rec_field_cd character varying(5),
z00_marc_rec_field_txt character varying(2000),
em_create_dw_prcsng_cycle_id integer NOT NULL,
em_create_dw_job_exectn_id integer NOT NULL,
em_create_dw_job_name character varying(100) NOT NULL,
em_create_dw_job_version_no character varying(20) NOT NULL,
em_create_user_id character varying(20) NOT NULL,
em_create_tmstmp timestamp without time zone NOT NULL
)
WITH (autovacuum_enabled='true');
ALTER TABLE public.dw_stg_1_mai01_z00_field OWNER TO usmai_dw;
--
-- Name: dw_stg_1_mai01_z13; Type: TABLE; Schema: public; Owner: usmai_dw
--
CREATE TABLE public.dw_stg_1_mai01_z13 (
rec_type_cd character(1) NOT NULL,
db_operation_cd character(1) NOT NULL,
rec_trigger_key character(9) NOT NULL,
z13_rec_key character(9),
z13_year character varying(4),
z13_open_date character varying(8),
z13_update_date character(8),
z13_call_no_key character varying(80),
z13_call_no_code character(5),
z13_call_no character varying(100),
z13_author_code character(5),
z13_author character varying(100),
z13_title_code character(5),
z13_title character varying(100),
z13_imprint_code character(5),
z13_imprint character varying(100),
z13_isbn_issn_code character(5),
z13_isbn_issn character varying(100),
z13_upd_time_stamp character(15),
em_create_dw_prcsng_cycle_id integer NOT NULL,
em_create_dw_job_exectn_id integer NOT NULL,
em_create_dw_job_name character varying(100) NOT NULL,
em_create_dw_job_version_no character varying(20) NOT NULL,
em_create_user_id character varying(20) NOT NULL,
em_create_tmstmp timestamp without time zone NOT NULL
)
WITH (autovacuum_enabled='true');
ALTER TABLE public.dw_stg_1_mai01_z13 OWNER TO usmai_dw;
--
-- Name: dw_stg_1_mai01_z13u; Type: TABLE; Schema: public; Owner: usmai_dw
--
CREATE TABLE public.dw_stg_1_mai01_z13u (
rec_type_cd character(1) NOT NULL,
db_operation_cd character(1) NOT NULL,
rec_trigger_key character(9) NOT NULL,
z13u_rec_key character(9),
z13u_user_defined_1_code character(5),
z13u_user_defined_1 character varying(500),
z13u_user_defined_2_code character(5),
z13u_user_defined_2 character varying(500),
z13u_user_defined_3_code character(5),
z13u_user_defined_3 character varying(500),
z13u_user_defined_4_code character(5),
z13u_user_defined_4 character varying(500),
z13u_user_defined_5_code character(5),
z13u_user_defined_5 character varying(500),
z13u_user_defined_6_code character(5),
z13u_user_defined_6 character varying(500),
z13u_user_defined_7_code character(5),
z13u_user_defined_7 character varying(500),
z13u_user_defined_8_code character(5),
z13u_user_defined_8 character varying(500),
z13u_user_defined_9_code character(5),
z13u_user_defined_9 character varying(500),
z13u_user_defined_10_code character(5),
z13u_user_defined_10 character varying(500),
z13u_user_defined_11_code character(5),
z13u_user_defined_11 character varying(500),
z13u_user_defined_12_code character(5),
z13u_user_defined_12 character varying(500),
z13u_user_defined_13_code character(5),
z13u_user_defined_13 character varying(500),
z13u_user_defined_14_code character(5),
z13u_user_defined_14 character varying(500),
z13u_user_defined_15_code character(5),
z13u_user_defined_15 character varying(500),
em_create_dw_prcsng_cycle_id integer NOT NULL,
em_create_dw_job_exectn_id integer NOT NULL,
em_create_dw_job_name character varying(100) NOT NULL,
em_create_dw_job_version_no character varying(20) NOT NULL,
em_create_user_id character varying(20) NOT NULL,
em_create_tmstmp timestamp without time zone NOT NULL
)
WITH (autovacuum_enabled='true');
ALTER TABLE public.dw_stg_1_mai01_z13u OWNER TO usmai_dw;
--
-- Name: dw_stg_1_mai39_z00; Type: TABLE; Schema: public; Owner: usmai_dw
--
CREATE TABLE public.dw_stg_1_mai39_z00 (
rec_type_cd character(1) NOT NULL,
db_operation_cd character(1) NOT NULL,
rec_trigger_key character(9) NOT NULL,
z00_doc_number character(9),
z00_no_lines character varying(4),
z00_data_len character varying(6),
z00_data character varying(45000),
em_create_dw_prcsng_cycle_id integer NOT NULL,
em_create_dw_job_exectn_id integer NOT NULL,
em_create_dw_job_name character varying(100) NOT NULL,
em_create_dw_job_version_no character varying(20) NOT NULL,
em_create_user_id character varying(20) NOT NULL,
em_create_tmstmp timestamp without time zone NOT NULL
)
WITH (autovacuum_enabled='true');
ALTER TABLE public.dw_stg_1_mai39_z00 OWNER TO usmai_dw;
--
-- Name: dw_stg_1_mai39_z00_field; Type: TABLE; Schema: public; Owner: usmai_dw
--
CREATE TABLE public.dw_stg_1_mai39_z00_field (
rec_type_cd character(1) NOT NULL,
db_operation_cd character(1) NOT NULL,
rec_trigger_key character(9) NOT NULL,
z00_doc_number character(9),
dw_stg_1_marc_rec_field_seq_no smallint NOT NULL,
z00_marc_rec_field_cd character varying(5),
z00_marc_rec_field_txt character varying(2000),
em_create_dw_prcsng_cycle_id integer NOT NULL,
em_create_dw_job_exectn_id integer NOT NULL,
em_create_dw_job_name character varying(100) NOT NULL,
em_create_dw_job_version_no character varying(20) NOT NULL,
em_create_user_id character varying(20) NOT NULL,
em_create_tmstmp timestamp without time zone NOT NULL
)
WITH (autovacuum_enabled='true');
ALTER TABLE public.dw_stg_1_mai39_z00_field OWNER TO usmai_dw;
--
-- Name: dw_stg_1_mai39_z13; Type: TABLE; Schema: public; Owner: usmai_dw
--
CREATE TABLE public.dw_stg_1_mai39_z13 (
rec_type_cd character(1) NOT NULL,
db_operation_cd character(1) NOT NULL,
rec_trigger_key character(9) NOT NULL,
z13_rec_key character(9),
z13_year character varying(4),
z13_open_date character varying(8),
z13_update_date character(8),
z13_call_no_key character varying(80),
z13_call_no_code character(5),
z13_call_no character varying(100),
z13_author_code character(5),
z13_author character varying(100),
z13_title_code character(5),
z13_title character varying(100),
z13_imprint_code character(5),
z13_imprint character varying(100),
z13_isbn_issn_code character(5),
z13_isbn_issn character varying(100),
z13_upd_time_stamp character(15),
em_create_dw_prcsng_cycle_id integer NOT NULL,
em_create_dw_job_exectn_id integer NOT NULL,
em_create_dw_job_name character varying(100) NOT NULL,
em_create_dw_job_version_no character varying(20) NOT NULL,
em_create_user_id character varying(20) NOT NULL,
em_create_tmstmp timestamp without time zone NOT NULL
)
WITH (autovacuum_enabled='true');
ALTER TABLE public.dw_stg_1_mai39_z13 OWNER TO usmai_dw;
--
-- Name: dw_stg_1_mai39_z13u; Type: TABLE; Schema: public; Owner: usmai_dw
--
CREATE TABLE public.dw_stg_1_mai39_z13u (
rec_type_cd character(1) NOT NULL,
db_operation_cd character(1) NOT NULL,
rec_trigger_key character(9) NOT NULL,
z13u_rec_key character(9),
z13u_user_defined_1_code character(5),
z13u_user_defined_1 character varying(500),
z13u_user_defined_2_code character(5),
z13u_user_defined_2 character varying(500),
z13u_user_defined_3_code character(5),
z13u_user_defined_3 character varying(500),
z13u_user_defined_4_code character(5),
z13u_user_defined_4 character varying(500),
z13u_user_defined_5_code character(5),
z13u_user_defined_5 character varying(500),
z13u_user_defined_6_code character(5),
z13u_user_defined_6 character varying(500),
z13u_user_defined_7_code character(5),
z13u_user_defined_7 character varying(500),
z13u_user_defined_8_code character(5),
z13u_user_defined_8 character varying(500),
z13u_user_defined_9_code character(5),
z13u_user_defined_9 character varying(500),
z13u_user_defined_10_code character(5),
z13u_user_defined_10 character varying(500),
z13u_user_defined_11_code character(5),
z13u_user_defined_11 character varying(500),
z13u_user_defined_12_code character(5),
z13u_user_defined_12 character varying(500),
z13u_user_defined_13_code character(5),
z13u_user_defined_13 character varying(500),
z13u_user_defined_14_code character(5),
z13u_user_defined_14 character varying(500),
z13u_user_defined_15_code character(5),
z13u_user_defined_15 character varying(500),
em_create_dw_prcsng_cycle_id integer NOT NULL,
em_create_dw_job_exectn_id integer NOT NULL,
em_create_dw_job_name character varying(100) NOT NULL,
em_create_dw_job_version_no character varying(20) NOT NULL,
em_create_user_id character varying(20) NOT NULL,
em_create_tmstmp timestamp without time zone NOT NULL
)
WITH (autovacuum_enabled='true');
ALTER TABLE public.dw_stg_1_mai39_z13u OWNER TO usmai_dw;
--
-- Name: dw_stg_1_mai50_z103_bib; Type: TABLE; Schema: public; Owner: usmai_dw
--
CREATE TABLE public.dw_stg_1_mai50_z103_bib (
rec_type_cd character(1) NOT NULL,
db_operation_cd character(1) NOT NULL,
rec_trigger_key character(9) NOT NULL,
source character(9),
dest character(9),
dest_lib character(5),
dest_docnum character(9),
em_create_dw_prcsng_cycle_id integer NOT NULL,
em_create_dw_job_exectn_id integer NOT NULL,
em_create_dw_job_name character varying(100) NOT NULL,
em_create_dw_job_version_no character varying(20) NOT NULL,
em_create_user_id character varying(20) NOT NULL,
em_create_tmstmp timestamp without time zone NOT NULL
)
WITH (autovacuum_enabled='true');
ALTER TABLE public.dw_stg_1_mai50_z103_bib OWNER TO usmai_dw;
--
-- Name: dw_stg_1_mai50_z103_bib_full; Type: TABLE; Schema: public; Owner: usmai_dw
--
CREATE TABLE public.dw_stg_1_mai50_z103_bib_full (
rec_type_cd character(1) NOT NULL,
db_operation_cd character(1) NOT NULL,
rec_trigger_key character(9) NOT NULL,
source character(9),
dest character(9),
dest_lib character(5),
dest_docnum character(9),
em_create_dw_prcsng_cycle_id integer NOT NULL,
em_create_dw_job_exectn_id integer NOT NULL,
em_create_dw_job_name character varying(100) NOT NULL,
em_create_dw_job_version_no character varying(20) NOT NULL,
em_create_user_id character varying(20) NOT NULL,
em_create_tmstmp timestamp without time zone NOT NULL
)
WITH (autovacuum_enabled='true');
ALTER TABLE public.dw_stg_1_mai50_z103_bib_full OWNER TO usmai_dw;
--
-- Name: dw_stg_1_mai50_z30; Type: TABLE; Schema: public; Owner: usmai_dw
--
CREATE TABLE public.dw_stg_1_mai50_z30 (
rec_type_cd character(1) NOT NULL,
db_operation_cd character(1) NOT NULL,
rec_trigger_key character(15) NOT NULL,
z30_rec_key character(15),
z30_barcode character(30),
z30_sub_library character(5),
z30_material character(5),
z30_item_status character(2),
z30_open_date character varying(8),
z30_update_date character varying(8),
z30_cataloger character(10),
z30_date_last_return character varying(8),
z30_hour_last_return character varying(4),
z30_ip_last_return character varying(20),
z30_no_loans character varying(3),
z30_alpha character(1),
z30_collection character(5),
z30_call_no_type character(1),
z30_call_no character varying(80),
z30_call_no_key character(80),
z30_call_no_2_type character(1),
z30_call_no_2 character varying(80),
z30_call_no_2_key character(80),
z30_description character varying(200),
z30_note_opac character varying(200),
z30_note_circulation character varying(200),
z30_note_internal character varying(200),
z30_order_number character varying(30),
z30_inventory_number character varying(20),
z30_inventory_number_date character varying(8),
z30_last_shelf_report_date character varying(8),
z30_price character(10),
z30_shelf_report_number character(20),
z30_on_shelf_date character varying(8),
z30_on_shelf_seq character varying(6),
z30_rec_key_2 character(19),
z30_rec_key_3 character(40),
z30_pages character varying(30),
z30_issue_date character varying(8),
z30_expected_arrival_date character varying(8),
z30_arrival_date character(8),
z30_item_statistic character(10),
z30_item_process_status character(2),
z30_copy_id character(5),
z30_hol_doc_number_x character(9),
z30_temp_location character(1),
z30_enumeration_a character varying(20),
z30_enumeration_b character varying(20),
z30_enumeration_c character varying(20),
z30_enumeration_d character varying(20),
z30_enumeration_e character varying(20),
z30_enumeration_f character varying(20),
z30_enumeration_g character varying(20),
z30_enumeration_h character varying(20),
z30_chronological_i character varying(20),
z30_chronological_j character varying(20),
z30_chronological_k character varying(20),
z30_chronological_l character varying(20),
z30_chronological_m character varying(20),
z30_supp_index_o character varying(30),
z30_85x_type character(1),
z30_depository_id character(5),
z30_linking_number character varying(9),
z30_gap_indicator character(1),
z30_maintenance_count character varying(3),
z30_process_status_date character varying(8),
z30_upd_time_stamp character(15),
z30_ip_last_return_v6 character varying(50),
em_create_dw_prcsng_cycle_id integer NOT NULL,
em_create_dw_job_exectn_id integer NOT NULL,
em_create_dw_job_name character varying(100) NOT NULL,
em_create_dw_job_version_no character varying(20) NOT NULL,
em_create_user_id character varying(20) NOT NULL,
em_create_tmstmp timestamp without time zone NOT NULL
)
WITH (autovacuum_enabled='true');
ALTER TABLE public.dw_stg_1_mai50_z30 OWNER TO usmai_dw;
--
-- Name: dw_stg_1_mai50_z30_full; Type: TABLE; Schema: public; Owner: usmai_dw
--
CREATE TABLE public.dw_stg_1_mai50_z30_full (
rec_type_cd character(1) NOT NULL,
db_operation_cd character(1) NOT NULL,
rec_trigger_key character(15) NOT NULL,
z30_rec_key character(15),
z30_barcode character(30),
z30_sub_library character(5),
z30_material character(5),
z30_item_status character(2),
z30_open_date character varying(8),
z30_hol_doc_number_x character(9),
z30_order_number character varying(30),
em_create_dw_prcsng_cycle_id integer NOT NULL,
em_create_dw_job_exectn_id integer NOT NULL,
em_create_dw_job_name character varying(100) NOT NULL,
em_create_dw_job_version_no character varying(20) NOT NULL,
em_create_user_id character varying(20) NOT NULL,
em_create_tmstmp timestamp without time zone NOT NULL
)
WITH (autovacuum_enabled='true');
ALTER TABLE public.dw_stg_1_mai50_z30_full OWNER TO usmai_dw;
--
-- Name: dw_stg_1_mai50_z35; Type: TABLE; Schema: public; Owner: usmai_dw
--
CREATE TABLE public.dw_stg_1_mai50_z35 (
rec_type_cd character(1) NOT NULL,
db_operation_cd character(1) NOT NULL,
rec_trigger_key character(22) NOT NULL,
z35_rec_key character(9),
z35_item_sequence character varying(6),
z35_event_type character(2),
z35_time_stamp character(22),
z35_id character(12),
z35_material character(5),
z35_sub_library character(5),
z35_status character(2),
z35_event_date numeric(8,0),
z35_event_hour numeric(4,0),
z35_item_status character(2),
z35_bor_status character(2),
z35_bor_type character(2),
z35_cataloger_name character(10),
z35_type character(1),
z35_ip_address character varying(20),
z35_query character varying(500),
z35_note character varying(100),
z35_upd_time_stamp character(15),
z35_ip_address_v6 character varying(50),
em_create_dw_prcsng_cycle_id integer NOT NULL,
em_create_dw_job_exectn_id integer NOT NULL,
em_create_dw_job_name character varying(100) NOT NULL,
em_create_dw_job_version_no character varying(20) NOT NULL,
em_create_user_id character varying(20) NOT NULL,
em_create_tmstmp timestamp without time zone NOT NULL
)
WITH (autovacuum_enabled='true');
ALTER TABLE public.dw_stg_1_mai50_z35 OWNER TO usmai_dw;
--
-- Name: dw_stg_1_mai60_z00; Type: TABLE; Schema: public; Owner: usmai_dw
--
CREATE TABLE public.dw_stg_1_mai60_z00 (
rec_type_cd character(1) NOT NULL,
db_operation_cd character(1) NOT NULL,