










create table ar_class 
  (
    arc_code char(5),
    arc_glm integer,
    arc_desc char(30)
  );

revoke all on ar_class from "public";



create table ar_cycle 
  (
    arcy_code smallint,
    arcy_desc char(30),
    arcy_last_date date,
    arcy_next_date date,
    arcy_cutoff_date date,
    arcy_fnchg_stat char(1),
    arcy_trnan_stat char(1),
    arcy_dagel_stat char(1),
    arcy_stmnt_stat char(1),
    arcy_balfd_stat char(1),
    arcy_opncr_stat char(1),
    arcy_fnchg_ord char(1),
    arcy_trnan_ord char(1),
    arcy_dagel_ord char(1),
    arcy_stmnt_ord char(1),
    arcy_balfd_ord char(1),
    arcy_opncr_ord char(1)
  );

revoke all on ar_cycle from "public";



create table ar_fnc_table 
  (
    fc_fnc_code char(4),
    fc_amount decimal(8,2),
    fc_type char(1),
    fc_fin_charge decimal(8,2)
  );

revoke all on ar_fnc_table from "public";



create table ar_item 
  (
    ar_customer integer,
    ar_invoice_nbr integer,
    ar_seq_nbr smallint,
    ar_tran_type char(2),
    ar_tran_dt date,
    ar_amount decimal(10,2),
    ar_due_dt date,
    ar_disc_date date,
    ar_disc_amt decimal(8,2),
    ar_shift_link integer
  );

revoke all on ar_item from "public";



create table ar_item_tag 
  (
    art_customer integer,
    art_invoice_nbr integer,
    art_line smallint,
    art_text char(40),
    art_deposit integer
  );

revoke all on ar_item_tag from "public";



create table ar_type 
  (
    at_prft_ctr smallint,
    at_type_code char(2),
    at_desc char(30),
    at_oper char(1),
    at_gl_db integer,
    at_gl_cr integer
  );

revoke all on ar_type from "public";



create table fm_lading 
  (
    fml_movement integer,
    fml_bl_nbr integer,
    fml_int_ext char(1),
    fml_vendor integer,
    fml_terminal smallint,
    fml_date date,
    fml_net_gals decimal(8,2),
    fml_gross_gals decimal(8,2),
    fml_po_nbr char(10)
  );

revoke all on fm_lading from "public";



create table fm_terminal 
  (
    fmt_code smallint,
    fmt_zip_code char(10),
    fmt_owner char(10),
    fmt_sp_inst char(50)
  );

revoke all on fm_terminal from "public";



create table gl_journal 
  (
    glj_entry_nbr serial not null ,
    glj_account integer,
    glj_prft_ctr smallint,
    glj_period smallint,
    glj_amount decimal(16,2),
    glj_flag char(1),
    glj_date date,
    glj_shift smallint,
    glj_batch integer
  );

revoke all on gl_journal from "public";



create table gl_jrnl_ar 
  (
    gljar_entry_nbr serial not null ,
    gljar_account integer,
    gljar_prft_ctr smallint,
    gljar_period smallint,
    gljar_amount decimal(16,2),
    gljar_flag char(1),
    gljar_invoice integer,
    gljar_tran_date date,
    gljar_customer integer
  );

revoke all on gl_jrnl_ar from "public";



create table gl_jrnl_fm 
  (
    gljfm_entry_nbr serial not null ,
    gljfm_account integer,
    gljfm_prft_ctr smallint,
    gljfm_period smallint,
    gljfm_amount decimal(16,2),
    gljfm_flag char(1),
    gljfm_movement integer,
    gljfm_bl_inv integer,
    gljfm_bi char(1),
    gljfm_trn_prodlnk integer,
    gljfm_tp char(1),
    gljfm_tran_date date
  );

revoke all on gl_jrnl_fm from "public";



create table gl_jrnl_text 
  (
    gljt_link integer,
    gljt_seq smallint,
    gljt_text char(70),
    gljt_src char(2)
  );

revoke all on gl_jrnl_text from "public";



create table gl_jrnl_ws 
  (
    gljws_entry_nbr serial not null ,
    gljws_account integer,
    gljws_period smallint,
    gljws_shl integer,
    gljws_amount decimal(16,2),
    gljws_flag char(1),
    gljws_invoice char(16),
    gljws_cust_vnd integer,
    gljws_cv_type char(1)
  );

revoke all on gl_jrnl_ws from "public";



create table gl_master 
  (
    glm_series char(5),
    glm_account integer,
    glm_prft_ctr smallint,
    glm_norm_bal char(1),
    glm_description char(30),
    glm_clear_to_acct integer,
    glm_clr_to_prft_ct smallint,
    glm_clear_lvl smallint,
    glm_group char(2),
    glm_amt_period0 decimal(16,2),
    glm_amt_period1 decimal(16,2),
    glm_amt_period2 decimal(16,2),
    glm_amt_period3 decimal(16,2),
    glm_amt_period4 decimal(16,2),
    glm_amt_period5 decimal(16,2),
    glm_amt_period6 decimal(16,2),
    glm_amt_period7 decimal(16,2),
    glm_amt_period8 decimal(16,2),
    glm_amt_period9 decimal(16,2),
    glm_amt_period10 decimal(16,2),
    glm_amt_period11 decimal(16,2),
    glm_amt_period12 decimal(16,2),
    glm_amt_period13 decimal(16,2),
    glm_amt_period14 decimal(16,2),
    glm_roll_account integer,
    glm_roll_level smallint,
    glm_rl_prft_ctr smallint
  );

revoke all on gl_master from "public";



create table gl_period 
  (
    glp_series char(5),
    glp_beg_dt date,
    glp_end_dt date,
    glp_refpd smallint,
    glp_glpd smallint,
    glp_status char(1),
    glp_rpt_bal char(1),
    glp_rpt_pl char(1),
    glp_rpt_ja char(1)
  );

revoke all on gl_period from "public";



create table inv_history 
  (
    ph_prft_ctr smallint,
    ph_prodlnk integer,
    ph_end_date date,
    ph_salesq decimal(10,2),
    ph_lostq decimal(8,2),
    ph_salesd decimal(12,2),
    ph_lostd decimal(10,2),
    ph_cogsd decimal(10,2),
    ph_qty_onhand decimal(10,2),
    ph_qty_consign decimal(10,2),
    ph_beg_price decimal(8,2),
    ph_beg_cost decimal(8,2)
  );

revoke all on inv_history from "public";



create table inv_rec_head 
  (
    po_num integer,
    po_vendor integer,
    po_date date,
    po_date_last date,
    po_freight decimal(8,2),
    po_carrier integer,
    po_frgt_bill char(10),
    po_rcvr char(16)
  );

revoke all on inv_rec_head from "public";



create table inv_secndloc 
  (
    sl_prft_ctr smallint,
    sl_prodlnk integer,
    sl_loc char(5),
    sl_bin char(5),
    sl_qty decimal(10,2),
    sl_max decimal(10,2),
    sl_lot_flag char(1)
  );

revoke all on inv_secndloc from "public";



create table p_checks 
  (
    pv_check_nbr integer,
    pv_check_vendor integer,
    pv_check_amount decimal(12,2),
    pv_check_paid char(1),
    pv_shl integer,
    pv_account char(17)
  );

revoke all on p_checks from "public";



create table p_class 
  (
    pcl_code char(5),
    pcl_desc char(30)
  );

revoke all on p_class from "public";



create table p_item_d 
  (
    pd_inv_lnk integer,
    pd_shl integer,
    pd_gl_nbr integer,
    pd_amt decimal(10,2),
    pd_dc_flag char(1),
    pd_mod_lvl smallint,
    pd_line smallint,
    pd_prft_ctr smallint
  );

revoke all on p_item_d from "public";



create table p_pay_d 
  (
    ppd_seq integer,
    ppd_shl integer,
    ppd_gl_acct integer,
    ppd_dc_flag char(1),
    ppd_amt decimal(10,2)
  );

revoke all on p_pay_d from "public";



create table rs_pumpcls 
  (
    rspc_class char(5),
    rspc_desc char(30)
  );

revoke all on rs_pumpcls from "public";



create table rs_scat 
  (
    rsc_shl integer,
    rsc_catagory char(4),
    rsc_amount decimal(10,2),
    rsc_retail decimal(8,2)
  );

revoke all on rs_scat from "public";



create table rs_shiftlink 
  (
    rssl_prft_ctr smallint,
    rssl_shift smallint,
    rssl_date date,
    rssl_shl serial not null 
  );

revoke all on rs_shiftlink from "public";



create table rs_summary 
  (
    rss_shl integer,
    rss_fuel_gal decimal(10,2),
    rss_fuel_dol decimal(10,2),
    rss_inside_dol decimal(10,2),
    rss_inside_cogs decimal(10,2),
    rss_ar_amount decimal(10,2),
    rss_ap_amount decimal(10,2),
    rss_cash_rec decimal(10,2),
    rss_cash_pay decimal(10,2),
    rss_cash_dep decimal(10,2),
    rss_cash_end decimal(10,2),
    rss_over_short decimal(10,2),
    rss_status char(1),
    rss_ap_entry char(1)
  );

revoke all on rs_summary from "public";



create table si_alt_addr 
  (
    ia_nbr integer,
    ia_alt_type char(1),
    ia_name_addr char(90)
  );

revoke all on si_alt_addr from "public";



create table si_inv_text 
  (
    idt_nbr integer,
    idt_line smallint,
    idt_seq smallint,
    idt_type char(1),
    idt_text char(40)
  );

revoke all on si_inv_text from "public";



create table sih_alt_addr 
  (
    iah_nbr integer,
    iah_alt_type char(1),
    iah_name_addr char(90)
  );

revoke all on sih_alt_addr from "public";



create table sih_batches 
  (
    ibh_batch_nbr integer,
    ibh_inv_nbr integer
  );

revoke all on sih_batches from "public";



create table sih_inv_text 
  (
    idth_nbr integer,
    idth_line smallint,
    idth_seq smallint,
    idth_type char(1),
    idth_text char(40)
  );

revoke all on sih_inv_text from "public";



create table sp_excpt_clas 
  (
    cce_cust integer,
    cce_product_cl char(5),
    cce_lvl smallint,
    cce_terms char(5)
  );

revoke all on sp_excpt_clas from "public";



create table sp_excpt_cust 
  (
    ce_cust integer,
    ce_prodlnk integer,
    ce_lvl smallint
  );

revoke all on sp_excpt_cust from "public";



create table sp_table 
  (
    pt_formula char(5),
    pt_lvl smallint,
    pt_quantity decimal(10,2),
    pt_desc char(50),
    pt_type char(1),
    pt_factor decimal(8,2),
    pt_operator char(1)
  );

revoke all on sp_table from "public";



create table sys_county 
  (
    c_code char(4),
    c_name char(30)
  );

revoke all on sys_county from "public";



create table tx_cust_prmt 
  (
    txcp_customer integer,
    txcp_trn integer,
    txcp_permit char(20),
    txcp_shw_permit char(1)
  );

revoke all on tx_cust_prmt from "public";



create table tx_customer 
  (
    ta_customer integer,
    ta_prodtcl char(5),
    ta_use_g char(8),
    ta_freq smallint,
    ta_in_price char(1),
    ta_on_invoice char(1),
    ta_show_separate char(1)
  );

revoke all on tx_customer from "public";



create table tx_use_g 
  (
    tu_use_g char(8),
    tu_prodtcl char(5),
    tu_description char(40),
    tu_link serial not null 
  );

revoke all on tx_use_g from "public";



create table tx_use_link 
  (
    tul_link integer,
    tul_trn integer,
    tul_sched char(5)
  );

revoke all on tx_use_link from "public";



create table si_nbr 
  (
    in_nbr integer
  );

revoke all on si_nbr from "public";



create table sys_state 
  (
    s_code char(2),
    s_name char(20),
    s_county_tax char(1),
    s_city_tax char(1)
  );

revoke all on sys_state from "public";



create table rs_taxes 
  (
    rstx_shl integer,
    rstx_prodlnk integer,
    rstx_trn integer,
    rstx_ulink integer,
    rstx_amount decimal(16,2),
    rstx_tunits decimal(16,2),
    rstx_tax_rate decimal(6,2)
  );

revoke all on rs_taxes from "public";



create table fm_movement 
  (
    fmm_movement integer,
    fmm_dispatch_flag char(2),
    fmm_carrier integer,
    fmm_car_trail char(10),
    fmm_driver integer,
    fmm_journal char(1),
    fmm_disp_print char(1)
  );

revoke all on fm_movement from "public";



create table inv_master 
  (
    invt_prft_ctr smallint,
    invt_prodlnk integer,
    invt_consignee char(1),
    invt_gl_sales integer,
    invt_gl_cost integer,
    invt_commissioned char(2),
    invt_inv_ctl char(1),
    invt_lot char(1),
    invt_price decimal(8,2),
    invt_cost decimal(8,2),
    invt_secndloc decimal(10,2),
    invt_consignor decimal(10,2),
    invt_rop decimal(8,2),
    invt_goal decimal(8,2),
    invt_onorder decimal(10,2),
    invt_ap_errors decimal(8,2),
    invt_formula char(5),
    invt_sales_mtdd decimal(12,2),
    invt_sales_mtdq decimal(10,2),
    invt_sales_ytdd decimal(14,2),
    invt_sales_ytdq decimal(12,2),
    invt_cost_mtdd decimal(10,2),
    invt_n_min decimal(8,2),
    invt_n_max decimal(10,2),
    invt_n_min_cost decimal(8,2),
    invt_n_max_cost decimal(8,2),
    invt_gl_invt integer,
    invt_cust_sernbr char(1),
    invt_trk_cust_qoh char(1)
  );

revoke all on inv_master from "public";



create table sys_lock 
  (
    lock_name char(8),
    lock_user char(8)
  );

revoke all on sys_lock from "public";



create table oe_comment 
  (
    oeco_customer integer,
    oeco_type char(1),
    oeco_order integer,
    oeco_seq smallint,
    oeco_text char(90)
  );

revoke all on oe_comment from "public";



create table fd_comment 
  (
    fdco_customer integer,
    fdco_type char(1),
    fdco_movement integer,
    fdco_seq smallint,
    fdco_text char(60)
  );

revoke all on fd_comment from "public";



create table inv_bilmat 
  (
    bm_prodlnk integer,
    bm_used_prodlnk integer,
    bm_qty decimal(8,2),
    bm_uom char(5),
    bm_subst char(1),
    bm_blend_type char(1)
  );

revoke all on inv_bilmat from "public";



create table si_comment 
  (
    ico_type char(1),
    ico_prodlnk integer,
    ico_seq integer,
    ico_text char(40)
  );

revoke all on si_comment from "public";



create table rs_cat_current 
  (
    rscc_prft_ctr smallint,
    rscc_catagory char(4),
    rscc_beg_cost decimal(16,2),
    rscc_beg_retail decimal(16,2)
  );

revoke all on rs_cat_current from "public";



create table si_certf 
  (
    iso_class char(5),
    iso_seq integer,
    iso_text char(40)
  );

revoke all on si_certf from "public";



create table gl_jrnl_rs 
  (
    gljrs_entry_nbr serial not null ,
    gljrs_account integer,
    gljrs_shl integer,
    gljrs_period smallint,
    gljrs_amount decimal(16,2),
    gljrs_flag char(1),
    gljrs_prft_ctr smallint,
    gljrs_shift smallint,
    gljrs_date date
  );

revoke all on gl_jrnl_rs from "public";



create table inv_counts 
  (
    ic_prft_ctr smallint,
    ic_prodlnk integer,
    ic_date date,
    ic_qty decimal(10,2),
    ic_location char(5),
    ic_measure char(10),
    ic_therm smallint,
    ic_link serial not null ,
    ic_type_ab char(1)
  );

revoke all on inv_counts from "public";



create table rs_cat_det 
  (
    rscd_catagory char(4),
    rscd_prft_ctr smallint,
    rscd_period smallint,
    rscd_totpur_whol decimal(12,2),
    rscd_totpur_retail decimal(12,2),
    rscd_begin_whol decimal(12,2),
    rscd_begin_retail decimal(12,2),
    rscd_totsales decimal(12,2)
  );

