oracle table permissions assigned


---------------------------------------------------------------------------------------------

-- Create table
create table COMM.INPUT_WAY_DICT
(
word VARCHAR2(2) not null,
spell_code VARCHAR2(6),
wbzx_code VARCHAR2(4)
)
tablespace ST_RIS;
-- Create/Recreate primary, unique and foreign key constraints
alter table COMM.INPUT_WAY_DICT
add constraint PK_INPUT_WAY_DICT primary key (WORD)
using index ;
alter index COMM.PK_INPUT_WAY_DICT nologging;
-- Grant/Revoke object privileges
grant select, insert, update, delete, references, alter, index on COMM.INPUT_WAY_DICT to SYSTEM;

-----------------------------------------------------------------------------------------------
create or replace noneditionable function f_spell_code(as_name varchar2) return varchar2 is

ls_one_hz varchar2(10);
ls_temp_py varchar2(100);
li_length integer;
i integer;
ls_py varchar2(100);

begin

li_length := length(trim(as_name));

if nvl(li_length, 0) = 0 then
li_length := 0;
end if;

ls_py := '';
ls_one_hz := '';
ls_temp_py := '';
i := 1;

loop

if i > li_length then
exit;
end if;

ls_one_hz := substr(as_name, i, 1);

if ascii(ls_one_hz) > 128 then
ls_one_hz := substr(as_name, i, 1);

begin
select a.spell_code
into ls_temp_py
from comm.input_way_dict a
where a.word = ls_one_hz;

Exception
the when NO_DATA_FOUND the then
ls_temp_py: =; '?'
the when the then Others
return ( 'phonetic code query error !!!');
End;

ls_temp_py := substr(upper(ls_temp_py), 1, 1);
ls_py := ls_py || ls_temp_py;

elsif (ascii(ls_one_hz) >= 65 and ascii(ls_one_hz) < 91) or
(ascii(ls_one_hz) >= 97 and ascii(ls_one_hz) < 123) or
(ascii(ls_one_hz) >= 48 and ascii(ls_one_hz) < 58) then
ls_one_hz := upper(ls_one_hz);
ls_py := ls_py || ls_one_hz;
end if;
i := i + 1;
end loop;

return ls_py;

end;

 


------------------------------------------------------------------------
-- Add/modify columns
alter table INPBILL.PREPAYMENT_RCPT add pos_tradeserialno varchar2(10);
-- Create table
create table COMM.BASE_DICT
(
dict_code VARCHAR2(4) not null,
dict_name VARCHAR2(40) not null,
dict_chinese VARCHAR2(50),
code VARCHAR2(10) not null,
name VARCHAR2(50),
sequences VARCHAR2(10),
vaild CHAR(1),
memorys VARCHAR2(60),
spell_code VARCHAR2(30)
)
tablespace ST_RIS;
-- Add comments to the columns
comment on column COMM.BASE_DICT.dict_code
is '编号';
comment on column COMM.BASE_DICT.dict_name
is' dictionary name ';
Comment ON COMM.BASE_DICT.dict_chinese column
is' Dictionary Chinese name';
Comment ON COMM.BASE_DICT.code column
is' dictionary codes';
Comment ON COMM.BASE_DICT.name column
is' code corresponds Chinese Dictionary value ';
the Comment column COMM.BASE_DICT.sequences ON
IS' No. ';
the Comment column COMM.BASE_DICT.vaild ON
IS' effective? ';
Comment column COMM.BASE_DICT.memorys ON
IS' Remarks';
Comment column COMM.BASE_DICT.spell_code ON
IS 'phonetic code';
- the Create / Recreate Primary, and Foreign Key Constraints UNIQUE
ALTER Table COMM.BASE_DICT
the Add Primary constraint PK_BASE_DICT Key (DICT_CODE, CODE)
the using index
TABLESPACE ST_RIS;

grant select, insert, update, delete on COMM.BASE_DICT to DBA;
grant select, insert, update, delete, references, alter, index on COMM.BASE_DICT to PUBLIC;

--------------------------------------------------------------------------------
alter table INPBILL.PREPAYMENT_RCPT add pos_tradeserialno varchar2(50);
alter table INPBILL.PREPAYMENT_RCPT add pos_tradebeathno varchar2(10);
alter table INPBILL.PREPAYMENT_RCPT add pos_banktrade_date varchar2(10);
alter table INPBILL.PREPAYMENT_RCPT add pos_banktrade_time varchar2(10);
alter table INPBILL.PREPAYMENT_RCPT add pos_refence_no varchar2(12);
alter table INPBILL.PREPAYMENT_RCPT add pos_terminalno varchar2(15);
alter table INPBILL.PREPAYMENT_RCPT add pos_store_no varchar2(15);
alter table INPBILL.PREPAYMENT_RCPT add pos_card_type char(1);
alter table INPBILL.PREPAYMENT_RCPT add POS_TRADE_INDEXNO VARCHAR2(50);
alter table INPBILL.PREPAYMENT_RCPT add refund_flag char(1);
alter table INPBILL.PREPAYMENT_RCPT add refund_old_rcpt_no VARCHAR2(20);

