Wiki

Scale Your Enterprise

User Tools

Site Tools

mbstring extension must be loaded in order to run mPDF

bw:hana_sql_tips

This is an old revision of the document!


HANA SQL Tips

This page offers some tips for users that have experience with T-SQL (Microsoft SQL Server) and are switching to SAP HANA SQL.

  • HANA database objects (tables, columns, etc.) are enclosed in double-quotes. Tables do not need to be but it is easier to do it for consistency.
  • HANA database objects are case-sensitive. For example, “CardCode” is valid while “cardcode” would not be recognized.
  • When dealing with null values, the HANA expression is IFNULL, not ISNULL. Otherwise the syntax is the same.
  • HANA uses the function CURRENT_DATE instead of getdate().
  • HANA uses the function EXTRACT instead of DATEPART.
EXTRACT ({YEAR | MONTH | DAY | HOUR | MINUTE | SECOND} FROM <datevalue>)
  • In many places, SAP Business One (and other applications) store the date and time in two separate columns. At the same time, it may be necessary to have the two values combined into a single DateTime value. An example of this is for use in a Versago calendar report. The following SQL statement (SQL Server only) is used to create the single DateTime value.
add_seconds(t0."createDate",(round((t0."createTime"/100),0) * 3600) + ((t0."createTime" - (round((t0."createTime"/100),0)*100)) * 60)) as "CreateDateTime"
bw/hana_sql_tips.1570799544.txt.gz · Last modified: 2019/10/11 09:12 by runger