revoke all on rs_cat_det from "public";



create table inv_cost_hist 
  (
    ivch_prft_ctr smallint,
    ivch_prodlnk integer,
    ivch_gl_date date,
    ivch_new_avg_cost decimal(8,2),
    ivch_filing_date date,
    ivch_old_qty_oh decimal(10,2),
    ivch_old_avg_cost decimal(8,2),
    ivch_purch_qty decimal(8,2),
    ivch_purch_cost decimal(8,2),
    ivch_serial serial not null ,
    ivch_vendor integer,
    ivch_rcvr char(16)
  );

revoke all on inv_cost_hist from "public";



create table inv_header 
  (
    ivh_product char(16),
    ivh_link serial not null ,
    ivh_prodtcl char(5),
    ivh_print char(20),
    ivh_xref integer,
    ivh_desc char(40),
    ivh_class char(5),
    ivh_barcode char(15),
    ivh_uom_stock char(5),
    ivh_uom_sales char(5),
    ivh_uom_pricing char(5),
    ivh_brand char(10),
    ivh_uom_purch char(5),
    ivh_assoc_prodlnk integer,
    ivh_weight_item char(16),
    ivh_weight_stock char(16),
    ivh_active char(1),
    ivh_stocking char(1)
  );

revoke all on inv_header from "public";



create table inv_classes 
  (
    icl_code char(5),
    icl_type char(1),
    icl_desc char(30),
    icl_fuel_tax char(1),
    icl_fuel_group char(5)
  );

revoke all on inv_classes from "public";



create table ar_comment 
  (
    ac_customer integer,
    ac_date date,
    ac_seq smallint,
    ac_text char(60),
    ac_next_date date,
    ac_src char(2)
  );

revoke all on ar_comment from "public";



create table ar_openitem 
  (
    aroi_customer integer,
    aroi_invoice_nbr integer,
    aroi_seq_nbr smallint,
    aroi_source char(8)
  );

revoke all on ar_openitem from "public";



create table fm_tank 
  (
    tk_prft_ctr smallint,
    tk_num char(5),
    tk_length decimal(6,2),
    tk_diam decimal(6,2),
    tk_direction char(1),
    tk_capacity decimal(8,2),
    tk_dtlstchk date,
    tk_installed date,
    tk_tank_id char(8),
    tk_type char(10),
    tk_chkmeth char(10),
    tk_link_to char(5),
    tk_prodlnk integer,
    tk_strt_date date
  );

revoke all on fm_tank from "public";



create table inv_uom 
  (
    inu_code char(5),
    inu_desc char(30),
    inu_rnd smallint
  );

revoke all on inv_uom from "public";



create table rs_altcat_marg 
  (
    rsam_prft_ctr smallint,
    rsam_cat char(4),
    rsam_margin decimal(16,2)
  );

revoke all on rs_altcat_marg from "public";



create table p_altname 
  (
    pn_alt integer,
    pn_vendor integer,
    pn_name_addr char(180),
    pn_city char(4),
    pn_state char(2),
    pn_phone char(14),
    pn_zip_code char(10),
    pn_name char(30),
    pn_first_name char(30),
    pn_company char(30),
    pn_attn_line char(30),
    pn_addr1 char(30),
    pn_addr2 char(30),
    pn_email_address char(80)
  );

revoke all on p_altname from "public";



create table inv_sls_cstlr 
  (
    sclr_prft_ctr smallint not null ,
    sclr_prodlnk integer not null ,
    sclr_sls_lyr integer not null ,
    sclr_type char(1) not null ,
    sclr_sls_date date not null ,
    sclr_unit_cost decimal(8,2) not null ,
    sclr_qty decimal(10,2) not null ,
    sclr_pur_lyr integer not null ,
    sclr_serial integer not null ,
    sclr_unique serial not null 
  );

revoke all on inv_sls_cstlr from "public";



create table fm_purch_term 
  (
    fmpt_terminal smallint,
    fmpt_vendor integer,
    fmpt_prodlnk integer,
    fmpt_use_g char(8),
    fmpt_terms char(5),
    fmpt_ngu char(1),
    fmpt_date date,
    fmpt_time char(5),
    fmpt_cost decimal(8,2),
    fmpt_super_fund decimal(7,5)
  );

revoke all on fm_purch_term from "public";



create table p_payment 
  (
    pp_inv_lnk integer,
    pp_seq serial not null ,
    pp_due_dt date,
    pp_disc date,
    pp_amt_sch decimal(10,2),
    pp_amt_disc decimal(10,2),
    pp_check_nbr integer,
    pp_shl integer,
    pp_cash_amt decimal(10,2),
    pp_gl_cash_acct integer,
    pp_gl_ap_acct integer,
    pp_ap_amt decimal(10,2),
    pp_check_acct char(17),
    pp_check_draft char(1),
    pp_date_entered date,
    pp_date_paid date
  );

revoke all on p_payment from "public";



create table iq_salesman_name 
  (
    iqsn_code char(4) not null ,
    iqsn_name char(35) not null ,
    iqsn_userlogin char(10)
  );

revoke all on iq_salesman_name from "public";



create table p_vendor 
  (
    pm_vendor integer,
    pm_status char(1),
    pm_fed_id char(11),
    pm_std_disc_term char(5),
    pm_hist_lvl smallint,
    pm_credit_limit decimal(10,2),
    pm_1099 char(1),
    pm_blanket_po integer,
    pm_bpo_exp_date date,
    pm_last_date date,
    pm_last_amt decimal(10,2),
    pm_last_p_date date,
    pm_last_p_amt decimal(10,2),
    pm_last_p_check integer,
    pm_date_opened date,
    pm_ytd_purch decimal(12,2),
    pm_ytd_disc decimal(12,2),
    pm_curr_bal decimal(12,2),
    pm_class char(5),
    pm_remit_lead smallint,
    pm_price_book char(1),
    pm_deliv_lead smallint
  );

revoke all on p_vendor from "public";



create table rs_b_mass_upd 
  (
    rsbmu_vendor integer,
    rsbmu_zone integer,
    rsbmu_subzone integer,
    rsbmu_sales_grp integer,
    rsbmu_sales_sub integer,
    rsbmu_chg_type char(2),
    rsbmu_start_date date,
    rsbmu_end_date date,
    rsbmu_cost decimal(8,2),
    rsbmu_single decimal(8,2),
    rsbmu_multi decimal(8,2),
    rsbmu_case decimal(8,2),
    rsbmu_retail decimal(8,2),
    rsbmu_discount decimal(8,2),
    rsbmu_chg_date timestamp(5),
    rsbmu_user char(16)
  );

revoke all on rs_b_mass_upd from "public";



create table fd_order 
  (
    fdo_nbr integer,
    fdo_ship_date date,
    fdo_prft_ctr smallint,
    fdo_ie char(1),
    fdo_dest_code integer,
    fdo_carrier integer,
    fdo_po_nbr char(12),
    fdo_release char(12),
    fdo_status char(1),
    fdo_thru_date date,
    fdo_hold_stat char(1),
    fdo_user_name char(8),
    fdo_hold_date date,
    fdo_movement integer,
    fdo_ship_time char(11),
    fdo_alt_name char(20),
    fdo_alt_phone char(20),
    fdo_time_stamp timestamp,
    fdo_disp_print char(1)
  );

revoke all on fd_order from "public";



create table ar_cust_aging 
  (
    ara_customer integer,
    ara_current_lbl char(20),
    ara_current_amt decimal(16,2),
    ara_30_lbl char(20),
    ara_30_amt decimal(16,2),
    ara_60_lbl char(20),
    ara_60_amt decimal(16,2),
    ara_90_lbl char(20),
    ara_90_amt decimal(16,2),
    ara_fc_lbl char(20),
    ara_fc_amt decimal(16,2),
    ara_budget_lbl char(20),
    ara_budget_amt decimal(16,2),
    ara_current_bal decimal(16,2),
    ara_beg_bal decimal(16,2),
    ara_open_credit decimal(16,2),
    ara_status char(1),
    ara_msg char(100),
    ara_date date,
    ara_time char(8)
  );

revoke all on ar_cust_aging from "public";



create table ar_ach_entries 
  (
    aae_pc_cust integer,
    aae_pc_cust_flag char(1),
    aae_inv_gl_nbr integer,
    aae_glp_seq_nbr smallint,
    aae_dc_tran_type char(2),
    aae_tran_dt date,
    aae_amount decimal(16,2),
    aae_credits decimal(16,2),
    aae_due_dt date,
    aae_disc_date date,
    aae_disc_amt decimal(8,2),
    aae_shift_link integer,
    aae_gl_acct_from integer,
    aae_gl_acct_to integer,
    aae_extract_dt date,
    aae_status char(1),
    aae_create_dt date,
    aae_create_time char(8),
    aae_file_mod char(1),
    aae_ach_batch_nbr integer,
    aae_trace_nbr char(15),
    aae_ach_amount decimal(10,2),
    aae_rcv_dfi_id char(8),
    aae_dfi_account char(17),
    aae_ret_datetime timestamp,
    aae_ret_code1 char(3),
    aae_ret_code2 char(3),
    aae_ret_code3 char(3),
    aae_new_gl_invoice integer,
    aae_pay_seq_gl integer,
    aae_ach_test_flag char(1),
    aae_batch_nbr integer,
    aae_ref_nbr integer,
    aae_draft_date date
  );

revoke all on ar_ach_entries from "public";



create table sys_terms 
  (
    term_code char(5),
    term_due_operator char(1),
    term_due_date_days smallint,
    term_disc_operator char(1),
    term_disc_date_day smallint,
    term_disc_percent decimal(8,2),
    term_desc char(30),
    term_nbr_pmnt smallint
  );

revoke all on sys_terms from "public";



create table ar_customer 
  (
    cust_customer integer,
    cust_status char(2),
    cust_cur_bal decimal(12,2),
    cust_ballststmt decimal(12,2),
    cust_lvl smallint,
    cust_pricefactor smallint,
    cust_terms char(5),
    cust_budg_payment decimal(6,2),
    cust_credit_line decimal(10,2),
    cust_salesman char(4),
    cust_fnc_code char(4),
    cust_bkord_flag char(1),
    cust_hi_dunning smallint,
    cust_lst_dunning smallint,
    cust_open_dt date,
    cust_avg_days smallint,
    cust_bank char(20),
    cust_acct_nbr char(17),
    cust_bad_chks smallint,
    cust_last_sale_dat date,
    cust_last_sale_amt decimal(10,2),
    cust_last_pmt_amt decimal(10,2),
    cust_last_pmt_date date,
    cust_cust_class char(5),
    cust_ytd_sales decimal(12,2),
    cust_times_late smallint,
    cust_ytd_disc decimal(8,2),
    cust_ar_grace_days smallint,
    cust_lst_bad_ck_dt date,
    cust_stmt_cycle smallint,
    cust_ytd_fnc decimal(8,2),
    cust_ngu char(1),
    cust_fo_season smallint,
    cust_int_rate decimal(6,2),
    cust_ytd_int decimal(6,2),
    cust_days_pay integer,
    cust_invoice_flag char(1),
    cust_inv_filefmt char(1),
    cust_ach_flag char(1),
    cust_fax_number char(20),
    cust_modem_number char(20),
    cust_fax_to_name char(30),
    cust_email_address char(80),
    cust_co_edi_id char(15),
    cust_file_prefix char(10),
    cust_ftp_server char(30),
    cust_ftp_path char(40),
    cust_ftp_login char(20),
    cust_ftp_password char(20),
    cust_sav_chk_flag char(1),
    cust_aba_routing char(9),
    cust_ach_test_flag char(1),
    cust_reason_code char(2),
    cust_reason_date date
  );

revoke all on ar_customer from "public";



create table rs_cat 
  (
    rsct_catagory char(4),
    rsct_description char(40),
    rsct_gl_sales integer,
    rsct_gl_cogs integer,
    rsct_gl_invt integer,
    rsct_type char(1),
    rsct_dept smallint,
    rsct_tax_flag char(1),
    rsct_invt_method char(1) 
        default 'C'
  );

revoke all on rs_cat from "public";



create table fm_carrier 
  (
    fmrr_nbr integer,
    fmrr_icc char(10),
    fmrr_ins_cert char(10),
    fmrr_ins_agent char(30),
    fmrr_who char(1),
    fmrr_trans_mode char(10),
    fmrr_ticket_flag char(1),
    fmrr_fax_number char(20),
    fmrr_modem_number char(20),
    fmrr_fax_to_name char(30),
    fmrr_email_address char(30),
    fmrr_co_edi_id char(15),
    fmrr_file_prefix char(10),
    fmrr_ftp_server char(30),
    fmrr_ftp_path char(40),
    fmrr_ftp_login char(20),
    fmrr_ftp_password char(20),
    fmrr_cargo_vesl smallint
  );

revoke all on fm_carrier from "public";



create table fm_freight 
  (
    fmf_origin smallint,
    fmf_dest integer,
    fmf_type char(1),
    fmf_code char(8),
    fmf_miles_sd smallint
  );

revoke all on fm_freight from "public";



create table sys_bank_acct 
  (
    aba_rout char(9),
    bnk_acct char(17),
    bnk_acct_lnk serial not null ,
    bnk_name char(22),
    acct_desc char(30),
    gl_bank_acct integer,
    gl_ap_acct integer,
    gl_disc_acct integer,
    sav_chk_flag char(1),
    prft_ctr integer,
    eft_protocol char(5),
    eft_username char(20),
    eft_password char(20),
    eft_host char(40)
  );

revoke all on sys_bank_acct from "public";



create table co_company_name 
  (
    con_name char(30),
    con_attn char(30),
    con_addr1 char(30),
    con_addr2 char(30),
    con_zip_code char(10),
    con_phone char(14),
    con_phone2 char(14),
    con_email_address char(30),
    con_fax_path char(40),
    con_db_path char(40),
    con_ach_return char(1),
    con_ach_origin_id char(10),
    con_bnk_acct_lnk integer,
    con_phone_descr char(14),
    con_phone2_descr char(14)
  );

revoke all on co_company_name from "public";



create table rs_b_price_change 
  (
    rsbpc_bk_lnk integer,
    rsbpc_ic_lnk integer,
    rsbpc_date date,
    rsbpc_cost decimal(8,2),
    rsbpc_retail decimal(8,2),
    rsbpc_promo char(1),
    rsbpc_vend_disc decimal(8,2),
    rsbpc_multi_price decimal(8,2),
    rsbpc_case_price decimal(8,2),
    rsbpc_ent_retail decimal(8,2),
    rsbpc_ending_date date,
    rsbpc_serial integer,
    rsbpc_user_id char(8),
    rsbpc_action char(1),
    rsbpc_date_chg date,
    rsbpc_time_chg char(8)
  );

revoke all on rs_b_price_change from "public";



create table ar_altname 
  (
    an_customer integer,
    an_cust integer,
    an_name_addr char(180),
    an_city char(4),
    an_phone char(14),
    an_priority char(1),
    an_freight char(1),
    an_zip_code char(10),
    an_print_price char(1),
    an_cust_po char(24),
    an_phone2 char(14),
    an_name char(30),
    an_first_name char(30),
    an_company char(30),
    an_attn_line char(30),
    an_addr1 char(30),
    an_addr2 char(30),
    an_extension char(5),
    an_extension2 char(5),
    an_active char(1),
    an_active_chg_dat date,
    an_last_sale_dat date
  );

revoke all on ar_altname from "public";



create table fm_delivery 
  (
    fmd_movement integer,
    fmd_invoice integer,
    fmd_date date,
    fmd_dest_code integer,
    fmd_dest_flag char(1),
    fmd_net decimal(8,2),
    fmd_gross decimal(8,2),
    fmd_prft_ctr smallint,
    fmd_po_nbr char(24),
    fmd_release char(12)
  );

revoke all on fm_delivery from "public";



