Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

Check Column Type in Calculation View

$
0
0

Hi All,

Before coming to actual problem, let me tell you a little background about the scenario.

 

 

Tables are replicated using SLT from a Java based system (SAP MII) to HANA. The table (say TABLE_1) contains a column of type DATE.

SLT be default converts the DATE type to NVARCHAR while replicating.Hence in HANA the column type is NVARCHAR.

 

Now, in HANA I am converting this column to SAP_DATE format (YYYYMMDD) by using the formula

leftstr(replace("COLUMN_NAME",'-',''),8)

 

 

 

Problem:

The MII (The source system) can also be on HANA. So there are 2 scenario possible.

  1. MII is using some other DB and it is connected to HANA using SLT.
  2. MII is itself is on HANA and no SLT is required.

 

 

In scenario 2, since there are no SLT, the column type is DATE in HANA. Therefor the expression leftstr(replace("COLUMN_NAME",'-',''),8) gets failed.

 

We need to check the data type of column and then change the expression dynamically. For example

If (COLUMN-DATA-TYPE = DATE)

{

convert to string and the apply the expression leftstr(replace("COLUMN_NAME",'-',''),8)

}

Else If (COLUMN-DATA-TYPE = NVARCHAR)

{

apply the expression leftstr(replace("COLUMN_NAME",'-',''),8)

}

 

 

There are system tables/views which can be used to check column data type. But all there are Row-based. We can not use row-based table in calculation view.

Also if we use them some additional privileges will be required for all end-users who need to check output of the views.

 

 

Awaiting suggestion/ideas. Thanks.

 

Regards,

Raja


Viewing all articles
Browse latest Browse all 6412

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>