× Heads up!

Aqua Data Studio / nhilam

Follow
IDE for Relational Databases
×
ivangron reported 2016-03-23T15:40:28Z  · tariqrahiman last modified 2016-10-19T16:35:12Z

Sybase ASE -> Reverse eng. table with computed column incorrectly scripting


customer request Pending verification in other release
Priority Low
Complexity Unknown
Component Script Object
Version 17.0
Reversing the following table with ADS on Sybase ASE 15.7
 
if object_id('dbo.test') is not null
  drop table dbo.test
go  
create table dbo.test  (
  value_date              date          not null
, pool_cr_int_day_basis   varchar(2)    null
, pool_cr_int_day_basis_days as convert(smallint, case pool_cr_int_day_basis when 'C' then datepart(dayofyear, convert(char(4), datepart(year, value_date)) + '1231')
                                                                             when 'B' then 360
                                                                             when 'E' then 365
                                                      end) materialized
, pool_dr_int_day_basis   varchar(2)    null
, pool_dr_int_day_basis_days as convert(smallint, case pool_dr_int_day_basis when 'C' then datepart(dayofyear, convert(char(4), datepart(year, value_date)) + '1231')
                                                                             when 'B' then 360
                                                                             when 'E' then 365
                                                      end) materialized
)
go
 
gives me a garbled result if I reverse the table using full scripting:
 
CREATE TABLE test  (
        value_date                      date NOT NULL,
        pool_cr_int_day_basis           varchar(2) NULL,
        pool_cr_int_day_basis_days      AS  convert(smallint, case pool_cr_int_day_basis when 'C' then datepart(dayofyear, convert(char(4), datepart(year, value_date)) + '1231')
                                                                             when 'B' then 360AS  convert(smallint, case pool_cr_int_day_basis when 'C' then datepart(dayofyear, convert(char(4), datepart(year, value_date)) + '1231')
                                                                             when 'B' then 360when 'E' then 365
                                                      end) materializedwhen 'E' then 365
                                                      end) materialized,
        pool_dr_int_day_basis           varchar(2) NULL,
        pool_dr_int_day_basis_days      AS  convert(smallint, case pool_dr_int_day_basis when 'C' then datepart(dayofyear, convert(char(4), datepart(year, value_date)) + '1231')
                                                                             when 'B' then 360AS  convert(smallint, case pool_dr_int_day_basis when 'C' then datepart(dayofyear, convert(char(4), datepart(year, value_date)) + '1231')
                                                                             when 'B' then 360when 'E' then 365
                                                      end) materializedwhen 'E' then 365
                                                      end) materialized
        )
LOCK DATAPAGES
WITH exp_row_size = 0, reservepagegap = 0, identity_gap = 0
ON [default]
go

Issue #14345

Closed
Fixed
Resolved 2016-07-28T15:38:35Z
 
 
Completion
No due date
Fixed Build v17.0.7-4, v18.0.0-devi-192
No time estimate

About AquaClusters Privacy Policy Support Version - 19.0.2-4 AquaFold, Inc Copyright © 2007-2017