create table si_invoice 
  (
    ih_nbr integer,
    ih_seq smallint,
    ih_cust integer,
    ih_prft_ctr smallint,
    ih_shift_link integer,
    ih_shipto integer,
    ih_billto integer,
    ih_date date,
    ih_ship_date date,
    ih_salesman char(4),
    ih_inv_status char(1),
    ih_pmnt_type char(1),
    ih_how_shipped char(5),
    ih_terms char(5),
    ih_freight decimal(8,2),
    ih_srchg decimal(8,2),
    ih_mfg_ext char(1),
    ih_total_tax decimal(10,2),
    ih_total_price decimal(10,2),
    ih_bkord_flag char(1),
    ih_print_flag char(1),
    ih_total_cost decimal(10,2),
    ih_cust_po char(24),
    ih_oper char(8),
    ih_order_nbr integer,
    ih_cust_rel char(12),
    ih_entry_date date
  );

revoke all on si_invoice from "public";



create table sih_invoice 
  (
    ihh_nbr integer,
    ihh_seq smallint,
    ihh_cust integer,
    ihh_prft_ctr smallint,
    ihh_shift_link integer,
    ihh_shipto integer,
    ihh_billto integer,
    ihh_date date,
    ihh_ship_date date,
    ihh_salesman char(4),
    ihh_inv_status char(1),
    ihh_pmnt_type char(1),
    ihh_how_shipped char(5),
    ihh_terms char(5),
    ihh_freight decimal(8,2),
    ihh_srchg decimal(8,2),
    ihh_mfg_ext char(1),
    ihh_total_tax decimal(10,2),
    ihh_total_price decimal(10,2),
    ihh_bkord_flag char(1),
    ihh_print_flag char(1),
    ihh_total_cost decimal(10,2),
    ihh_cust_po char(24),
    ihh_oper char(8),
    ihh_order_nbr integer,
    ihh_cust_rel char(12),
    ihh_entry_date date
  );

revoke all on sih_invoice from "public";



create table rs_purcline 
  (
    rsl_shl integer,
    rsl_vendor integer,
    rsl_inv_nbr char(16),
    rsl_line_num smallint,
    rsl_count decimal(8,2),
    rsl_cost decimal(8,2),
    rsl_retail decimal(8,2),
    rsl_ext_cost decimal(8,2),
    rsl_ext_retail decimal(8,2),
    rsl_cat char(4),
    rsl_prodlnk integer,
    rsl_pblnk integer,
    rsl_grp_nbr integer
  );

revoke all on rs_purcline from "public";



create table rs_purch 
  (
    rsh_shl integer,
    rsh_vendor integer,
    rsh_inv_nbr char(16),
    rsh_pay_meth char(5),
    rsh_inv_amt decimal(8,2)
  );

revoke all on rs_purch from "public";



create table p_item 
  (
    ph_vendor integer,
    ph_invoice char(16),
    ph_lnk serial not null ,
    ph_shl integer,
    ph_inv_dt date,
    ph_inv_amt decimal(10,2),
    ph_paid_amt decimal(10,2),
    ph_adj_amt decimal(10,2),
    ph_terms char(5),
    ph_type char(1),
    ph_ext_nbr char(10),
    ph_print_flag char(1),
    ph_comment char(50),
    ph_status char(1)
  );

revoke all on p_item from "public";



create table p_nbr 
  (
    pno_vendor integer,
    pno_invoice char(16),
    pno_lnk integer
  );

revoke all on p_nbr from "public";



create table p_openitem 
  (
    poi_vendor integer,
    poi_invoice char(16),
    poi_itm_lnk integer,
    poi_inv_dt date,
    poi_inv_amt decimal(10,2),
    poi_pay_lnk integer,
    poi_due_dt date,
    poi_disc_dt date,
    poi_amt_sch decimal(10,2),
    poi_amt_disc decimal(10,2),
    poi_prft_ctr smallint,
    poi_status char(1)
  );

revoke all on p_openitem from "public";



create table gl_jrnl_ap 
  (
    gljap_entry_nbr serial not null ,
    gljap_account integer,
    gljap_period smallint,
    gljap_shl integer,
    gljap_amount decimal(16,2),
    gljap_flag char(1),
    gljap_invoice integer,
    gljap_pp_seq integer,
    gljap_vendor integer,
    gljap_prft_ctr smallint,
    gljap_invoice_nbr char(16),
    gljap_date date
  );

revoke all on gl_jrnl_ap from "public";



create table rs_daily 
  (
    rsd_shl integer,
    rsd_prft_ctr smallint,
    rsd_date date,
    rsd_shift smallint,
    rsd_pumpnum smallint,
    rsd_pumpseq smallint,
    rsd_gal decimal(10,2),
    rsd_dol decimal(10,2),
    rsd_prodlnk integer,
    rsd_tank char(5),
    rsd_blnd_pumpnum smallint,
    rsd_blnd_pumpseq smallint,
    rsd_blnd_prodlnk integer,
    rsd_blnd_class char(5),
    rsd_use_g char(8),
    rsd_serial serial not null 
  );

revoke all on rs_daily from "public";



create table p_ach 
  (
    vendor integer,
    bank char(20),
    acct_nbr char(17),
    aba_routing char(9),
    sav_chk_flag char(1),
    addenda char(50)
  );

revoke all on p_ach from "public";



create table p_ach_sent 
  (
    vendor integer,
    check_nbr integer,
    bnk_acct char(17),
    effdate date,
    amount decimal(12,2),
    addenda char(50)
  );

revoke all on p_ach_sent from "public";



create table p_selection 
  (
    ps_pay_seq integer not null ,
    ps_user_id char(8),
    ps_print_group char(8),
    ps_amt_sch decimal(10,2),
    ps_vendor integer,
    ps_ph_lnk integer,
    ps_amt_disc decimal(10,2),
    ps_disc_date date,
    ps_invoice char(12),
    ps_inv_amt decimal(10,2),
    ps_paid_amt decimal(10,2),
    ps_due_dt date,
    ps_new_amt decimal(10,2),
    ps_new_status char(1),
    ps_inv_dt date
  );

revoke all on p_selection from "public";



create table rs_b_mix 
  (
    promo_id serial not null ,
    zone integer,
    descr char(40),
    item_list_id integer,
    start_date date,
    stop_date date,
    units integer,
    promo_type char(2),
    promo_amt decimal(12,2)
  );

revoke all on rs_b_mix from "public";



create table rs_sls_grp 
  (
    rssg_sls_grp integer not null ,
    rssg_cat char(4),
    rssg_desc char(30) not null 
  );

revoke all on rs_sls_grp from "public";



create table rs_pos_tax 
  (
    id integer,
    sales_amt decimal(12,2),
    coll_amt decimal(12,2),
    trans_lnk integer
  );

revoke all on rs_pos_tax from "public";



create table rs_pos_tender 
  (
    code char(25),
    amount decimal(12,2),
    chg_flag char(1),
    account_id char(40),
    account_name char(40),
    trans_lnk integer
  );

revoke all on rs_pos_tender from "public";



create table rs_pos_lnk 
  (
    ctr integer,
    cashier char(12),
    outside_sale char(1),
    trans_id integer,
    register_id smallint,
    business_dt date,
    rec_time char(8),
    trans_lnk serial not null 
  );

revoke all on rs_pos_lnk from "public";



create table rs_b_purch 
  (
    vendor integer,
    ctr integer,
    inv_date date,
    eft_date date,
    invnbr char(16),
    invamt decimal(12,2),
    invlnk serial not null 
  );

revoke all on rs_b_purch from "public";



create table rs_b_purline 
  (
    invlnk integer,
    line smallint,
    prodnum char(10),
    qty integer,
    unit_cost decimal(12,2),
    uom char(10),
    upc char(15),
    prod_desc char(30),
    adj_amt decimal(12,2),
    ext_price decimal(12,2)
  );

revoke all on rs_b_purline from "public";



create table rs_b_item 
  (
    rsbi_vendor integer,
    rsbi_code char(15),
    rsbi_desc char(30),
    rsbi_stock_unit char(7),
    rsbi_group char(3),
    rsbi_seq integer,
    rsbi_cat char(4),
    rsbi_upc char(15),
    rsbi_recv_flag char(1),
    rsbi_send_to_reg char(1),
    rsbi_grp_nbr integer,
    rsbi_margin decimal(8,2),
    rsbi_ic_lnk serial not null ,
    rsbi_ic_mst integer,
    rsbi_packing char(7),
    rsbi_dept integer,
    rsbi_sls_grp integer,
    rsbi_sls_subgrp integer,
    rsbi_scantype char(1),
    rsbi_flag01 char(1),
    rsbi_flag02 char(1),
    rsbi_flag03 char(1),
    rsbi_flag04 char(1),
    rsbi_flag05 char(1),
    rsbi_flag06 char(1),
    rsbi_flag07 char(1),
    rsbi_active char(1),
    rsbi_upc_single char(15),
    rsbi_upc_multi char(15),
    rsbi_upc_case char(15),
    rsbi_single_desc char(18),
    rsbi_multi_desc char(18),
    rsbi_case_desc char(18),
    rsbi_sku_single char(5),
    rsbi_sku_multi char(5),
    rsbi_sku_case char(5),
    rsbi_btm_lvl char(1),
    rsbi_linked_itm char(15),
    rsbi_user char(8),
    rsbi_date_stamp date
  );

revoke all on rs_b_item from "public";



create table rs_b_price 
  (
    rsbp_bk_lnk integer,
    rsbp_date date,
    rsbp_cost decimal(8,2),
    rsbp_retail decimal(8,2),
    rsbp_promo char(1),
    rsbp_act char(1),
    rsbp_status char(1),
    rsbp_vend_disc decimal(8,2),
    rsbp_qty integer,
    rsbp_multi_price decimal(8,2),
    rsbp_case_price decimal(8,2),
    rsbp_ent_retail decimal(8,2),
    rsbp_ending_date date,
    rsbp_serial serial not null ,
    rsbp_reason char(5),
    rsbp_user char(8),
    rsbp_date_stamp date
  );

revoke all on rs_b_price from "public";



create table rs_b_exclude 
  (
    dept integer
  );

revoke all on rs_b_exclude from "public";



create table rs_b_hold_delete 
  (
    item_list_id integer,
    poscode_lnk integer
  );

revoke all on rs_b_hold_delete from "public";



create table menu_field 
  (
    menucode char(3),
    itemdesc char(27),
    exectype char(1),
    execline char(40),
    itemgrp char(2),
    itemlink serial not null 
  );

revoke all on menu_field from "public";



create table menu_secure 
  (
    itemlink integer,
    usercode char(10)
  );

revoke all on menu_secure from "public";



create table menu_head 
  (
    menucode char(3),
    title char(50),
    prevmenu char(3)
  );

revoke all on menu_head from "public";



create table sys_parm 
  (
    parm_nbr smallint,
    parm_field char(30),
    parm_desc char(30)
  );

revoke all on sys_parm from "public";



create table p_mchk 
  (
    vendor integer,
    chkno integer,
    chkdate date,
    chkamount decimal(10,2)
  );

revoke all on p_mchk from "public";



create table p_dchk 
  (
    vendor integer,
    invoice char(16),
    itm_lnk integer,
    pay_lnk integer,
    invdate date,
    duedate date,
    discdate date,
    payamount decimal(10,2),
    discountamount decimal(10,2),
    netamount decimal(10,2)
  );

revoke all on p_dchk from "public";



create table pymgrp 
  (
    paygroup char(2),
    description char(20),
    payperiods smallint
  );

revoke all on pymgrp from "public";



create table pyiemp 
  (
    empno char(6),
    recno serial not null ,
    relationship char(1),
    lastname char(25),
    middlename char(1),
    firstname char(16),
    birthdate date,
    ssn char(11),
    ins_medical char(1),
    ins_dental char(1)
  );

revoke all on pyiemp from "public";



create table pympto 
  (
    ptocode char(3),
    description char(25),
    cycledateflag char(1),
    refdateflag char(1),
    carryoverflag char(1),
    rateunit char(1),
    frequency char(1),
    time1 smallint,
    rate1 decimal(16,2),
    maxcarryover1 decimal(16,2),
    maxaccrual1 decimal(16,2),
    maxavail1 decimal(16,2),
    time2 smallint,
    rate2 decimal(16,2),
    maxcarryover2 decimal(16,2),
    maxaccrual2 decimal(16,2),
    maxavail2 decimal(16,2),
    time3 smallint,
    rate3 decimal(16,2),
    maxcarryover3 decimal(16,2),
    maxaccrual3 decimal(16,2),
    maxavail3 decimal(16,2),
    time4 smallint,
    rate4 decimal(16,2),
    maxcarryover4 decimal(16,2),
    maxaccrual4 decimal(16,2),
    maxavail4 decimal(16,2),
    time5 smallint,
    rate5 decimal(16,2),
    maxcarryover5 decimal(16,2),
    maxaccrual5 decimal(16,2),
    maxavail5 decimal(16,2)
  );

revoke all on pympto from "public";



create table sys_zip 
  (
    zip_code char(10),
    city char(30),
    county char(4),
    state char(2),
    country char(3)
  );

revoke all on sys_zip from "public";



create table gl_jrnl_py 
  (
    entry_nbr serial not null ,
    account integer,
    period smallint,
    prft_ctr smallint,
    trandate date,
    amount decimal(16,2),
    flag char(1),
    chk_lnk integer
  );

revoke all on gl_jrnl_py from "public";



create table pyhchk 
  (
    empno char(6),
    recno serial not null ,
    deductperiod smallint,
    paybegin date,
    payend date,
    chkno integer,
    trandate date,
    chkamt decimal(16,2),
    prft_ctr integer,
    bank_acct char(17)
  );

revoke all on pyhchk from "public";



create table pympto_earn 
  (
    ptocode char(3),
    earncode char(4),
    plan_type char(1)
  );

revoke all on pympto_earn from "public";



create table pyichk 
  (
    recno integer,
    paycode char(4),
    paytype char(1),
    payauthority char(4),
    payunits decimal(16,2),
    payamount decimal(16,2),
    taxable decimal(16,2)
  );

revoke all on pyichk from "public";



create table pyttax 
  (
    taxauthority char(4),
    taxcode char(4),
    taxstatus char(1),
    statusdescription char(25),
    allowance decimal(16,2),
    allowance2 decimal(16,2),
    base1 decimal(16,2),
    percent1 decimal(16,2),
    over1 decimal(16,2),
    base2 decimal(16,2),
    percent2 decimal(16,2),
    over2 decimal(16,2),
    base3 decimal(16,2),
    percent3 decimal(16,2),
    over3 decimal(16,2),
    base4 decimal(16,2),
    percent4 decimal(16,2),
    over4 decimal(16,2),
    base5 decimal(16,2),
    percent5 decimal(16,2),
    over5 decimal(16,2),
    base6 decimal(16,2),
    percent6 decimal(16,2),
    over6 decimal(16,2),
    base7 decimal(16,2),
    percent7 decimal(16,2),
    over7 decimal(16,2),
    base8 decimal(16,2),
    percent8 decimal(16,2),
    over8 decimal(16,2),
    base9 decimal(16,2),
    percent9 decimal(16,2),
    over9 decimal(16,2),
    base10 decimal(16,2),
    percent10 decimal(16,2),
    over10 decimal(16,2),
    base11 decimal(16,2),
    percent11 decimal(16,2),
    over11 decimal(16,2),
    base12 decimal(16,2),
    percent12 decimal(16,2),
    over12 decimal(16,2),
    base13 decimal(16,2),
    percent13 decimal(16,2),
    over13 decimal(16,2),
    base14 decimal(16,2),
    percent14 decimal(16,2),
    over14 decimal(16,2),
    base15 decimal(16,2),
    percent15 decimal(16,2),
    over15 decimal(16,2),
    base16 decimal(16,2),
    percent16 decimal(16,2),
    over16 decimal(16,2)
  );

revoke all on pyttax from "public";



