Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

[b] Need to invrease the size of decimal [/b]

Status
Not open for further replies.

sqlmann

Technical User
May 5, 2009
15
IN
the below schema, the length of the column N_MAXPERIODID - Decimal (7) should be increased to 9
DROP TABLE PRGM01_PGIDGEN;

CREATE TABLE PRGM01_PGIDGEN
(
C_PROGRAMCODE VARCHAR(10) NOT NULL,
N_MAXLOCNID DECIMAL(4) NULL,
N_MAXJOBCODEID DECIMAL(3) NULL,
N_MAXCCID DECIMAL(4) NULL,
N_MAXWGID DECIMAL(10) NULL,
N_MAXSUBSTNID DECIMAL(4) NULL,
N_PCCODEID DECIMAL(3) NULL,
N_MAXPERIODID DECIMAL(7) NULL,
N_MAXLOTSEQNUM DECIMAL(7) NULL
);
ALTER TABLE VFW.PRGM01_PGIDGEN
ADD CONSTRAINT PKPRG_PGIDGEN PRIMARY KEY (C_PROGRAMCODE);

GRANT UPDATE, INSERT, SELECT, DELETE ON VFW.PRGM01_PGIDGEN TO RDS400;
GRANT ALTER, DELETE, INDEX, REFERENCES, UPDATE, SELECT, CONTROL, INSERT ON VFW.PRGM01_PGIDGEN TO DB2DBA;
GRANT SELECT, INSERT, DELETE, UPDATE ON VFW.PRGM01_PGIDGEN TO RDSMOJO;
GRANT SELECT, INSERT, DELETE, UPDATE ON VFW.PRGM01_PGIDGEN TO MOJOPRB3;
GRANT UPDATE, INSERT, DELETE, SELECT ON VFW.PRGM01_PGIDGEN TO MOJOPRB2;
GRANT INSERT, DELETE, SELECT, UPDATE ON VFW.PRGM01_PGIDGEN TO MOJOPRB1;
GRANT UPDATE, SELECT, INSERT, DELETE ON VFW.PRGM01_PGIDGEN TO MOJOADM;
GRANT SELECT ON VFW.PRGM01_PGIDGEN TO MOJOINQ;

COMMIT;
 
Sorry i forgot tell the version v.08
 
Sorry sqlmann but I must be missign something here.

What's your question????
 
I want change the decimal to 9..

Please tell me the below code will fix this

1. .. CREATE TABLE PRGM01_PGIDGEN_TMP like PRGM01_PGIDGEN;

i. INSERT into VFW.PRGM01_PGIDGEN_TMP SELECT * FROM VFW.PRGM01_PGIDGEN;

ii. Check for the count of records in both PRGM01_PGIDGEN_TMP & VFW.PRGM01_PGIDGEN; (It should match)

iii. Ran “DROP TABLE PRGM01_PGIDGEN”



CREATE TABLE PRGM01_PGIDGEN

(

C_PROGRAMCODE VARCHAR(10) NOT NULL,

N_MAXLOCNID DECIMAL(4) NULL,

N_MAXJOBCODEID DECIMAL(3) NULL,

N_MAXCCID DECIMAL(4) NULL,

N_MAXWGID DECIMAL(10) NULL,

N_MAXSUBSTNID DECIMAL(4) NULL,

N_PCCODEID DECIMAL(3) NULL,

N_MAXPERIODID DECIMAL(9) NULL,

N_MAXLOTSEQNUM DECIMAL(7) NULL

);

ALTER TABLE VFW.PRGM01_PGIDGEN

ADD CONSTRAINT PKPRG_PGIDGEN PRIMARY KEY (C_PROGRAMCODE);



GRANT UPDATE, INSERT, SELECT, DELETE ON VFW.PRGM01_PGIDGEN TO RDS400;

GRANT ALTER, DELETE, INDEX, REFERENCES, UPDATE, SELECT, CONTROL, INSERT ON VFW.PRGM01_PGIDGEN TO DB2DBA;

GRANT SELECT, INSERT, DELETE, UPDATE ON VFW.PRGM01_PGIDGEN TO RDSMOJO;

GRANT SELECT, INSERT, DELETE, UPDATE ON VFW.PRGM01_PGIDGEN TO MOJOPRB3;

GRANT UPDATE, INSERT, DELETE, SELECT ON VFW.PRGM01_PGIDGEN TO MOJOPRB2;

GRANT INSERT, DELETE, SELECT, UPDATE ON VFW.PRGM01_PGIDGEN TO MOJOPRB1;

GRANT UPDATE, SELECT, INSERT, DELETE ON VFW.PRGM01_PGIDGEN TO MOJOADM;

GRANT SELECT ON VFW.PRGM01_PGIDGEN TO MOJOINQ;

INSERT into VFW.PRGM01_PGIDGEN (SELECT * FROM VFW.PRGM01_PGIDGEN_TMP);
 
That looks fine to me. Give it a try in your test system.

Good luck!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top