Thursday, 22 August 2013

DECODE with NULL values

DECODE with NULL values

i want to insert ZEROS or Spaces when the value is NULL
i tried for small column length and it worked:
INSERT INTO ABCTABLE (COLUMN1)
VALUES ('DECODE(MDSE_CD,NULL,''000'',LPAD(TO_NUMBER(MDSE_CD,''3'','' ''))');
But how do i execute the second query that has around 400 column length:
INSERT INTO ABCTABLE (COLUMN1)
VALUES ('DECODE(MDSE_CD,NULL,''see notes
below'',LPAD(TO_NUMBER(MDSE_CD,''400'','' ''))');
Note:How do i insert 400 zeros or spaces when the column is NULL

No comments:

Post a Comment