create table co_rpt_ctl 
  (
    corc_rpt_num serial not null ,
    corc_rpt_name char(15),
    corc_where_part char(600),
    corc_who char(10),
    corc_sort smallint,
    corc_sel_page smallint,
    corc_lp_name char(10),
    corc_paper_tray smallint,
    corc_copies smallint
  );

revoke all on co_rpt_ctl from "public";



create table fm_delvr_d 
  (
    fmdd_movement integer,
    fmdd_invoice integer,
    fmdd_dt_seq_nbr smallint,
    fmdd_prodlnk integer,
    fmdd_net decimal(8,2),
    fmdd_gross decimal(8,2),
    fmdd_cost decimal(16,5),
    fmdd_freight decimal(16,5),
    fmdd_srchg decimal(8,2),
    fmdd_frgt_inv integer,
    fmdd_price decimal(16,5),
    fmdd_location char(5),
    fmdd_ngu char(1),
    fmdd_serial serial not null 
  );

revoke all on fm_delvr_d from "public";



create table fd_delivery 
  (
    fdd_nbr integer,
    fdd_line integer,
    fdd_prodlnk integer,
    fdd_qty integer,
    fdd_price decimal(16,5),
    fdd_location char(5),
    fdd_man_price char(1),
    fdd_have_prods char(1),
    fdd_cur_blend integer
  );

revoke all on fd_delivery from "public";



create table inv_pur_cstlr 
  (
    pclr_prft_ctr smallint not null ,
    pclr_prodlnk integer not null ,
    pclr_pur_lyr integer not null ,
    pclr_movement integer not null ,
    pclr_lad_del integer not null ,
    pclr_type char(1) not null ,
    pclr_fill_close date not null ,
    pclr_unit_cost decimal(16,5),
    pclr_qty decimal(10,2) not null ,
    pclr_rem_qty decimal(10,2) not null ,
    pclr_serial integer not null ,
    pclr_unique serial not null 
  );

revoke all on inv_pur_cstlr from "public";



create table fm_cost 
  (
    fmc_terminal integer,
    fmc_vendor integer,
    fmc_date date,
    fmc_time char(5),
    fmc_prodlnk integer,
    fmc_cost decimal(16,5)
  );

revoke all on fm_cost from "public";



create table fm_frgt_cd 
  (
    fmfc_code char(8),
    fmfc_vendor integer,
    fmfc_prod_class char(5),
    fmfc_date_start date,
    fmfc_date_end date,
    fmfc_frgt_in decimal(16,5),
    fmfc_srchg_in decimal(8,2),
    fmfc_frgt_out decimal(16,5),
    fmfc_srchg_out decimal(8,2),
    fmfc_description char(30),
    fmfc_type_in char(1),
    fmfc_type_out char(1),
    fmfc_dvr_flag char(1),
    fmfc_dvr_pay decimal(10,2)
  );

revoke all on fm_frgt_cd from "public";



create table sys_prft_ctr 
  (
    prft_ctr smallint,
    prft_name char(40),
    prft_zip_code char(9),
    prft_lvl smallint,
    prft_terms char(5),
    prft_use_g char(8),
    prft_posted_date date,
    prft_posted_shift smallint,
    prft_proc_date date,
    prft_proc_shift smallint,
    prft_week_mon smallint,
    prft_week_tue smallint,
    prft_week_wed smallint,
    prft_week_thu smallint,
    prft_week_fri smallint,
    prft_week_sat smallint,
    prft_week_sun smallint,
    prft_freq_map char(1),
    prft_type char(1),
    prft_readings char(1),
    prft_unit char(1),
    prft_uqnty char(1),
    prft_owner char(1),
    prft_fuel char(1),
    prft_addr1 char(30),
    prft_addr2 char(30),
    prft_addr3 char(30),
    prft_cstore char(1),
    prft_con_key char(20),
    prft_car_wash char(1),
    prft_phone char(20),
    prft_reg_type char(2),
    prft_cash_acnt integer,
    prft_ach_flag char(1),
    prft_fax_number char(20),
    prft_modem_number char(20),
    prft_fax_to_name char(30),
    prft_email_address char(30),
    prft_fax_path char(40),
    prft_db_path char(40),
    prft_file_prefix char(10),
    prft_ftp_path char(40),
    prft_ftp_login char(20),
    prft_ftp_password char(20),
    prft_ach_test_flag char(1),
    prft_bnk_acct_lnk integer
  );

revoke all on sys_prft_ctr from "public";



create table rs_b_vnd_xref 
  (
    edi_vendor char(40),
    alt_vendor integer
  );

revoke all on rs_b_vnd_xref from "public";



create table pydemp 
  (
    empno char(6),
    recno serial not null ,
    deductcode char(4),
    deductperiods char(12),
    amounttype char(1),
    amount decimal(16,2),
    maxamount decimal(16,2),
    paid decimal(16,2),
    startdate date,
    enddate date,
    bankaba char(9),
    bankaccount char(17),
    banktype char(1),
    bankmodifydate date
  );

revoke all on pydemp from "public";



create table rs_pump 
  (
    rspf_prft_ctr smallint,
    rspf_pumpnum smallint,
    rspf_pumpseq smallint,
    rspf_make char(10),
    rspf_model char(10),
    rspf_pos_xref char(3),
    rspf_uo_measure char(5),
    rspf_unit_fraction decimal(8,2),
    rspf_class char(5),
    rspf_cur_price decimal(8,4),
    rspf_serial_nbr char(20),
    rspf_prodlnk integer,
    rspf_tank_nbr char(5),
    rspf_use_g char(8),
    rspf_roll_gal decimal(12,2),
    rspf_roll_dol decimal(12,2),
    rspf_last_gal decimal(14,2),
    rspf_last_dol decimal(14,2),
    rspf_last_price decimal(8,4),
    rspf_blend char(1),
    rspf_blnd_pumpnum1 smallint,
    rspf_blnd_pumpseq1 smallint,
    rspf_blnd_perc1 smallint,
    rspf_blnd_pumpnum2 smallint,
    rspf_blnd_pumpseq2 smallint,
    rspf_blnd_perc2 smallint,
    rspf_blnd_pumpnum3 smallint,
    rspf_blnd_pumpseq3 smallint,
    rspf_blnd_perc3 smallint
  );

revoke all on rs_pump from "public";



create table rs_gl_hdr 
  (
    account integer,
    sort smallint,
    taxcode integer
  );

revoke all on rs_gl_hdr from "public";



create table rs_gl_det 
  (
    account integer,
    tendercode char(40)
  );

revoke all on rs_gl_det from "public";



create table rs_pos_payout 
  (
    acct_id char(40),
    acct_name char(40),
    amount decimal(12,2),
    trans_lnk integer
  );

revoke all on rs_pos_payout from "public";



create table rs_pos_promo 
  (
    id integer,
    poscode char(15),
    amount decimal(12,2),
    trans_lnk integer
  );

revoke all on rs_pos_promo from "public";



create table sys_cur_ver 
  (
    last_checked_date date
  );

revoke all on sys_cur_ver from "public";



create table rs_pos_fuel 
  (
    grade char(8),
    descr char(20),
    act_price decimal(12,4),
    sales_qty decimal(12,4),
    sales_amt decimal(12,2),
    promo_id char(24),
    promo_reason char(24),
    promo_amt decimal(12,2),
    trans_lnk integer
  );

revoke all on rs_pos_fuel from "public";



create table pyach 
  (
    bank_acct char(17),
    dep_date date,
    dep_amount decimal(16,2)
  );

revoke all on pyach from "public";



create table rs_reading 
  (
    rsr_shl integer,
    rsr_pumpnum integer,
    rsr_breading_gal decimal(12,2),
    rsr_breading_dol decimal(12,2),
    rsr_price decimal(12,4),
    rsr_ereading_gal decimal(12,2),
    rsr_ereading_dol decimal(12,2),
    rsr_pumpseq smallint
  );

revoke all on rs_reading from "public";



create table fm_lading_d 
  (
    fmld_movement integer,
    fmld_bl_nbr integer,
    fmld_seq_nbr smallint,
    fmld_prodlnk integer,
    fmld_location char(5),
    fmld_net decimal(8,2),
    fmld_gross decimal(8,2),
    fmld_cost decimal(16,5),
    fmld_invoice_nbr integer,
    fmld_bl_valid char(1),
    fmld_freight decimal(16,5),
    fmld_srchg decimal(8,2),
    fmld_ngu char(1),
    fmld_blnd_flag smallint,
    fmld_frght_inv_lnk integer,
    fmld_freight_stat char(1),
    fmld_serial serial not null ,
    fmld_prod_inv_date date,
    fmld_frght_inv_dat date
  );

revoke all on fm_lading_d from "public";



create table fm_mv_bal 
  (
    fmmb_movement integer,
    fmmb_bl_nbr integer,
    fmmb_bl_prodlnk integer,
    fmmb_bl_line smallint,
    fmmb_bl_vol decimal(8,2),
    fmmb_frt_in decimal(16,5),
    fmmb_srchg_in decimal(8,2),
    fmmb_dv_nbr integer,
    fmmb_dv_prodlnk integer,
    fmmb_dv_line smallint,
    fmmb_dv_vol decimal(8,2),
    fmmb_frt_out decimal(16,5),
    fmmb_srchg_out decimal(8,2),
    fmmb_ext_cost decimal(12,2)
  );

revoke all on fm_mv_bal from "public";



create table fm_lad_tax 
  (
    fmldt_movement integer,
    fmldt_bl_nbr integer,
    fmldt_line smallint,
    fmldt_trn integer,
    fmldt_ulink integer,
    fmldt_type char(1),
    fmldt_amount decimal(16,6),
    fmldt_gal decimal(8,2),
    fmldt_charge char(1),
    fmldt_extn decimal(8,2),
    fmldt_seq smallint
  );

revoke all on fm_lad_tax from "public";



create table tx_table 
  (
    tt_code char(5),
    tt_level char(1),
    tt_where char(10),
    tt_order smallint,
    tt_gl_acct integer,
    tt_rate decimal(16,6),
    tt_charge char(1),
    tt_basis char(1),
    tt_limit decimal(8,2),
    tt_lmt_type char(1),
    tt_date date,
    tt_trn serial not null ,
    tt_descr char(30),
    tt_terms char(5),
    tt_chart_nbr smallint
  );

revoke all on tx_table from "public";



create table rs_b_zone 
  (
    zone integer,
    descr char(30)
  );

revoke all on rs_b_zone from "public";



create table rs_b_zonedet 
  (
    zone integer,
    prft_ctr integer
  );

revoke all on rs_b_zonedet from "public";



create table rs_b_zoneitm 
  (
    ic_lnk integer,
    zone integer,
    price_lnk integer
  );

revoke all on rs_b_zoneitm from "public";



create table sih_inv_line 
  (
    idph_nbr integer,
    idph_seq_nbr smallint,
    idph_prft_ctr smallint,
    idph_prodlnk integer,
    idph_location char(5),
    idph_qty_ord decimal(10,2),
    idph_how_shipped char(5),
    idph_qty_shipped decimal(10,2),
    idph_qty_bkord decimal(10,2),
    idph_core_qty decimal(10,2),
    idph_core_price decimal(8,2),
    idph_cost decimal(16,5),
    idph_tax_amount decimal(8,2),
    idph_ovrrid_flag char(1),
    idph_list_price decimal(16,5),
    idph_sale_price decimal(16,5),
    idph_discount decimal(8,2),
    idph_commiss_amt decimal(8,2),
    idph_gl integer,
    idph_text_flag char(1),
    idph_movement_flag integer,
    idph_freight decimal(8,2),
    idph_srchg decimal(8,2),
    idph_extn decimal(10,2),
    idph_fet_amt_ea decimal(8,2),
    idph_ngu_shipped char(1),
    idph_norg_qty decimal(10,2),
    idph_pricing_qty decimal(10,2),
    idph_serial integer,
    idph_base_cost decimal(8,2)
  );

revoke all on sih_inv_line from "public";



create table si_inv_line 
  (
    idp_nbr integer,
    idp_seq_nbr smallint,
    idp_prft_ctr smallint,
    idp_prodlnk integer,
    idp_location char(5),
    idp_qty_ord decimal(10,2),
    idp_how_shipped char(5),
    idp_qty_shipped decimal(10,2),
    idp_qty_bkord decimal(10,2),
    idp_core_qty decimal(10,2),
    idp_core_price decimal(8,2),
    idp_cost decimal(8,2),
    idp_tax_amount decimal(8,2),
    idp_ovrrid_flag char(1),
    idp_list_price decimal(16,5),
    idp_sale_price decimal(16,5),
    idp_discount decimal(8,2),
    idp_commiss_amt decimal(8,2),
    idp_gl integer,
    idp_text_flag char(1),
    idp_movement_flag integer,
    idp_freight decimal(8,2),
    idp_srchg decimal(8,2),
    idp_extn decimal(10,2),
    idp_fet_amt_ea decimal(8,2),
    idp_ngu_shipped char(1),
    idp_norg_qty decimal(10,2),
    idp_pricing_qty decimal(10,2),
    idp_serial serial not null ,
    idp_base_cost decimal(8,2)
  );

revoke all on si_inv_line from "public";



create table ar_log 
  (
    usercode char(10),
    customer integer,
    invoice_nbr integer,
    tran_dt date,
    sent_date date,
    sent_time char(8),
    email_addr_from char(60),
    email_addr_to char(60)
  );

revoke all on ar_log from "public";



create table pyedi 
  (
    sent_date date,
    sent_time char(8),
    pay_date date,
    username char(10),
    msg_type char(3),
    file_ref char(32),
    sent_status char(1),
    receipt char(400)
  );

revoke all on pyedi from "public";



create table company_paye 
  (
    tax_office char(3),
    paye_ref char(7),
    ao_ref char(13),
    econ char(9),
    sautr char(10),
    cotaxref char(10),
    sortcode char(6),
    sender_id char(35),
    sender_password char(35)
  );

revoke all on company_paye from "public";



create table py_paye_late 
  (
    tranrecno integer,
    reason_code char(1)
  );

revoke all on py_paye_late from "public";



create table pypemp 
  (
    empno char(6),
    leaving_date date,
    taxcode char(10),
    non_cumulative char(1),
    pay_ytd decimal(16,2),
    tax_ytd decimal(16,2),
    payid char(20)
  );

revoke all on pypemp from "public";



create table sys_row_lock 
  (
    srl_table char(18) not null ,
    srl_prog_id char(10) not null ,
    srl_user_id char(12) not null ,
    srl_criteria integer,
    srl_nbr serial not null 
  );

revoke all on sys_row_lock from "public";



create table rs_pos_item 
  (
    ctr integer,
    cashier char(12),
    register_id smallint,
    trans_id integer,
    business_dt date,
    rec_time char(8),
    poscodefmt char(5),
    poscode char(15),
    entry_meth char(18),
    act_sale_price decimal(12,2),
    department integer,
    sell_units integer,
    reg_sale_price decimal(12,2),
    sales_qty integer,
    sales_amt decimal(12,2),
    disc_amt decimal(12,2),
    disc_reason char(16),
    tax_id integer,
    trans_lnk integer
  );

revoke all on rs_pos_item from "public";



create table pymded 
  (
    deductcode char(4),
    description char(12),
    sequence smallint,
    w2box smallint,
    w2code char(4),
    glcode integer,
    dummy char(50)
  );

revoke all on pymded from "public";



create table pymearn 
  (
    earncode char(4),
    description char(12),
    sequence smallint,
    glcode integer,
    includenet char(1),
    include401k char(1),
    fringe char(1),
    ratefactor decimal(16,2),
    w2box smallint,
    w2code char(4),
    dummy char(50)
  );

revoke all on pymearn from "public";



