BlockSplitMake.sql 777 B

123456789101112131415161718192021
  1. /* syntax version 1 */
  2. pragma UseBlocks;
  3. insert into @t
  4. select
  5. Unwrap(cast(fdate as Date)) as `date`,
  6. Unwrap(cast(fdatetime as Datetime)) as `datetime`,
  7. Unwrap(cast(ftimestamp as Timestamp)) as `timestamp`,
  8. Unwrap(cast(ftzdate as TzDate)) as `tzdate`,
  9. Unwrap(cast(ftzdatetime as TzDatetime)) as `tzdatetime`,
  10. Unwrap(cast(ftztimestamp as TzTimestamp)) as `tztimestamp`
  11. from Input;
  12. commit;
  13. select
  14. DateTime::MakeDate(`date`) as rdate,
  15. DateTime::MakeDatetime(`datetime`) as rdatetime,
  16. DateTime::MakeTimestamp(`timestamp`) as rtimestamp,
  17. DateTime::MakeTzDate(`tzdate`) as rtzdate,
  18. DateTime::MakeTzDatetime(`tzdatetime`) as rtzdatetime,
  19. DateTime::MakeTzTimestamp(`tztimestamp`) as rtztimestamp
  20. from @t;