This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
bw:hana_sql_tips [2019/04/17 14:48] runger |
bw:hana_sql_tips [2020/08/10 14:34] (current) |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== HANA SQL Tips ====== | + | ======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. | 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. | * HANA database objects (tables, columns, etc.) are enclosed in double-quotes. | ||
| - | * HANA database objects are case-sensitive. | ||
| * When dealing with null values, the HANA expression is **IFNULL**, not ISNULL. | * When dealing with null values, the HANA expression is **IFNULL**, not ISNULL. | ||
| * HANA uses the function **CURRENT_DATE** instead of getdate(). | * HANA uses the function **CURRENT_DATE** instead of getdate(). | ||
| Line 10: | Line 9: | ||
| EXTRACT ({YEAR | MONTH | DAY | HOUR | MINUTE | SECOND} FROM < | EXTRACT ({YEAR | MONTH | DAY | HOUR | MINUTE | SECOND} FROM < | ||
| </ | </ | ||
| + | |||
| + | * In many places, SAP Business One (and other applications) store the date and time in two separate columns. | ||
| + | |||
| + | < | ||
| + | add_seconds(t0." | ||
| + | </ | ||
| + | |||
| + | ====Handling Case Sensitivity==== | ||
| + | HANA database objects are case-sensitive. | ||
| + | |||
| + | The same issue is found when using User Applied Filters in reports. | ||
| + | |||
| + | One way to address this is to add a " | ||
| + | |||
| + | <code SQL> | ||
| + | select | ||
| + | t0." | ||
| + | from " | ||
| + | </ | ||
| + | |||
| + | " | ||