create table pymtax 
  (
    taxauthority char(4),
    authdescription char(20),
    taxcode char(4),
    codedescription char(12),
    internal_taxcode char(4),
    sequence smallint,
    taxid char(15),
    glcode integer,
    glcode2 integer,
    whopays char(1),
    minwage decimal(16,2),
    fixedpercent decimal(16,2),
    percent decimal(16,2),
    maximum decimal(16,2),
    percentflag char(1),
    e1 char(4),
    e2 char(4),
    e3 char(4),
    e4 char(4),
    e5 char(4),
    e6 char(4),
    e7 char(4),
    e8 char(4),
    d1 char(4),
    d2 char(4),
    d3 char(4),
    d4 char(4),
    d5 char(4),
    d6 char(4),
    d7 char(4),
    d8 char(4),
    wkcm_ovtexempt char(1),
    workcode1 char(4),
    desc1 char(12),
    rate1 decimal(16,2),
    limit1 decimal(16,2),
    workcode2 char(4),
    desc2 char(12),
    rate2 decimal(16,2),
    limit2 decimal(16,2),
    workcode3 char(4),
    desc3 char(12),
    rate3 decimal(16,2),
    limit3 decimal(16,2),
    workcode4 char(4),
    desc4 char(12),
    rate4 decimal(16,2),
    limit4 decimal(16,2),
    workcode5 char(4),
    desc5 char(12),
    rate5 decimal(16,2),
    limit5 decimal(16,2),
    workcode6 char(4),
    desc6 char(12),
    rate6 decimal(16,2),
    limit6 decimal(16,2),
    workcode7 char(4),
    desc7 char(12),
    rate7 decimal(16,2),
    limit7 decimal(16,2),
    workcode8 char(4),
    desc8 char(12),
    rate8 decimal(16,2),
    limit8 decimal(16,2),
    workcode9 char(4),
    desc9 char(12),
    rate9 decimal(16,2),
    limit9 decimal(16,2),
    workcode10 char(4),
    desc10 char(12),
    rate10 decimal(16,2),
    limit10 decimal(16,2),
    workcode11 char(4),
    desc11 char(12),
    rate11 decimal(16,2),
    limit11 decimal(16,2),
    workcode12 char(4),
    desc12 char(12),
    rate12 decimal(16,2),
    limit12 decimal(16,2),
    dummy char(50)
  );

revoke all on pymtax from "public";



create table pymemp 
  (
    empno char(6),
    socsecno char(11),
    title char(16),
    lastname char(25),
    middlename char(1),
    firstname char(16),
    address char(30),
    address2 char(30),
    address3 char(30),
    zip char(10),
    phone char(15),
    contact char(18),
    contactphone char(15),
    sex char(1),
    eeo char(1),
    eeo_category char(1),
    licenseno char(15),
    licenseexpire char(8),
    insno char(15),
    insdate char(8),
    birthdate date,
    hiredate date,
    promotiondate date,
    rehireflag char(1),
    division char(3),
    dptno integer,
    dptsubno char(3),
    dptpercent decimal(16,2),
    startdec char(1),
    empstatus char(1),
    empstatusdate date,
    jobtitle char(40),
    refersource char(1),
    referdescription char(30),
    offpayroll char(1),
    lastreviewdate date,
    lastraisedate date,
    lastraiseamount decimal(16,2),
    nextreviewdate date,
    ins_dependlife char(1),
    ins_basiclife char(1),
    ins_longdisable char(1),
    ins_medcarrier char(4),
    ins_medical char(1),
    ins_dental char(1),
    p401k_eligible char(1),
    taxcode char(10),
    nicat char(1),
    director char(1),
    non_cumulative char(1),
    scon char(9),
    sld char(1),
    sortcode char(6),
    paymethod char(1),
    payrate decimal(16,3),
    payunit decimal(16,2),
    payrate2 decimal(16,3),
    payunit2 decimal(16,2),
    payrate3 decimal(16,2),
    payunit3 decimal(16,2),
    paygroup char(2),
    ficaexempt char(1),
    futaexempt char(1),
    sutaexempt char(1),
    otherexempt char(1),
    workcompclass char(4),
    fed_taxauthority char(4),
    state_taxauthority char(4),
    local_taxauthority char(4),
    local2taxauthority char(4),
    local3taxauthority char(4),
    eic_taxauthority char(4),
    fed_taxstatus char(1),
    state_taxstatus char(1),
    local_taxstatus char(1),
    local2_taxstatus char(1),
    local3_taxstatus char(1),
    eic_taxstatus char(1),
    fed_exemptno smallint,
    state_exemptno smallint,
    local_exemptno smallint,
    local2_exemptno smallint,
    local3_exemptno smallint,
    eic_exemptno smallint,
    fed_exemptextra decimal(16,2),
    state_exemptextra decimal(16,2),
    local_exemptextra decimal(16,2),
    local2_exemptextra decimal(16,2),
    local3_exemptextra decimal(16,2),
    eic_exemptextra decimal(16,2),
    fed_exemptfixed decimal(16,2),
    state_exemptfixed decimal(16,2),
    local_exemptfixed decimal(16,2),
    local2_exemptfixed decimal(16,2),
    local3_exemptfixed decimal(16,2),
    eic_exemptfixed decimal(16,2),
    fed_401k char(1),
    fed_pensionplan char(1),
    fed_statutory char(1),
    fed_deceased char(1),
    vacprevious decimal(16,2),
    vaccurrent decimal(16,2),
    vacused decimal(16,2),
    vacstartdate date,
    vacrate decimal(16,2),
    vacrateunit char(1),
    vacunit char(1),
    vacnextupdate date,
    vacptocode char(3),
    personalprevious decimal(16,2),
    personalcurrent decimal(16,2),
    personalused decimal(16,2),
    personalstartdate date,
    personalrate decimal(16,2),
    personalrateunit char(1),
    personalunit char(1),
    personalnextupdate date,
    personalptocode char(3),
    sickprevious decimal(16,2),
    sickcurrent decimal(16,2),
    sickused decimal(16,2),
    sickstartdate date,
    sickrate decimal(16,2),
    sickrateunit char(1),
    sickunit char(1),
    sicknextupdate date,
    sickptocode char(3),
    year1 smallint,
    ytdearn1 decimal(16,2),
    ytdded1 decimal(16,2),
    ytdnet1 decimal(16,2),
    ytdovtpremium1 decimal(16,2),
    year2 smallint,
    ytdearn2 decimal(16,2),
    ytdded2 decimal(16,2),
    ytdnet2 decimal(16,2),
    ytdovtpremium2 decimal(16,2),
    year3 smallint,
    ytdearn3 decimal(16,2),
    ytdded3 decimal(16,2),
    ytdnet3 decimal(16,2),
    ytdovtpremium3 decimal(16,2)
  );

revoke all on pymemp from "public";



create table pymhis 
  (
    module char(1),
    postno integer,
    tranrecno serial not null ,
    empno char(6),
    deductperiod smallint,
    paybegin date,
    payend date,
    statusflag char(1),
    chkno integer,
    trandate date,
    dptno integer,
    chkamt decimal(16,2),
    glcode integer,
    subref char(4)
  );

revoke all on pymhis from "public";



create table pythis 
  (
    source char(1),
    tranrecno integer,
    recno serial not null ,
    postno integer,
    postdate date,
    tranyear smallint,
    trandate date,
    perioddate date,
    empno char(6),
    sorttype smallint,
    paytype char(1),
    sortauthority smallint,
    payauthority char(4),
    paycode char(4),
    ficaexempt char(1),
    futaexempt char(1),
    sutaexempt char(1),
    otherexempt char(1),
    dptno integer,
    dptsubno char(3),
    nicat char(1),
    scon char(9),
    payrate decimal(16,2),
    payunits decimal(16,2),
    payamount decimal(16,2),
    taxable decimal(16,2),
    glcode integer
  );

revoke all on pythis from "public";



create table si_inv_tax 
  (
    ilt_nbr integer,
    ilt_line smallint,
    ilt_trn integer,
    ilt_ulink integer,
    ilt_amount decimal(8,2),
    ilt_units decimal(10,2),
    ilt_tax_rate decimal(16,6)
  );

revoke all on si_inv_tax from "public";



create table sih_inv_tax 
  (
    ilth_nbr integer,
    ilth_line smallint,
    ilth_trn integer,
    ilth_ulink integer,
    ilth_amount decimal(8,2),
    ilth_units decimal(10,2),
    ilth_tax_rate decimal(16,6)
  );

revoke all on sih_inv_tax from "public";



create table rs_b_dept 
  (
    dpt_nbr integer,
    dpt_desc char(30),
    catagory char(4),
    prodlnk integer,
    active_flag char(1),
    network_prod integer,
    tax_strategy_id integer,
    negative_flag char(1)
  );

revoke all on rs_b_dept from "public";



create table inv_rec_tax 
  (
    rcvr_nbr char(16),
    rcvr_line smallint,
    vendor integer,
    trn integer,
    ulink integer,
    charge char(1),
    amount decimal(16,2),
    units decimal(16,2),
    tax_rate float
  );

revoke all on inv_rec_tax from "public";



create table tx_vendor 
  (
    vendor integer,
    prodtcl char(5),
    use_g char(8)
  );

revoke all on tx_vendor from "public";



create table tx_vat 
  (
    return_box_nbr integer,
    use_g char(8)
  );

revoke all on tx_vat from "public";



create table tx_vat_return 
  (
    period_key char(4),
    start_date date,
    end_date date,
    processing_date char(24),
    form_bundle_nbr char(20),
    vat_due_sales decimal(16,2),
    vat_due_acq decimal(16,2),
    vat_recl_purch decimal(16,2),
    total_sales decimal(16,2),
    total_purch decimal(16,2),
    total_goods_supp decimal(16,2),
    total_acq decimal(16,2)
  );

revoke all on tx_vat_return from "public";



create table co_gov_gateway 
  (
    service char(10),
    access_token char(40)
  );

revoke all on co_gov_gateway from "public";



create table ar_ref_nbr 
  (
    customer integer,
    ref_nbr integer
  );

revoke all on ar_ref_nbr from "public";



create table prod_packing_xref 
  (
    product char(16),
    packet_weight decimal(16,2)
  );

revoke all on prod_packing_xref from "public";



create table inv_rec_lot 
  (
    vendor integer,
    rcvr char(16),
    line_nbr smallint,
    loc char(5),
    lot_nbr char(16),
    qty decimal(16,2),
    expire_dt date
  );

revoke all on inv_rec_lot from "public";



create table si_inv_lot 
  (
    inv_nbr integer,
    line_nbr smallint,
    loc char(5),
    lot_nbr char(16),
    qty decimal(16,2),
    expire_dt date
  );

revoke all on si_inv_lot from "public";



create table inv_cnt_lot 
  (
    countlnk integer,
    prodlnk integer,
    loc char(5),
    lot_nbr char(16),
    qty decimal(16,2),
    expire_dt date
  );

revoke all on inv_cnt_lot from "public";



create table sys_country 
  (
    c_code char(3),
    c_name char(30)
  );

revoke all on sys_country from "public";



create table py_letter 
  (
    ltr_no smallint,
    ltr_desc char(30)
  );

revoke all on py_letter from "public";



create table py_let_line 
  (
    ltr_no smallint,
    seq integer,
    txt char(74)
  );

revoke all on py_let_line from "public";



create table inv_rec_line 
  (
    pol_num integer,
    pol_line smallint,
    pol_prft_ctr smallint,
    pol_prodlnk integer,
    pol_loc char(5),
    pol_qty_ord decimal(10,2),
    pol_ngu char(1),
    pol_vendor integer,
    pol_date_expct date,
    pol_price decimal(16,3),
    pol_backord decimal(10,2),
    pol_freight decimal(8,2),
    pol_rcvr char(16),
    pol_invoice integer,
    pol_purch_qty decimal(10,2),
    pol_purch_price decimal(16,3),
    pol_purch_extn decimal(13,2),
    pol_inv_date date
  );

revoke all on inv_rec_line from "public";


