giovedì 14 ottobre 2010

Oracle Insert as select forcing a value for a column

Oracle Tips
<code type="SQL">
INSERT INTO  RPTIMI_W
 SELECT   
 CDIDEDIP,
  CDAZIEND,
  CDDIPEND,
-- Set value of column in a specified value, 
to_number('201010' || SUBSTR(to_CHAR(CLTIMBRA),7,2)) as CLTIMBRA,
  MTTIMBRA ,
  CDVERSOT ,
  CDLIDUSR ,
  CDFUNZIO ,
  FLPRODUZ ,
  FLMANUAL ,
  NRVERSIO ,
  CDUSERID ,
  CDLIVTIM FROM RPTIMI_w where  CDDIPEND = 1 AND CLTIMBRA BETWEEN 20040301 AND 20040331

</code>

Nessun commento:

Posta un commento