forked from rrrgh/exercise
-
Notifications
You must be signed in to change notification settings - Fork 0
/
postgre_seq_nextval_character_varying.sql
432 lines (427 loc) · 15.8 KB
/
postgre_seq_nextval_character_varying.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
-- Sequence: wz11tt_001_id_seq
-- DROP SEQUENCE wz11tt_001_id_seq;
CREATE SEQUENCE wz11tt_001_id_seq
INCREMENT 1
MINVALUE 1
MAXVALUE 9223372036854775807
START 139
CACHE 1;
ALTER TABLE wz11tt_001_id_seq
OWNER TO wz11adm01;
-- Table: wz11tt_001
-- DROP TABLE wz11tt_001;
CREATE TABLE wz11tt_001
(
id bigint NOT NULL DEFAULT nextval('wz11tt_001_id_seq'::regclass),
hojin_code character(4) NOT NULL,
shori_ymd timestamp without time zone NOT NULL,
constant character varying(6),
batch_id character varying(13),
batch_date character varying(10),
sequence_num character varying(48),
emp_id character varying(48),
emp_last_name character varying(32),
emp_first_name character varying(32),
middle_initial character varying(1),
emp_group_id character varying(48),
emp_org_unit1 character varying(48),
emp_org_unit2 character varying(48),
emp_org_unit3 character varying(48),
emp_org_unit4 character varying(48),
emp_org_unit5 character varying(48),
emp_org_unit6 character varying(48),
eft_bnk_accnt_num character varying(100),
eft_bnk_routing_num character varying(48),
net_ttl_tax character varying(23),
rep_id character varying(32),
rep_key character varying(48),
ledger_cd character varying(20),
curr_cd character varying(3),
home_cntry_name character varying(64),
rep_submit_date character varying(10),
rep_usr_def_date character varying(10),
rep_payment_date character varying(10),
rep_name character varying(40),
rep_image_flag character varying(1),
rep_vat_ent character varying(1),
rep_ta_ent character varying(1),
rep_post_amt character varying(23),
rep_appr_amt character varying(23),
rep_policy_name character varying(64),
re_budget_date character varying(10),
rep_org_unit1 character varying(48),
rep_org_unit2 character varying(48),
rep_org_unit3 character varying(48),
rep_org_unit4 character varying(48),
rep_org_unit5 character varying(48),
rep_org_unit6 character varying(48),
rep_custom1 character varying(48),
rep_custom2 character varying(48),
rep_custom3 character varying(48),
rep_custom4 character varying(48),
rep_custom5 character varying(48),
rep_custom6 character varying(48),
rep_custom7 character varying(48),
rep_custom8 character varying(48),
rep_custom9 character varying(48),
rep_custom10 character varying(48),
rep_custom11 character varying(48),
rep_custom12 character varying(48),
rep_custom13 character varying(48),
rep_custom14 character varying(48),
rep_custom15 character varying(48),
rep_custom16 character varying(48),
rep_custom17 character varying(48),
rep_custom18 character varying(48),
rep_custom19 character varying(48),
rep_custom20 character varying(48),
re_id character varying(13),
re_tr_type character varying(3),
re_expense_type_name character varying(64),
re_trx_date character varying(10),
re_curr_cd character varying(3),
re_exc_rate character varying(23),
re_exc_rate_drct character varying(1),
re_personal_flag character varying(1),
re_desc character varying(64),
re_vendor_name character varying(64),
re_vendor_desc character varying(64),
re_receipt_flag character varying(1),
re_receipt_type character varying(1),
ttl_emp_attendee character varying(23),
ttl_spouse_attendee character varying(23),
ttl_bis_attendee character varying(23),
re_org_unit1 character varying(48),
re_org_unit2 character varying(48),
re_org_unit3 character varying(48),
re_org_unit4 character varying(48),
re_org_unit5 character varying(48),
re_org_unit6 character varying(48),
re_custom1 character varying(48),
re_custom2 character varying(48),
re_custom3 character varying(48),
re_custom4 character varying(48),
re_custom5 character varying(48),
re_custom6 character varying(48),
re_custom7 character varying(48),
re_custom8 character varying(48),
re_custom9 character varying(48),
re_custom10 character varying(48),
re_custom11 character varying(48),
re_custom12 character varying(48),
re_custom13 character varying(48),
re_custom14 character varying(48),
re_custom15 character varying(48),
re_custom16 character varying(48),
re_custom17 character varying(48),
re_custom18 character varying(48),
re_custom19 character varying(48),
re_custom20 character varying(48),
re_custom21 character varying(48),
re_custom22 character varying(48),
re_custom23 character varying(48),
re_custom24 character varying(48),
re_custom25 character varying(48),
re_custom26 character varying(48),
re_custom27 character varying(48),
re_custom28 character varying(48),
re_custom29 character varying(48),
re_custom30 character varying(48),
re_custom31 character varying(48),
re_custom32 character varying(48),
re_custom33 character varying(48),
re_custom34 character varying(48),
re_custom35 character varying(48),
re_custom36 character varying(48),
re_custom37 character varying(48),
re_custom38 character varying(48),
re_custom39 character varying(48),
re_custom40 character varying(48),
re_trx_amt character varying(23),
re_post_amt character varying(23),
re_appr_amt character varying(23),
payment_type_cd character varying(4),
payment_cd character varying(80),
rep_payment_reim_type character varying(1),
bill_date character varying(36),
crdt_card_num character varying(255),
crdt_card_desc character varying(255),
crdt_card_jr_key character varying(13),
crdt_card_ref_num character varying(64),
crdt_card_cct_key character varying(13),
crdt_card_cct_type character varying(3),
crdt_card_id character varying(32),
crdt_card_amt character varying(23),
crdt_card_tax character varying(23),
crdt_card_curr_cd character varying(3),
crdt_card_post_amt character varying(23),
crdt_card_post_curr_cd character varying(3),
crdt_card_date character varying(10),
crdt_card_post_date character varying(10),
crdt_card_trx_desc character varying(42),
crdt_card_master_cd character varying(5),
crdt_card_merc_name character varying(50),
crdt_card_merc_city character varying(40),
crdt_card_merc_state character varying(32),
crdt_card_merc_cntry character varying(2),
crdt_card_merc_ref_num character varying(15),
crdt_card_bill_type character varying(2),
exc_rate_user_curr character varying(23),
billing_amt character varying(23),
ind_crdt_card_accnt_name character varying(255),
ind_crdt_card_name character varying(255),
merc_bis_as character varying(64),
acquirer_ref_num character varying(50),
re_loc_cntry_cd character varying(2),
re_loc_cntry_sub_cd character varying(6),
re_frdm_flg character varying(4),
market_cd character varying(255),
pro_ref_num character varying(64),
jrn_pay_type_name character varying(64),
jrn_pay_cd_name character varying(80),
jrn_pay_type_name2 character varying(64),
jrn_pay_cd_name2 character varying(80),
jrn_accnt_cd character varying(48),
jrn_dbcr character varying(2),
jrn_amt character varying(23),
jrn_key character varying(48),
car_bis_dist character varying(13),
car_personal_dist character varying(13),
car_passenger_cnt character varying(13),
vehicle_id character varying(30),
crdt_card_trx_sales character varying(23),
crdt_card_vendor_name character varying(64),
cs_adv_req_amt character varying(23),
cs_adv_req_curr_cd character varying(3),
cs_adv_req_curr_num_cd character varying(3),
cs_adv_exc_rate character varying(23),
cs_adv_curr_cd character varying(3),
cs_adv_curr_num_cd character varying(3),
cs_adv_iss_date character varying(10),
cs_adv_pay_cd_name character varying(80),
cs_adv_trx_type character varying(1),
cs_adv_req_date character varying(10),
cs_adv_key character varying(13),
cs_adv_payment character varying(1),
alloc_key character varying(13),
alloc_percentage character varying(11),
alloc_custom1 character varying(48),
alloc_custom2 character varying(48),
alloc_custom3 character varying(48),
alloc_custom4 character varying(48),
alloc_custom5 character varying(48),
alloc_custom6 character varying(48),
alloc_custom7 character varying(48),
alloc_custom8 character varying(48),
alloc_custom9 character varying(48),
alloc_custom10 character varying(48),
alloc_custom11 character varying(48),
alloc_custom12 character varying(48),
alloc_custom13 character varying(48),
alloc_custom14 character varying(48),
alloc_custom15 character varying(48),
alloc_custom16 character varying(48),
alloc_custom17 character varying(48),
alloc_custom18 character varying(48),
alloc_custom19 character varying(48),
alloc_custom20 character varying(48),
jrn_ttl_adj_tax character varying(23),
ta_meal_type character varying(1),
ta_disp_limit character varying(23),
ta_allowance_limit character varying(23),
allowable_threshold character varying(23),
ta_meal_lodg_type character varying(1),
base_amt character varying(23),
allowance_amt character varying(23),
ta_overnight character varying(1),
ta_brkfst_flag character varying(3),
ta_lunch_flag character varying(3),
ta_din_flag character varying(3),
ttl_tax_post_amt character varying(23),
ttl_rec_amt character varying(23),
tax_auth_name character varying(50),
tax_auth_label character varying(5),
re_tax_trx_amt character varying(23),
rep_ent_tax_post_amt character varying(23),
tax_source character varying(4),
re_tax_rec_trx_amt character varying(23),
re_tax_rec_post_amt character varying(23),
re_tax_cd character varying(20),
re_tax_rec_domestic_flag character varying(1),
re_tax_adj_amt character varying(23),
re_tax_rec_adj_amt character varying(23),
re_tax_rec_cd character varying(20),
re_tax_rec_trans_adj_cd character varying(23),
re_tax_alloc_rec_cd character varying(20),
trv_req_id character varying(20),
trv_req_name character varying(40),
trv_req_post_amt character varying(23),
trv_req_appr_amt character varying(23),
trv_req_start_date character varying(10),
trv_req_end_date character varying(10),
trv_req_auth_date character varying(10),
re_ttl_tx_post_amt character varying(23),
net_tax_amt character varying(23),
re_ttl_rec_adj_amt character varying(23),
net_adj_rec_amt character varying(23),
re_pay_type_name character varying(64),
card_prg_type_cd character varying(5),
state_start_date character varying(8),
state_period_end_date character varying(8),
cash_accnt_cd character varying(48),
liability_accnt_cd character varying(48),
estim_pay_date character varying(10),
fund_trace_num character varying(30),
reqed_disb_date character varying(10),
cs_adv_disb_date character varying(40),
ftr_use1 character varying(1),
ftr_use2 character varying(1),
ftr_use3 character varying(1),
ftr_use4 character varying(1),
emp_login_id character varying(128),
emp_email_addr character varying(255),
emp_custom1 character varying(48),
emp_custom2 character varying(48),
emp_custom3 character varying(48),
emp_custom4 character varying(48),
emp_custom5 character varying(48),
emp_custom6 character varying(48),
emp_custom7 character varying(48),
emp_custom8 character varying(48),
emp_custom9 character varying(48),
emp_custom10 character varying(48),
emp_custom11 character varying(48),
emp_custom12 character varying(48),
emp_custom13 character varying(48),
emp_custom14 character varying(48),
emp_custom15 character varying(48),
emp_custom16 character varying(48),
emp_custom17 character varying(48),
emp_custom18 character varying(48),
emp_custom19 character varying(48),
emp_custom20 character varying(48),
ftr_use5 character varying(1),
ftr_use6 character varying(1),
ftr_use7 character varying(1),
ftr_use8 character varying(1),
ftr_use9 character varying(1),
emp_bnk_accnt_status character varying(1),
emp_bnk_accnt_type character varying(20),
emp_bkg_accnt_name character varying(100),
emp_bnk_name character varying(200),
emp_bnk_branch_loc character varying(30),
emp_bnk_addr_1 character varying(50),
emp_bnk_addr_2 character varying(50),
emp_bnk_city character varying(50),
emp_bnk_region character varying(50),
emp_bnk_postal_cd character varying(20),
emp_bnk_cntry_cd character varying(2),
emp_tax_id character varying(255),
emp_is_resident character varying(1),
emp_accnt_status character varying(30),
emp_accnt_curr character varying(3),
ftr_use10 character varying(1),
ftr_use11 character varying(1),
ftr_use12 character varying(1),
ftr_use13 character varying(1),
ftr_use14 character varying(1),
rep_ttl_pers_amt character varying(23),
rep_ttl_cla_amt character varying(23),
ttl_user_due character varying(23),
ttl_comp_card_due character varying(23),
rep_ttl_rej character varying(23),
rep_ttl_comp_paid character varying(23),
rep_ttl_due_comp character varying(23),
rep_ttl_conf_paid character varying(23),
rep_ttl_due_user character varying(23),
rep_ttl_due_comp_card character varying(23),
rep_type character varying(2),
re_tax_adj_amt2 character varying(23),
net_adj_tax_amt character varying(23),
ftr_use15 character varying(1),
ftr_use16 character varying(1),
ftr_use17 character varying(1),
cs_adv_ret_amt character varying(23),
cs_adv_ret_recv_flg character varying(1),
cs_adv_util_amt character varying(23),
ftr_use18 character varying(1),
ftr_use19 character varying(1),
ftr_use20 character varying(1),
ftr_use21 character varying(1),
re_loc_city_name character varying(64),
is_billable character varying(1),
re_from_loc character varying(100),
re_to_loc character varying(100),
re_loc_name character varying(64),
re_cntry_cd character varying(2),
re_cntry_sub_cd character varying(6),
re_xml_receipt_uuid character varying(16),
ftr_use22 character varying(1),
ftr_use23 character varying(1),
ftr_use24 character varying(1),
ftr_use25 character varying(1),
ftr_use26 character varying(1),
alloc_trx_amt character varying(23),
alloc_post_amt character varying(23),
alloc_rec_trx_amt character varying(23),
alloc_rec_post_amt character varying(23),
alloc_rec_trx_adj_amt character varying(23),
ftr_use27 character varying(1),
ftr_use28 character varying(1),
ftr_use29 character varying(1),
ftr_use30 character varying(1),
ftr_use31 character varying(1),
auth_req_name character varying(40),
auth_req_ttl_post_amt character varying(23),
auth_req_ttl_appr_amt character varying(23),
auth_req_start_date character varying(10),
auth_req_end_date character varying(10),
auth_req_auth_date character varying(10),
auth_req_id character varying(20),
ftr_use32 character varying(1),
ftr_use33 character varying(1),
ftr_use34 character varying(1),
ftr_use35 character varying(1),
ftr_use36 character varying(1),
ftr_use37 character varying(1),
ftr_use38 character varying(1),
ftr_use39 character varying(1),
ftr_use40 character varying(1),
ftr_use41 character varying(1),
ftr_use42 character varying(1),
ftr_use43 character varying(1),
ftr_use44 character varying(1),
ftr_use45 character varying(1),
ftr_use46 character varying(1),
ftr_use47 character varying(1),
ftr_use48 character varying(1),
ftr_use49 character varying(1),
ftr_use50 character varying(1),
ftr_use51 character varying(1),
ftr_use52 character varying(1),
ftr_use53 character varying(1),
ftr_use54 character varying(1),
ftr_use55 character varying(1),
ftr_use56 character varying(1),
ftr_use57 character varying(1),
ftr_use58 character varying(1),
ftr_use59 character varying(1),
ftr_use60 character varying(1),
ftr_use61 character varying(1),
ftr_use62 character varying(1),
ftr_use63 character varying(1),
ftr_use64 character varying(1),
ftr_use65 character varying(1),
ftr_use66 character varying(1),
ftr_use67 character varying(1),
ftr_use68 character varying(1),
torikomi_flg character varying(1),
userid character varying(10),
rnew_day timestamp without time zone,
CONSTRAINT wz11tt_001_pkey PRIMARY KEY (id, hojin_code, shori_ymd)
)
WITH (
OIDS=FALSE
);
ALTER TABLE wz11tt_001
OWNER TO wz11adm01;