grant select on ar_class to "public";
grant update on ar_class to "public";
grant insert on ar_class to "public";
grant delete on ar_class to "public";
grant select on ar_cycle to "public";
grant update on ar_cycle to "public";
grant insert on ar_cycle to "public";
grant delete on ar_cycle to "public";
grant select on ar_fnc_table to "public";
grant update on ar_fnc_table to "public";
grant insert on ar_fnc_table to "public";
grant delete on ar_fnc_table to "public";
grant select on ar_item to "public";
grant update on ar_item to "public";
grant insert on ar_item to "public";
grant delete on ar_item to "public";
grant select on ar_item_tag to "public";
grant update on ar_item_tag to "public";
grant insert on ar_item_tag to "public";
grant delete on ar_item_tag to "public";
grant select on ar_type to "public";
grant update on ar_type to "public";
grant insert on ar_type to "public";
grant delete on ar_type to "public";
grant select on fm_lading to "public";
grant update on fm_lading to "public";
grant insert on fm_lading to "public";
grant delete on fm_lading to "public";
grant select on fm_terminal to "public";
grant update on fm_terminal to "public";
grant insert on fm_terminal to "public";
grant delete on fm_terminal to "public";
grant select on gl_journal to "public";
grant update on gl_journal to "public";
grant insert on gl_journal to "public";
grant delete on gl_journal to "public";
grant select on gl_jrnl_ar to "public";
grant update on gl_jrnl_ar to "public";
grant insert on gl_jrnl_ar to "public";
grant delete on gl_jrnl_ar to "public";
grant select on gl_jrnl_fm to "public";
grant update on gl_jrnl_fm to "public";
grant insert on gl_jrnl_fm to "public";
grant delete on gl_jrnl_fm to "public";
grant select on gl_jrnl_text to "public";
grant update on gl_jrnl_text to "public";
grant insert on gl_jrnl_text to "public";
grant delete on gl_jrnl_text to "public";
grant select on gl_jrnl_ws to "public";
grant update on gl_jrnl_ws to "public";
grant insert on gl_jrnl_ws to "public";
grant delete on gl_jrnl_ws to "public";
grant select on gl_master to "public";
grant update on gl_master to "public";
grant insert on gl_master to "public";
grant delete on gl_master to "public";
grant select on gl_period to "public";
grant update on gl_period to "public";
grant insert on gl_period to "public";
grant delete on gl_period to "public";
grant select on inv_history to "public";
grant update on inv_history to "public";
grant insert on inv_history to "public";
grant delete on inv_history to "public";
grant select on inv_rec_head to "public";
grant update on inv_rec_head to "public";
grant insert on inv_rec_head to "public";
grant delete on inv_rec_head to "public";
grant select on inv_secndloc to "public";
grant update on inv_secndloc to "public";
grant insert on inv_secndloc to "public";
grant delete on inv_secndloc to "public";
grant select on p_checks to "public";
grant update on p_checks to "public";
grant insert on p_checks to "public";
grant delete on p_checks to "public";
grant select on p_class to "public";
grant update on p_class to "public";
grant insert on p_class to "public";
grant delete on p_class to "public";
grant select on p_item_d to "public";
grant update on p_item_d to "public";
grant insert on p_item_d to "public";
grant delete on p_item_d to "public";
grant select on p_pay_d to "public";
grant update on p_pay_d to "public";
grant insert on p_pay_d to "public";
grant delete on p_pay_d to "public";
grant select on rs_pumpcls to "public";
grant update on rs_pumpcls to "public";
grant insert on rs_pumpcls to "public";
grant delete on rs_pumpcls to "public";
grant select on rs_scat to "public";
grant update on rs_scat to "public";
grant insert on rs_scat to "public";
grant delete on rs_scat to "public";
grant select on rs_shiftlink to "public";
grant update on rs_shiftlink to "public";
grant insert on rs_shiftlink to "public";
grant delete on rs_shiftlink to "public";
grant select on rs_summary to "public";
grant update on rs_summary to "public";
grant insert on rs_summary to "public";
grant delete on rs_summary to "public";
grant select on si_alt_addr to "public";
grant update on si_alt_addr to "public";
grant insert on si_alt_addr to "public";
grant delete on si_alt_addr to "public";
grant select on si_inv_text to "public";
grant update on si_inv_text to "public";
grant insert on si_inv_text to "public";
grant delete on si_inv_text to "public";
grant select on sih_alt_addr to "public";
grant update on sih_alt_addr to "public";
grant insert on sih_alt_addr to "public";
grant delete on sih_alt_addr to "public";
grant select on sih_batches to "public";
grant update on sih_batches to "public";
grant insert on sih_batches to "public";
grant delete on sih_batches to "public";
grant select on sih_inv_text to "public";
grant update on sih_inv_text to "public";
grant insert on sih_inv_text to "public";
grant delete on sih_inv_text to "public";
grant select on sp_excpt_clas to "public";
grant update on sp_excpt_clas to "public";
grant insert on sp_excpt_clas to "public";
grant delete on sp_excpt_clas to "public";
grant select on sp_excpt_cust to "public";
grant update on sp_excpt_cust to "public";
grant insert on sp_excpt_cust to "public";
grant delete on sp_excpt_cust to "public";
grant select on sp_table to "public";
grant update on sp_table to "public";
grant insert on sp_table to "public";
grant delete on sp_table to "public";
grant select on sys_county to "public";
grant update on sys_county to "public";
grant insert on sys_county to "public";
grant delete on sys_county to "public";
grant select on tx_cust_prmt to "public";
grant update on tx_cust_prmt to "public";
grant insert on tx_cust_prmt to "public";
grant delete on tx_cust_prmt to "public";
grant select on tx_customer to "public";
grant update on tx_customer to "public";
grant insert on tx_customer to "public";
grant delete on tx_customer to "public";
grant select on tx_use_g to "public";
grant update on tx_use_g to "public";
grant insert on tx_use_g to "public";
grant delete on tx_use_g to "public";
grant select on tx_use_link to "public";
grant update on tx_use_link to "public";
grant insert on tx_use_link to "public";
grant delete on tx_use_link to "public";
grant select on si_nbr to "public";
grant update on si_nbr to "public";
grant insert on si_nbr to "public";
grant delete on si_nbr to "public";
grant select on sys_state to "public";
grant update on sys_state to "public";
grant insert on sys_state to "public";
grant delete on sys_state to "public";
grant select on rs_taxes to "public";
grant update on rs_taxes to "public";
grant insert on rs_taxes to "public";
grant delete on rs_taxes to "public";
grant select on fm_movement to "public";
grant update on fm_movement to "public";
grant insert on fm_movement to "public";
grant delete on fm_movement to "public";
grant select on inv_master to "public";
grant update on inv_master to "public";
grant insert on inv_master to "public";
grant delete on inv_master to "public";
grant select on sys_lock to "public";
grant update on sys_lock to "public";
grant insert on sys_lock to "public";
grant delete on sys_lock to "public";
grant select on oe_comment to "public";
grant update on oe_comment to "public";
grant insert on oe_comment to "public";
grant delete on oe_comment to "public";
grant select on fd_comment to "public";
grant update on fd_comment to "public";
grant insert on fd_comment to "public";
grant delete on fd_comment to "public";
grant select on inv_bilmat to "public";
grant update on inv_bilmat to "public";
grant insert on inv_bilmat to "public";
grant delete on inv_bilmat to "public";
grant select on si_comment to "public";
grant update on si_comment to "public";
grant insert on si_comment to "public";
grant delete on si_comment to "public";
grant select on rs_cat_current to "public";
grant update on rs_cat_current to "public";
grant insert on rs_cat_current to "public";
grant delete on rs_cat_current to "public";
grant select on si_certf to "public";
grant update on si_certf to "public";
grant insert on si_certf to "public";
grant delete on si_certf to "public";
grant select on gl_jrnl_rs to "public";
grant update on gl_jrnl_rs to "public";
grant insert on gl_jrnl_rs to "public";
grant delete on gl_jrnl_rs to "public";
grant select on inv_counts to "public";
grant update on inv_counts to "public";
grant insert on inv_counts to "public";
grant delete on inv_counts to "public";
grant select on rs_cat_det to "public";
grant update on rs_cat_det to "public";
grant insert on rs_cat_det to "public";
grant delete on rs_cat_det to "public";
grant select on inv_cost_hist to "public";
grant update on inv_cost_hist to "public";
grant insert on inv_cost_hist to "public";
grant delete on inv_cost_hist to "public";
grant select on inv_header to "public";
grant update on inv_header to "public";
grant insert on inv_header to "public";
grant delete on inv_header to "public";
grant select on inv_classes to "public";
grant update on inv_classes to "public";
grant insert on inv_classes to "public";
grant delete on inv_classes to "public";
grant select on ar_comment to "public";
grant update on ar_comment to "public";
grant insert on ar_comment to "public";
grant delete on ar_comment to "public";
grant select on ar_openitem to "public";
grant update on ar_openitem to "public";
grant insert on ar_openitem to "public";
grant delete on ar_openitem to "public";
grant select on fm_tank to "public";
grant update on fm_tank to "public";
grant insert on fm_tank to "public";
grant delete on fm_tank to "public";
grant select on inv_uom to "public";
grant update on inv_uom to "public";
grant insert on inv_uom to "public";
grant delete on inv_uom to "public";
grant select on rs_altcat_marg to "public";
grant update on rs_altcat_marg to "public";
grant insert on rs_altcat_marg to "public";
grant delete on rs_altcat_marg to "public";
grant select on p_altname to "public";
grant update on p_altname to "public";
grant insert on p_altname to "public";
grant delete on p_altname to "public";
grant select on inv_sls_cstlr to "public";
grant update on inv_sls_cstlr to "public";
grant insert on inv_sls_cstlr to "public";
grant delete on inv_sls_cstlr to "public";
grant select on fm_purch_term to "public";
grant update on fm_purch_term to "public";
grant insert on fm_purch_term to "public";
grant delete on fm_purch_term to "public";
grant select on p_payment to "public";
grant update on p_payment to "public";
grant insert on p_payment to "public";
grant delete on p_payment to "public";
grant select on iq_salesman_name to "public";
grant update on iq_salesman_name to "public";
grant insert on iq_salesman_name to "public";
grant delete on iq_salesman_name to "public";
grant select on p_vendor to "public";
grant update on p_vendor to "public";
grant insert on p_vendor to "public";
grant delete on p_vendor to "public";
grant select on rs_b_mass_upd to "public";
grant update on rs_b_mass_upd to "public";
grant insert on rs_b_mass_upd to "public";
grant delete on rs_b_mass_upd to "public";
grant select on fd_order to "public";
grant update on fd_order to "public";
grant insert on fd_order to "public";
grant delete on fd_order to "public";
grant select on ar_cust_aging to "public";
grant update on ar_cust_aging to "public";
grant insert on ar_cust_aging to "public";
grant delete on ar_cust_aging to "public";
grant select on ar_ach_entries to "public";
grant update on ar_ach_entries to "public";
grant insert on ar_ach_entries to "public";
grant delete on ar_ach_entries to "public";
grant select on sys_terms to "public";
grant update on sys_terms to "public";
grant insert on sys_terms to "public";
grant delete on sys_terms to "public";
grant select on ar_customer to "public";
grant update on ar_customer to "public";
grant insert on ar_customer to "public";
grant delete on ar_customer to "public";
grant select on rs_cat to "public";
grant update on rs_cat to "public";
grant insert on rs_cat to "public";
grant delete on rs_cat to "public";
grant select on fm_carrier to "public";
grant update on fm_carrier to "public";
grant insert on fm_carrier to "public";
grant delete on fm_carrier to "public";
grant select on fm_freight to "public";
grant update on fm_freight to "public";
grant insert on fm_freight to "public";
grant delete on fm_freight to "public";
grant select on sys_bank_acct to "public";
grant update on sys_bank_acct to "public";
grant insert on sys_bank_acct to "public";
grant delete on sys_bank_acct to "public";
grant select on co_company_name to "public";
grant update on co_company_name to "public";
grant insert on co_company_name to "public";
grant delete on co_company_name to "public";
grant select on rs_b_price_change to "public";
grant update on rs_b_price_change to "public";
grant insert on rs_b_price_change to "public";
grant delete on rs_b_price_change to "public";
grant select on ar_altname to "public";
grant update on ar_altname to "public";
grant insert on ar_altname to "public";
grant delete on ar_altname to "public";
grant select on fm_delivery to "public";
grant update on fm_delivery to "public";
grant insert on fm_delivery to "public";
grant delete on fm_delivery to "public";
grant select on si_invoice to "public";
grant update on si_invoice to "public";
grant insert on si_invoice to "public";
grant delete on si_invoice to "public";
grant select on sih_invoice to "public";
grant update on sih_invoice to "public";
grant insert on sih_invoice to "public";
grant delete on sih_invoice to "public";
grant select on rs_purcline to "public";
grant update on rs_purcline to "public";
grant insert on rs_purcline to "public";
grant delete on rs_purcline to "public";
grant select on rs_purch to "public";
grant update on rs_purch to "public";
grant insert on rs_purch to "public";
grant delete on rs_purch to "public";
grant select on p_item to "public";
grant update on p_item to "public";
grant insert on p_item to "public";
grant delete on p_item to "public";
grant select on p_nbr to "public";
grant update on p_nbr to "public";
grant insert on p_nbr to "public";
grant delete on p_nbr to "public";
grant select on p_openitem to "public";
grant update on p_openitem to "public";
grant insert on p_openitem to "public";
grant delete on p_openitem to "public";
grant select on gl_jrnl_ap to "public";
grant update on gl_jrnl_ap to "public";
grant insert on gl_jrnl_ap to "public";
grant delete on gl_jrnl_ap to "public";
grant select on rs_daily to "public";
grant update on rs_daily to "public";
grant insert on rs_daily to "public";
grant delete on rs_daily to "public";
grant select on p_ach to "public";
grant update on p_ach to "public";
grant insert on p_ach to "public";
grant delete on p_ach to "public";
grant select on p_ach_sent to "public";
grant update on p_ach_sent to "public";
grant insert on p_ach_sent to "public";
grant delete on p_ach_sent to "public";
grant select on p_selection to "public";
grant update on p_selection to "public";
grant insert on p_selection to "public";
grant delete on p_selection to "public";
grant select on rs_b_mix to "public";
grant update on rs_b_mix to "public";
grant insert on rs_b_mix to "public";
grant delete on rs_b_mix to "public";
grant select on rs_sls_grp to "public";
grant update on rs_sls_grp to "public";
grant insert on rs_sls_grp to "public";
grant delete on rs_sls_grp to "public";
grant select on rs_pos_tax to "public";
grant update on rs_pos_tax to "public";
grant insert on rs_pos_tax to "public";
grant delete on rs_pos_tax to "public";
grant select on rs_pos_tender to "public";
grant update on rs_pos_tender to "public";
grant insert on rs_pos_tender to "public";
grant delete on rs_pos_tender to "public";
grant select on rs_pos_lnk to "public";
grant update on rs_pos_lnk to "public";
grant insert on rs_pos_lnk to "public";
grant delete on rs_pos_lnk to "public";
grant select on rs_b_purch to "public";
grant update on rs_b_purch to "public";
grant insert on rs_b_purch to "public";
grant delete on rs_b_purch to "public";
grant select on rs_b_purline to "public";
grant update on rs_b_purline to "public";
grant insert on rs_b_purline to "public";
grant delete on rs_b_purline to "public";
grant select on rs_b_item to "public";
grant update on rs_b_item to "public";
grant insert on rs_b_item to "public";
grant delete on rs_b_item to "public";
grant select on rs_b_price to "public";
grant update on rs_b_price to "public";
grant insert on rs_b_price to "public";
grant delete on rs_b_price to "public";
grant select on rs_b_exclude to "public";
grant update on rs_b_exclude to "public";
grant insert on rs_b_exclude to "public";
grant delete on rs_b_exclude to "public";
grant select on rs_b_hold_delete to "public";
grant update on rs_b_hold_delete to "public";
grant insert on rs_b_hold_delete to "public";
grant delete on rs_b_hold_delete to "public";
grant select on menu_field to "public";
grant update on menu_field to "public";
grant insert on menu_field to "public";
grant delete on menu_field to "public";
grant select on menu_secure to "public";
grant update on menu_secure to "public";
grant insert on menu_secure to "public";
grant delete on menu_secure to "public";
grant select on menu_head to "public";
grant update on menu_head to "public";
grant insert on menu_head to "public";
grant delete on menu_head to "public";
grant select on sys_parm to "public";
grant update on sys_parm to "public";
grant insert on sys_parm to "public";
grant delete on sys_parm to "public";
grant select on p_mchk to "public";
grant update on p_mchk to "public";
grant insert on p_mchk to "public";
grant delete on p_mchk to "public";
grant select on p_dchk to "public";
grant update on p_dchk to "public";
grant insert on p_dchk to "public";
grant delete on p_dchk to "public";
grant select on pymgrp to "public";
grant update on pymgrp to "public";
grant insert on pymgrp to "public";
grant delete on pymgrp to "public";
grant select on pyiemp to "public";
grant update on pyiemp to "public";
grant insert on pyiemp to "public";
grant delete on pyiemp to "public";
grant select on pympto to "public";
grant update on pympto to "public";
grant insert on pympto to "public";
grant delete on pympto to "public";
grant select on sys_zip to "public";
grant update on sys_zip to "public";
grant insert on sys_zip to "public";
grant delete on sys_zip to "public";
grant select on gl_jrnl_py to "public";
grant update on gl_jrnl_py to "public";
grant insert on gl_jrnl_py to "public";
grant delete on gl_jrnl_py to "public";
grant select on pyhchk to "public";
grant update on pyhchk to "public";
grant insert on pyhchk to "public";
grant delete on pyhchk to "public";
grant select on pympto_earn to "public";
grant update on pympto_earn to "public";
grant insert on pympto_earn to "public";
grant delete on pympto_earn to "public";
grant select on pyichk to "public";
grant update on pyichk to "public";
grant insert on pyichk to "public";
grant delete on pyichk to "public";
grant select on pyttax to "public";
grant update on pyttax to "public";
grant insert on pyttax to "public";
grant delete on pyttax to "public";
grant select on co_rpt_ctl to "public";
grant update on co_rpt_ctl to "public";
grant insert on co_rpt_ctl to "public";
grant delete on co_rpt_ctl to "public";
grant select on fm_delvr_d to "public";
grant update on fm_delvr_d to "public";
grant insert on fm_delvr_d to "public";
grant delete on fm_delvr_d to "public";
grant select on fd_delivery to "public";
grant update on fd_delivery to "public";
grant insert on fd_delivery to "public";
grant delete on fd_delivery to "public";
grant select on inv_pur_cstlr to "public";
grant update on inv_pur_cstlr to "public";
grant insert on inv_pur_cstlr to "public";
grant delete on inv_pur_cstlr to "public";
grant select on fm_cost to "public";
grant update on fm_cost to "public";
grant insert on fm_cost to "public";
grant delete on fm_cost to "public";
grant select on fm_frgt_cd to "public";
grant update on fm_frgt_cd to "public";
grant insert on fm_frgt_cd to "public";
grant delete on fm_frgt_cd to "public";
grant select on sys_prft_ctr to "public";
grant update on sys_prft_ctr to "public";
grant insert on sys_prft_ctr to "public";
grant delete on sys_prft_ctr to "public";
grant select on rs_b_vnd_xref to "public";
grant update on rs_b_vnd_xref to "public";
grant insert on rs_b_vnd_xref to "public";
grant delete on rs_b_vnd_xref to "public";
grant select on pydemp to "public";
grant update on pydemp to "public";
grant insert on pydemp to "public";
grant delete on pydemp to "public";
grant select on rs_pump to "public";
grant update on rs_pump to "public";
grant insert on rs_pump to "public";
grant delete on rs_pump to "public";
grant select on rs_gl_hdr to "public";
grant update on rs_gl_hdr to "public";
grant insert on rs_gl_hdr to "public";
grant delete on rs_gl_hdr to "public";
grant select on rs_gl_det to "public";
grant update on rs_gl_det to "public";
grant insert on rs_gl_det to "public";
grant delete on rs_gl_det to "public";
grant select on rs_pos_payout to "public";
grant update on rs_pos_payout to "public";
grant insert on rs_pos_payout to "public";
grant delete on rs_pos_payout to "public";
grant select on rs_pos_promo to "public";
grant update on rs_pos_promo to "public";
grant insert on rs_pos_promo to "public";
grant delete on rs_pos_promo to "public";
grant select on sys_cur_ver to "public";
grant update on sys_cur_ver to "public";
grant insert on sys_cur_ver to "public";
grant delete on sys_cur_ver to "public";
grant select on rs_pos_fuel to "public";
grant update on rs_pos_fuel to "public";
grant insert on rs_pos_fuel to "public";
grant delete on rs_pos_fuel to "public";
grant select on pyach to "public";
grant update on pyach to "public";
grant insert on pyach to "public";
grant delete on pyach to "public";
grant select on rs_reading to "public";
grant update on rs_reading to "public";
grant insert on rs_reading to "public";
grant delete on rs_reading to "public";
grant select on fm_lading_d to "public";
grant update on fm_lading_d to "public";
grant insert on fm_lading_d to "public";
grant delete on fm_lading_d to "public";
grant select on fm_mv_bal to "public";
grant update on fm_mv_bal to "public";
grant insert on fm_mv_bal to "public";
grant delete on fm_mv_bal to "public";
grant select on fm_lad_tax to "public";
grant update on fm_lad_tax to "public";
grant insert on fm_lad_tax to "public";
grant delete on fm_lad_tax to "public";
grant select on tx_table to "public";
grant update on tx_table to "public";
grant insert on tx_table to "public";
grant delete on tx_table to "public";
grant select on rs_b_zone to "public";
grant update on rs_b_zone to "public";
grant insert on rs_b_zone to "public";
grant delete on rs_b_zone to "public";
grant select on rs_b_zonedet to "public";
grant update on rs_b_zonedet to "public";
grant insert on rs_b_zonedet to "public";
grant delete on rs_b_zonedet to "public";
grant select on rs_b_zoneitm to "public";
grant update on rs_b_zoneitm to "public";
grant insert on rs_b_zoneitm to "public";
grant delete on rs_b_zoneitm to "public";
grant select on sih_inv_line to "public";
grant update on sih_inv_line to "public";
grant insert on sih_inv_line to "public";
grant delete on sih_inv_line to "public";
grant select on si_inv_line to "public";
grant update on si_inv_line to "public";
grant insert on si_inv_line to "public";
grant delete on si_inv_line to "public";
grant select on ar_log to "public";
grant update on ar_log to "public";
grant insert on ar_log to "public";
grant delete on ar_log to "public";
grant select on pyedi to "public";
grant update on pyedi to "public";
grant insert on pyedi to "public";
grant delete on pyedi to "public";
grant select on company_paye to "public";
grant update on company_paye to "public";
grant insert on company_paye to "public";
grant delete on company_paye to "public";
grant select on py_paye_late to "public";
grant update on py_paye_late to "public";
grant insert on py_paye_late to "public";
grant delete on py_paye_late to "public";
grant select on pypemp to "public";
grant update on pypemp to "public";
grant insert on pypemp to "public";
grant delete on pypemp to "public";
grant select on sys_row_lock to "public";
grant update on sys_row_lock to "public";
grant insert on sys_row_lock to "public";
grant delete on sys_row_lock to "public";
grant select on rs_pos_item to "public";
grant update on rs_pos_item to "public";
grant insert on rs_pos_item to "public";
grant delete on rs_pos_item to "public";
grant select on pymded to "public";
grant update on pymded to "public";
grant insert on pymded to "public";
grant delete on pymded to "public";
grant select on pymearn to "public";
grant update on pymearn to "public";
grant insert on pymearn to "public";
grant delete on pymearn to "public";
grant select on pymtax to "public";
grant update on pymtax to "public";
grant insert on pymtax to "public";
grant delete on pymtax to "public";
grant select on pymemp to "public";
grant update on pymemp to "public";
grant insert on pymemp to "public";
grant delete on pymemp to "public";
grant select on pymhis to "public";
grant update on pymhis to "public";
grant insert on pymhis to "public";
grant delete on pymhis to "public";
grant select on pythis to "public";
grant update on pythis to "public";
grant insert on pythis to "public";
grant delete on pythis to "public";
grant select on si_inv_tax to "public";
grant update on si_inv_tax to "public";
grant insert on si_inv_tax to "public";
grant delete on si_inv_tax to "public";
grant select on sih_inv_tax to "public";
grant update on sih_inv_tax to "public";
grant insert on sih_inv_tax to "public";
grant delete on sih_inv_tax to "public";
grant select on rs_b_dept to "public";
grant update on rs_b_dept to "public";
grant insert on rs_b_dept to "public";
grant delete on rs_b_dept to "public";
grant select on inv_rec_tax to "public";
grant update on inv_rec_tax to "public";
grant insert on inv_rec_tax to "public";
grant delete on inv_rec_tax to "public";
grant select on tx_vendor to "public";
grant update on tx_vendor to "public";
grant insert on tx_vendor to "public";
grant delete on tx_vendor to "public";
grant select on tx_vat to "public";
grant update on tx_vat to "public";
grant insert on tx_vat to "public";
grant delete on tx_vat to "public";
grant references on tx_vat to "public";
grant select on tx_vat_return to "public";
grant update on tx_vat_return to "public";
grant insert on tx_vat_return to "public";
grant delete on tx_vat_return to "public";
grant references on tx_vat_return to "public";
grant select on co_gov_gateway to "public";
grant update on co_gov_gateway to "public";
grant insert on co_gov_gateway to "public";
grant delete on co_gov_gateway to "public";
grant references on co_gov_gateway to "public";
grant select on ar_ref_nbr to "public";
grant update on ar_ref_nbr to "public";
grant insert on ar_ref_nbr to "public";
grant delete on ar_ref_nbr to "public";
grant references on ar_ref_nbr to "public";
grant select on prod_packing_xref to "public";
grant update on prod_packing_xref to "public";
grant insert on prod_packing_xref to "public";
grant delete on prod_packing_xref to "public";
grant references on prod_packing_xref to "public";
grant select on inv_rec_lot to "public";
grant update on inv_rec_lot to "public";
grant insert on inv_rec_lot to "public";
grant delete on inv_rec_lot to "public";
grant references on inv_rec_lot to "public";
grant select on si_inv_lot to "public";
grant update on si_inv_lot to "public";
grant insert on si_inv_lot to "public";
grant delete on si_inv_lot to "public";
grant references on si_inv_lot to "public";
grant select on inv_cnt_lot to "public";
grant update on inv_cnt_lot to "public";
grant insert on inv_cnt_lot to "public";
grant delete on inv_cnt_lot to "public";
grant references on inv_cnt_lot to "public";
grant select on sys_country to "public";
grant update on sys_country to "public";
grant insert on sys_country to "public";
grant delete on sys_country to "public";
grant references on sys_country to "public";
grant select on py_letter to "public";
grant update on py_letter to "public";
grant insert on py_letter to "public";
grant delete on py_letter to "public";
grant references on py_letter to "public";
grant select on py_let_line to "public";
grant update on py_let_line to "public";
grant insert on py_let_line to "public";
grant delete on py_let_line to "public";
grant references on py_let_line to "public";
grant select on inv_rec_line to "public";
grant update on inv_rec_line to "public";
grant insert on inv_rec_line to "public";
grant delete on inv_rec_line to "public";