- Comments to the Add Columns The
Comment column INPBILL.PREPAYMENT_RCPT.pos_tradeserialno ON
IS 'the POS transaction serial number';
Comment column INPBILL.PREPAYMENT_RCPT.pos_tradebeathno ON
IS 'the POS transaction batch number';
Comment column INPBILL.PREPAYMENT_RCPT.pos_banktrade_date ON
IS ' POS transaction date Bank hosts ';
the Comment column INPBILL.PREPAYMENT_RCPT.pos_banktrade_time ON
IS' POS transaction banking host time ';
the Comment column INPBILL.PREPAYMENT_RCPT.pos_refence_no ON
IS' POS transaction reference number ';
the Comment column INPBILL.PREPAYMENT_RCPT.pos_terminalno ON
IS' POS transaction terminal number ';
Comment column INPBILL.PREPAYMENT_RCPT.pos_store_no ON
IS' merchant POS transaction number ';
Comment column INPBILL.PREPAYMENT_RCPT.pos_card_type ON
is' POS transaction card type (Dictionary base_dict.XINGLEEPOS) ';
the Comment column ON INPBILL.PREPAYMENT_RCPT.POS_TRADE_INDEXNO
is' POS transaction index number';
the Comment column INPBILL.PREPAYMENT_RCPT.refund_flag ON
IS 'refund flag (1, refunded, 0: No refund) ';
Comment column INPBILL.PREPAYMENT_RCPT.refund_old_rcpt_no ON
IS' original refund receipt number ';
------------------------- ----------------------------------------
the Create Sequence BK.XINGLEE_POS_log_seq
MINVALUE 1
MAXVALUE 9,999,999,999,999
Start 1 with
INCREMENT by 1
Cache 200
Cycle;
----------------------------------------- -----------------------
--- create log log, recording every transaction a bank
- the create the Table
the create the Table BK.XINGLEE_POS_LOG
(
sequenceno NUMBER(20) not null,
tradedatetime DATE not null,
inparm BLOB,
outparm BLOB,
intrade_code VARCHAR2(2),
intrade_cost VARCHAR2(12),
inpos_serialno VARCHAR2(6),
incashier_machine VARCHAR2(10),
incashier_no VARCHAR2(10),
inreference_no VARCHAR2(15),
inauthorize_no VARCHAR2(6),
inold_tradedate VARCHAR2(8),
incard_type VARCHAR2(1),
intrade_indexsno VARCHAR2(76),
intwotrack VARCHAR2(37),
inthreetrack VARCHAR2(104),
inoldtradecode VARCHAR2(2),
inoldterminalno VARCHAR2(15),
inoldauthorize_no VARCHAR2(6),
inpayment_code VARCHAR2(3),
instoreno VARCHAR2(20),
inapplyno VARCHAR2(30),
inorderno VARCHAR2(15),
inoldbatchno VARCHAR2(6),
inoldtradedate VARCHAR2(6),
inoldtradecost VARCHAR2(12),
outresultcode VARCHAR2(6),
outresultmsg VARCHAR2(40),
outpos_serialno VARCHAR2(6),
outauthorize_no VARCHAR2(6),
outbatchno VARCHAR2(6),
outcardno VARCHAR2(19),
outvailddate VARCHAR2(4),
outbankno VARCHAR2(2),
outreference_no VARCHAR2(12),
outterminalno VARCHAR2(15),
outmerchantno VARCHAR2(15),
outtradecost VARCHAR2(12),
outtradeindexsno VARCHAR2(16),
outcustom_field VARCHAR2(74),
outbankcardcode VARCHAR2(8),
outbankmeddate VARCHAR2(8),
VARCHAR2 outbankmedtime (. 6),
outorderno VARCHAR2 (15),
outtradecode VARCHAR2 (2),
outtickettype VARCHAR2 (. 1),
outcodeapplyno VARCHAR2 (96)
)
TABLESPACE TSP_INSURANCE;
- Comments to the Add Columns The
Comment column BK.XINGLEE_POS_LOG.sequenceno ON
IS ' SEQ ID ';
Comment column BK.XINGLEE_POS_LOG.tradedatetime ON
IS' transaction time ';
Comment column BK.XINGLEE_POS_LOG.inparm ON
IS' into the reference string ';
Comment column BK.XINGLEE_POS_LOG.outparm ON
IS' a reference string ' ;
the Comment column BK.XINGLEE_POS_LOG.intrade_code ON
IS 'into the trading symbol';
the Comment column BK.XINGLEE_POS_LOG.intrade_cost ON
IS 'the transaction value';
ON column BK.XINGLEE_POS_LOG.inpos_serialno Comment
IS 'serial number into the POS';
Comment column BK.XINGLEE_POS_LOG.incashier_machine ON
IS 'into the cash register number';
Comment column BK.XINGLEE_POS_LOG.incashier_no ON
IS 'into the cashier number';
ON column BK.XINGLEE_POS_LOG.inreference_no Comment
IS 'the reference numeral';
Comment column BK.XINGLEE_POS_LOG.inauthorize_no ON
IS 'into the authorization number';
Comment column BK.XINGLEE_POS_LOG.inold_tradedate ON
IS 'into the original transactions';
Comment column BK ON .XINGLEE_POS_LOG.incard_type
IS 'into the card type';
Comment column BK.XINGLEE_POS_LOG.intrade_indexsno ON
IS 'index into a transaction';
Comment column BK.XINGLEE_POS_LOG.intwotrack ON
IS 'into two tracks';
ON column BK.XINGLEE_POS_LOG.inthreetrack Comment
IS 'into three tracks';
Comment column BK.XINGLEE_POS_LOG.inoldtradecode ON
IS 'into the original transaction codes';
Comment column BK.XINGLEE_POS_LOG.inoldterminalno ON
IS 'into the original terminal number';
Comment column ON BK.XINGLEE_POS_LOG.inoldauthorize_no
IS 'into the original authorization number';
the Comment column BK.XINGLEE_POS_LOG.inpayment_code ON
IS 'contributions into account coding';
the Comment column BK.XINGLEE_POS_LOG.instoreno ON
IS 'shop No entry';
the Comment column BK.XINGLEE_POS_LOG ON .inapplyno
IS 'into a number of documents';
Comment column BK.XINGLEE_POS_LOG.inorderno ON
IS 'the order number';
Comment column BK.XINGLEE_POS_LOG.inoldbatchno ON
IS 'into the original batch number';
Comment column BK ON.XINGLEE_POS_LOG.inoldtradedate
It is' the primary transactions';
Comment ON BK.XINGLEE_POS_LOG.inoldtradecost column
is' the primary transaction amount ';
Comment ON BK.XINGLEE_POS_LOG.outresultcode column
is' return code';
Comment ON BK.XINGLEE_POS_LOG.outresultmsg column
is' out return code meaning ';
Comment column BK.XINGLEE_POS_LOG.outpos_serialno ON
IS' pos serial out ';
Comment column BK.XINGLEE_POS_LOG.outauthorize_no ON
IS' an authorization code ';
Comment column BK.XINGLEE_POS_LOG.outbatchno ON
IS' the batch number ';
Comment column BK.XINGLEE_POS_LOG.outcardno ON
IS' a card ';
Comment column BK.XINGLEE_POS_LOG.outvailddate ON
IS' a valid ';
Comment column BK.XINGLEE_POS_LOG.outbankno ON
IS' a bank number ';
ON column BK.XINGLEE_POS_LOG.outreference_no Comment
IS ', a reference number';
Comment column BK.XINGLEE_POS_LOG.outterminalno ON
IS 'the terminal number';
Comment column BK.XINGLEE_POS_LOG.outmerchantno ON
IS 'a number of merchants';
Comment column BK ON. XINGLEE_POS_LOG.outtradecost
IS 'the transaction value';
the Comment column BK.XINGLEE_POS_LOG.outtradeindexsno ON
IS 'index number of the transactions';
the Comment column BK.XINGLEE_POS_LOG.outcustom_field ON
IS 'comes from the domain';
the Comment column BK.XINGLEE_POS_LOG.outbankcardcode ON
IS 'departure card bank code';
the Comment column BK.XINGLEE_POS_LOG.outbankmeddate ON
IS 'out of date Bank hosts';
the Comment column BK.XINGLEE_POS_LOG.outbankmedtime ON
IS 'the bank host time';
ON column BK.XINGLEE_POS_LOG.outorderno the Comment
IS 'the order number';
the Comment column BK.XINGLEE_POS_LOG.outtradecode ON
IS 'the trading symbol';
the Comment column BK.XINGLEE_POS_LOG.outtickettype ON
IS 'small ticket print out the way';
the Comment column ON BK.XINGLEE_POS_LOG.outcodeapplyno
IS 'a scan order number code';
- the Create / Recreate Primary, and Foreign Key Constraints UNIQUE
ALTER Table BK.XINGLEE_POS_LOG
the Add constraint PK_XINGLEEPOS_SEQ Primary Key (SequenceNo, TRADEDATETIME)
the using index
TABLESPACE TSP_INSURANCE;

Guess you like

Origin www.cnblogs.com/shanzzs/p/11779572.html