create unique index ar_class_u on ar_class (arc_code)  
     ;
create unique index u_arcy_code on ar_cycle (arcy_code)  
     ;
create unique index ar_fnc_table_p on ar_fnc_table (fc_fnc_code,
    fc_amount,fc_type)   ;
create unique index ar_item_p on ar_item (ar_customer,ar_invoice_nbr,
    ar_seq_nbr)   ;
create index ar_item_shl on ar_item (ar_customer,ar_shift_link) 
      ;
create index ar_item_type on ar_item (ar_tran_type)   
    ;
create unique index ar_item_tag_p on ar_item_tag (art_customer,
    art_invoice_nbr,art_line)   ;
create unique index ar_type_p on ar_type (at_prft_ctr,at_type_code) 
      ;
create unique index at_ndx2 on ar_type (at_prft_ctr,at_type_code,
    at_oper)   ;
create unique index fm_lading_p on fm_lading (fml_movement,fml_bl_nbr) 
      ;
create index fm_lading_s on fm_lading (fml_bl_nbr,fml_vendor) 
      ;
create unique index fm_terminal_u on fm_terminal (fmt_code) 
      ;
create index glj_batch_idx on gl_journal (glj_batch)   
    ;
create index glj_idx1 on gl_journal (glj_date,glj_account,glj_prft_ctr) 
      ;
create unique index gl_jrnl_ar_u on gl_jrnl_ar (gljar_entry_nbr) 
      ;
create index gljar_idx1 on gl_jrnl_ar (gljar_tran_date,gljar_account,
    gljar_prft_ctr)   ;
create unique index gl_jrnl_fm_u on gl_jrnl_fm (gljfm_entry_nbr) 
      ;
create index gljfm_idx1 on gl_jrnl_fm (gljfm_tran_date,gljfm_account,
    gljfm_prft_ctr)   ;
create index gljfm_ndx2 on gl_jrnl_fm (gljfm_movement)  
     ;
create unique index jrnl_text_p on gl_jrnl_text (gljt_src,gljt_link,
    gljt_seq)   ;
create index gljws_idx1 on gl_jrnl_ws (gljws_shl,gljws_account) 
      ;
create unique index gl_master_u on gl_master (glm_series,glm_account,
    glm_prft_ctr)   ;
create index glm_group_d on gl_master (glm_series,glm_prft_ctr,
    glm_account)   ;
create unique index inv_history_p on inv_history (ph_prft_ctr,
    ph_prodlnk,ph_end_date)   ;
create unique index inv_rcvr_head on inv_rec_head (po_vendor,
    po_rcvr)   ;
create index inv_rec_head_po on inv_rec_head (po_num)  
     ;
create index inv_secl_comp on inv_secndloc (sl_prft_ctr,sl_prodlnk) 
      ;
create unique index inv_secndloc_p on inv_secndloc (sl_prft_ctr,
    sl_prodlnk,sl_loc)   ;
create index p_check_v on p_checks (pv_check_vendor,pv_shl) 
      ;
create index p_checks_lnk on p_checks (pv_shl)   ;
    
create index p_chk_acct on p_checks (pv_account)   
    ;
create unique index p_chk_anp on p_checks (pv_account,pv_check_nbr,
    pv_check_paid)   ;
create unique index i_p_class on p_class (pcl_code)   
    ;
create index p_itemd_lnk on p_item_d (pd_inv_lnk)   
    ;
create index p_payd_seq on p_pay_d (ppd_seq)   ;
create unique index rs_pumpcls_u on rs_pumpcls (rspc_class) 
      ;
create unique index rs_scat_p on rs_scat (rsc_shl,rsc_catagory) 
      ;
create unique index rs_shiftlink_u on rs_shiftlink (rssl_shl) 
      ;
create unique index rssl_ndx1 on rs_shiftlink (rssl_prft_ctr,
    rssl_date,rssl_shift)   ;
create unique index rss_shl_u on rs_summary (rss_shl)  
     ;
create unique index si_alt_addr_p on si_alt_addr (ia_nbr,ia_alt_type) 
      ;
create unique index si_inv_text_p on si_inv_text (idt_nbr,idt_line,
    idt_seq)   ;
create unique index sih_alt_addr_p on sih_alt_addr (iah_nbr,
    iah_alt_type)   ;
create unique index sih_batches_u on sih_batches (ibh_batch_nbr,
    ibh_inv_nbr)   ;
create unique index sih_inv_text_u on sih_inv_text (idth_nbr,
    idth_line,idth_seq)   ;
create unique index sp_excpt_clas_p on sp_excpt_clas (cce_cust,
    cce_product_cl)   ;
create unique index sp_excpt_cust_p on sp_excpt_cust (ce_cust,
    ce_prodlnk)   ;
create unique index sp_table_p on sp_table (pt_formula,pt_lvl,
    pt_quantity)   ;
create unique index sys_county_u on sys_county (c_code)  
     ;
create unique index tx_cust_prmt_p on tx_cust_prmt (txcp_customer,
    txcp_trn)   ;
create unique index tx_customer_p on tx_customer (ta_customer,
    ta_prodtcl,ta_use_g)   ;
create unique index tx_use_g_u on tx_use_g (tu_link)   
    ;
create index tx_use_link_k1 on tx_use_link (tul_link)  
     ;
create index tx_use_link_k2 on tx_use_link (tul_trn)   
    ;
create unique index si_nbr_u on si_nbr (in_nbr)   
    ;
create unique index sys_state_u on sys_state (s_code)  
     ;
create index rs_taxes_p on rs_taxes (rstx_shl,rstx_prodlnk,rstx_trn,
    rstx_ulink)   ;
create unique index fm_movement_u on fm_movement (fmm_movement) 
      ;
create unique index inv_master_p on inv_master (invt_prft_ctr,
    invt_prodlnk)   ;
create unique index oe_comment_u on oe_comment (oeco_customer,
    oeco_type,oeco_order,oeco_seq)   ;
create index fd_comment_p on fd_comment (fdco_customer)  
     ;
create index inv_bilmat_k1 on inv_bilmat (bm_prodlnk)  
     ;
create index inv_bilmat_k2 on inv_bilmat (bm_used_prodlnk)  
     ;
create index sico_prod on si_comment (ico_type,ico_prodlnk,ico_seq) 
      ;
create index rscc_idx on rs_cat_current (rscc_prft_ctr,rscc_catagory) 
      ;
create index rscc_prft on rs_cat_current (rscc_prft_ctr)  
     ;
create unique index si_crt_ndx on si_certf (iso_class,iso_seq) 
      ;
create index gl_jrnl_rs_shl on gl_jrnl_rs (gljrs_shl)  
     ;
create unique index gl_jrnl_rs_u on gl_jrnl_rs (gljrs_entry_nbr) 
      ;
create index gljrs_idx1 on gl_jrnl_rs (gljrs_prft_ctr,gljrs_account,
    gljrs_date,gljrs_shift)   ;
create index gljrs_idx2 on gl_jrnl_rs (gljrs_date,gljrs_account,
    gljrs_prft_ctr)   ;
create index i_counts2 on inv_counts (ic_link)   ;
    
create unique index idx_counts on inv_counts (ic_prft_ctr,ic_prodlnk,
    ic_location,ic_date,ic_type_ab)   ;
create unique index rs_cat_det_p on rs_cat_det (rscd_catagory,
    rscd_prft_ctr,rscd_period)   ;
create index rs_cat_det_pd on rs_cat_det (rscd_period)  
     ;
create index inv_ivch_serial on inv_cost_hist (ivch_serial) 
      ;
create unique index ivch_ndx1 on inv_cost_hist (ivch_prft_ctr,
    ivch_prodlnk,ivch_gl_date,ivch_serial)   ;
create unique index inv_header_p on inv_header (ivh_link)  
     ;
create unique index inv_header_u on inv_header (ivh_product) 
      ;
create unique index inv_classes_p on inv_classes (icl_code,icl_type) 
      ;
create unique index ac_ndx1 on ar_comment (ac_customer,ac_date,
    ac_src,ac_seq)   ;
create index ar_comment_s on ar_comment (ac_src,ac_next_date) 
      ;
create unique index ar_openitem_ndx on ar_openitem (aroi_customer,
    aroi_invoice_nbr,aroi_seq_nbr)   ;
create unique index fm_tank_p on fm_tank (tk_prft_ctr,tk_num) 
      ;
create unique index i_inv_uom on inv_uom (inu_code)   
    ;
create unique index p_altname_n on p_altname (pn_name,pn_alt) 
      ;
create unique index p_altname_u on p_altname (pn_alt)  
     ;
create unique index sclr_ndx1 on inv_sls_cstlr (sclr_unique) 
      ;
create index sclr_ndx2 on inv_sls_cstlr (sclr_prft_ctr,sclr_prodlnk,
    sclr_sls_date)   ;
create index sclr_ndx3 on inv_sls_cstlr (sclr_prft_ctr,sclr_prodlnk,
    sclr_pur_lyr)   ;
create index sclr_ndx4 on inv_sls_cstlr (sclr_type,sclr_serial) 
      ;
create index sclr_ndx5 on inv_sls_cstlr (sclr_prft_ctr,sclr_prodlnk,
    sclr_type,sclr_serial)   ;
create unique index fm_purch_term_ndx on fm_purch_term (fmpt_terminal,
    fmpt_vendor,fmpt_prodlnk,fmpt_use_g)   ;
create unique index p_pay_p on p_payment (pp_inv_lnk,pp_seq) 
      ;
create unique index p_pay_u on p_payment (pp_seq)   
    ;
create index p_pay_v on p_payment (pp_check_nbr,pp_check_acct,
    pp_check_draft)   ;
create unique index iqsn_ndx1 on iq_salesman_name (iqsn_code) 
      ;
create unique index p_vendor_u on p_vendor (pm_vendor)  
     ;
create index rsbmu_ndx on rs_b_mass_upd (rsbmu_vendor)  
     ;
create unique index ara_ndx on ar_cust_aging (ara_customer) 
      ;
create index aae_idx_3 on ar_ach_entries (aae_pc_cust,aae_inv_gl_nbr,
    aae_pc_cust_flag,aae_glp_seq_nbr)   ;
create index aae_ndx1 on ar_ach_entries (aae_ach_batch_nbr,aae_trace_nbr,
    aae_extract_dt,aae_create_dt,aae_create_time)   
    ;
create index aae_ndx2 on ar_ach_entries (aae_status,aae_pc_cust_flag,
    aae_pc_cust,aae_inv_gl_nbr)   ;
create unique index sys_terms_u on sys_terms (term_code)  
     ;
create unique index ar_customer_u on ar_customer (cust_customer) 
      ;
create unique index rs_cat_u on rs_cat (rsct_catagory)  
     ;
create unique index fm_carrier_u on fm_carrier (fmrr_nbr)  
     ;
create unique index fm_freight_ndx on fm_freight (fmf_origin,
    fmf_dest,fmf_type)   ;
create unique index bnkh_ndx1 on sys_bank_acct (aba_rout,bnk_acct) 
      ;
create index rsbpc_ndx1 on rs_b_price_change (rsbpc_bk_lnk,rsbpc_date_chg,
    rsbpc_user_id)   ;
create index an_ndx2 on ar_altname (an_phone)   ;
create index an_ndx3 on ar_altname (an_cust)   ;
create unique index ar_altname_u on ar_altname (an_customer) 
      ;
create unique index fm_delivery_p on fm_delivery (fmd_movement,
    fmd_invoice)   ;
create index si_invoice_c1 on si_invoice (ih_cust,ih_nbr)  
     ;
create index si_invoice_d1 on si_invoice (ih_date,ih_nbr)  
     ;
create index si_invoice_k1 on si_invoice (ih_shift_link)  
     ;
create unique index si_invoice_u on si_invoice (ih_nbr)  
     ;
create unique index sih_invoice_u on sih_invoice (ihh_nbr)  
     ;
create index i_rs_purcline2 on rs_purcline (rsl_prodlnk)  
     ;
create index rs_purcline_ndx on rs_purcline (rsl_shl,rsl_vendor,
    rsl_inv_nbr,rsl_line_num)   ;
create unique index rs_purch_ndx on rs_purch (rsh_shl,rsh_vendor,
    rsh_inv_nbr)   ;
create unique index p_item_cmb on p_item (ph_vendor,ph_invoice) 
      ;
create unique index p_item_lnk on p_item (ph_lnk)   
    ;
create unique index p_nbr_idx on p_nbr (pno_vendor,pno_invoice) 
      ;
create index p_nbr_lnk on p_nbr (pno_lnk)   ;
create index p_open1 on p_openitem (poi_status,poi_vendor,poi_invoice) 
      ;
create index p_open2 on p_openitem (poi_pay_lnk)   
    ;
create unique index p_open3 on p_openitem (poi_status,poi_vendor,
    poi_invoice,poi_pay_lnk)   ;
create index poi_itm_idx on p_openitem (poi_itm_lnk)   
    ;
create index gl_jap_lnk on gl_jrnl_ap (gljap_shl)   
    ;
create index gljap_idx1 on gl_jrnl_ap (gljap_prft_ctr,gljap_vendor,
    gljap_invoice_nbr,gljap_date,gljap_account)   ;
    
create index gljap_idx2 on gl_jrnl_ap (gljap_date,gljap_account,
    gljap_prft_ctr)   ;
create index gljap_idx3 on gl_jrnl_ap (gljap_shl,gljap_invoice,
    gljap_pp_seq)   ;
create index rs_daily_ndx1 on rs_daily (rsd_shl,rsd_pumpnum,
    rsd_pumpseq)   ;
create index rs_daily_ndx2 on rs_daily (rsd_shl,rsd_blnd_pumpnum,
    rsd_blnd_pumpseq)   ;
create unique index rs_daily_ndx3 on rs_daily (rsd_serial)  
     ;
create index rs_daily_ndx4 on rs_daily (rsd_prft_ctr,rsd_date) 
      ;
create unique index p_ach_u on p_ach (vendor)   ;
create unique index p_ach_sent_u on p_ach_sent (check_nbr)  
     ;
create index p_paysel on p_selection (ps_user_id,ps_print_group,
    ps_pay_seq)   ;
create index p_paysel2 on p_selection (ps_user_id,ps_print_group,
    ps_vendor)   ;
create index i_rs_b_mix on rs_b_mix (item_list_id,zone,stop_date) 
      ;
create unique index ix4899_1 on rs_b_mix (promo_id)   
    ;
create unique index rssg_main on rs_sls_grp (rssg_sls_grp)  
     ;
create index i_rs_pos_tax on rs_pos_tax (trans_lnk)   
    ;
create index i_rs_pos_tender on rs_pos_tender (trans_lnk)  
     ;
create unique index i_rs_pos_lnk on rs_pos_lnk (ctr,business_dt,
    trans_id,register_id)   ;
create unique index i_trans_lnk on rs_pos_lnk (trans_lnk)  
     ;
create unique index i_rs_b_purch on rs_b_purch (invlnk)  
     ;
create index i_rs_b_purch1 on rs_b_purch (invnbr,vendor)  
     ;
create index i_rs_b_purline on rs_b_purline (invlnk,line)  
     ;
create index i_rs_b_purline1 on rs_b_purline (upc)   
    ;
create index i_rs_b_item on rs_b_item (rsbi_sls_grp)   
    ;
create index rsbi_grp on rs_b_item (rsbi_vendor,rsbi_group,rsbi_seq) 
      ;
create unique index rsbi_lnk on rs_b_item (rsbi_ic_lnk)  
     ;
create index rsbi_lnk_cd on rs_b_item (rsbi_ic_lnk,rsbi_code) 
      ;
create unique index rsbi_v_code on rs_b_item (rsbi_vendor,rsbi_code) 
      ;
create index rsbp_bk_edt on rs_b_price (rsbp_bk_lnk,rsbp_ending_date) 
      ;
create index rsbp_bk_stat on rs_b_price (rsbp_bk_lnk,rsbp_status) 
      ;
create index rsbp_main on rs_b_price (rsbp_bk_lnk,rsbp_date,
    rsbp_promo)   ;
create index rsbp_serial on rs_b_price (rsbp_serial)   
    ;
create unique index i_menufield on menu_field (itemlink,menucode) 
      ;
create unique index i_menusecure on menu_secure (itemlink,usercode) 
      ;
create unique index i_menuhead on menu_head (menucode)  
     ;
create unique index sys_parm_u on sys_parm (parm_nbr)  
     ;
create unique index p_mchkvendor on p_mchk (vendor)   
    ;
create unique index p_dchkvendor on p_dchk (vendor,invoice,pay_lnk) 
      ;
create unique index pymgrppaygroup on pymgrp (paygroup)  
     ;
create unique index pyiempempno on pyiemp (empno,recno)  
     ;
create unique index pymptoptocode on pympto (ptocode)  
     ;
create unique index i_sys_zip on sys_zip (zip_code)   
    ;
create unique index gljrnlpy1 on gl_jrnl_py (entry_nbr)  
     ;
create index gljrnlpy2 on gl_jrnl_py (trandate,account,prft_ctr) 
      ;
create index gljrnlpy3 on gl_jrnl_py (account,period)  
     ;
create index pyhchk3 on pyhchk (chkno)   ;
create unique index pyhchk_empno on pyhchk (empno)   
    ;
create unique index pyhchk_recno on pyhchk (recno)   
    ;
create unique index pymptoearn on pympto_earn (ptocode,earncode) 
      ;
create index pymptoearn2 on pympto_earn (earncode)   
    ;
create index i_pyichk on pyichk (recno,paytype,paycode,payauthority) 
      ;
create unique index pyttaxcode on pyttax (taxauthority,taxcode,
    taxstatus)   ;
create unique index fm_delvr_d_p on fm_delvr_d (fmdd_movement,
    fmdd_invoice,fmdd_dt_seq_nbr)   ;
create unique index fm_delvr_d_s on fm_delvr_d (fmdd_serial) 
      ;
create unique index pclr_ndx1 on inv_pur_cstlr (pclr_unique) 
      ;
create index pclr_ndx2 on inv_pur_cstlr (pclr_prft_ctr,pclr_prodlnk,
    pclr_fill_close,pclr_rem_qty)   ;
create index pclr_ndx3 on inv_pur_cstlr (pclr_prft_ctr,pclr_prodlnk,
    pclr_pur_lyr)   ;
create index pclr_ndx4 on inv_pur_cstlr (pclr_type,pclr_serial) 
      ;
create index pclr_ndx5 on inv_pur_cstlr (pclr_movement,pclr_type) 
      ;
create index pclr_ndx6 on inv_pur_cstlr (pclr_prft_ctr,pclr_prodlnk,
    pclr_movement)   ;
create unique index fm_cost_p on fm_cost (fmc_terminal,fmc_vendor,
    fmc_date,fmc_time,fmc_prodlnk)   ;
create unique index fmfc_ndx1 on fm_frgt_cd (fmfc_code,fmfc_vendor,
    fmfc_prod_class,fmfc_date_start,fmfc_date_end)   
    ;
create unique index sys_prft_ctr_u on sys_prft_ctr (prft_ctr) 
      ;
create unique index pydempempno on pydemp (empno,deductcode) 
      ;
create unique index pydemprecno on pydemp (empno,recno,deductcode) 
      ;
create unique index rs_pump_ndx1 on rs_pump (rspf_prft_ctr,rspf_pumpnum,
    rspf_pumpseq)   ;
create unique index i_rs_gl_hdr on rs_gl_hdr (account)  
     ;
create unique index i_rs_gl_det on rs_gl_det (account,tendercode) 
      ;
create index i_rs_pos_payout on rs_pos_payout (trans_lnk)  
     ;
create index i_rs_pos_promo on rs_pos_promo (trans_lnk)  
     ;
create index i_rs_pos_fuel on rs_pos_fuel (trans_lnk)  
     ;
create index i_pyach on pyach (bank_acct,dep_date,dep_amount) 
      ;
create index rs_reading_p on rs_reading (rsr_shl,rsr_pumpnum,
    rsr_pumpseq)   ;
create unique index fm_lading_d_p on fm_lading_d (fmld_movement,
    fmld_bl_nbr,fmld_seq_nbr)   ;
create unique index fm_lading_d_s on fm_lading_d (fmld_serial) 
      ;
create index mov_bl on fm_mv_bal (fmmb_movement,fmmb_bl_nbr) 
      ;
create index mov_dv on fm_mv_bal (fmmb_movement,fmmb_dv_nbr) 
      ;
create unique index fmldt_ndx on fm_lad_tax (fmldt_movement,
    fmldt_bl_nbr,fmldt_line,fmldt_trn,fmldt_ulink,fmldt_type) 
      ;
create unique index tx_table_p on tx_table (tt_code,tt_level,
    tt_where)   ;
create unique index tx_table_u on tx_table (tt_trn)   
    ;
create unique index i_rs_b_zone on rs_b_zone (zone)   
    ;
create unique index i_rs_b_zonedet on rs_b_zonedet (zone,prft_ctr) 
      ;
create index i1_rs_b_zoneitm on rs_b_zoneitm (price_lnk,ic_lnk) 
      ;
create index i2_rs_b_zoneitm on rs_b_zoneitm (zone)   
    ;
create unique index i_rs_b_zoneitm on rs_b_zoneitm (ic_lnk,zone,
    price_lnk)   ;
create index si_inv_line_k1 on si_inv_line (idp_prft_ctr,idp_prodlnk) 
      ;
create index si_inv_line_p on si_inv_line (idp_nbr,idp_seq_nbr) 
      ;
create index si_inv_line_s on si_inv_line (idp_serial)  
     ;
create index i_ar_log on ar_log (sent_date,usercode)   
    ;
create index i_pypayelate on py_paye_late (tranrecno)  
     ;
create unique index i_pypemp on pypemp (empno)   ;
    
create index srl_ndx1 on sys_row_lock (srl_criteria)   
    ;
create index i_rs_pos_item on rs_pos_item (trans_lnk)  
     ;
create unique index pymdedcode on pymded (deductcode)  
     ;
create unique index pymdedsequence on pymded (sequence,deductcode) 
      ;
create unique index pymearncode on pymearn (earncode)  
     ;
create unique index pymearnsequence on pymearn (sequence,earncode) 
      ;
create unique index pymtaxcode on pymtax (taxauthority,taxcode) 
      ;
create unique index pymempempno on pymemp (empno)   
    ;
create unique index pymempname on pymemp (lastname,firstname,
    empno)   ;
create unique index pymempphone on pymemp (phone,empno)  
     ;
create unique index pymempsocsecno on pymemp (socsecno)  
     ;
create unique index pymhis1 on pymhis (glcode,chkno,tranrecno) 
      ;
create unique index pymhisempno on pymhis (postno,empno)  
     ;
create index pymhispayend on pymhis (empno,payend,tranrecno) 
      ;
create index pymhistrandate on pymhis (trandate,tranrecno)  
     ;
create unique index pymhistranrecno on pymhis (postno,tranrecno) 
      ;
create unique index pythisempdate on pythis (empno,trandate,
    paytype,paycode,recno)   ;
create unique index pythisempno on pythis (empno,paytype,payauthority,
    paycode,trandate,recno)   ;
create unique index pythisperiodate on pythis (perioddate,recno) 
      ;
create unique index pythissort on pythis (empno,sorttype,paytype,
    sortauthority,payauthority,paycode,recno)   ;
create unique index pythissorttype on pythis (sorttype,paytype,
    sortauthority,payauthority,paycode,recno)   ;
create unique index pythistrandate on pythis (trandate,recno) 
      ;
create unique index pythistranrecno on pythis (tranrecno,empno,
    recno)   ;
create index si_inv_tax_k on si_inv_tax (ilt_nbr)   
    ;
create unique index i_rs_b_dept on rs_b_dept (dpt_nbr)  
     ;
create index i_inv_rec_tax on inv_rec_tax (rcvr_nbr,rcvr_line,
    vendor)   ;
create unique index i_tx_vendor on tx_vendor (vendor,prodtcl,
    use_g)   ;
create index i_inv_rec_lot1 on inv_rec_lot (vendor,rcvr,line_nbr) 
      ;
create index i_si_inv_lot1 on si_inv_lot (inv_nbr,line_nbr,loc) 
      ;
create index i_inv_cnt_lot1 on inv_cnt_lot (countlnk)  
     ;
create unique index i_sys_country on sys_country (c_code)  
     ;
create unique index i_py_letter on py_letter (ltr_no)  
     ;
create unique index i_py_let_line on py_let_line (ltr_no,seq) 
      ;
create index i_inv_rec_line3 on inv_rec_line (pol_prft_ctr,pol_prodlnk,
    pol_date_expct)   ;
create unique index inv_rcvr_line on inv_rec_line (pol_vendor,
    pol_rcvr,pol_line)   ;
create index inv_rec_line_po on inv_rec_line (pol_num)  
     ;


