SQL Server administration and T-SQL development, Web Programming with ASP.NET, HTML5 and Javascript, Windows Phone 8 app development, SAP Smartforms and ABAP Programming, Windows 7, Visual Studio and MS Office software
Development resources, articles, tutorials, code samples, tools and downloads for SAP HANA and ABAP, HANA Database, SQLScript, SAP UI5, Screen Personas, Web Dynpro, Workflow

Cannot Create Row Table Having Identity Column on HANA Database

SAP HANA database developers can not create row table with identity column since this feature is not supported. SQLScript programmers can create identity column only in a column table.

Following CREATE TABLE command (DDS: Data Definition Statement) intends to create a row table having an identity column ID

CREATE TABLE Users (
 UserId int generated by default as identity(start with 1 increment by 1) NOT NULL,
 UserName nvarchar(50) NOT NULL
);
Code

Execution of above SQL command on HANA database results with following exception:

Could not execute 'CREATE TABLE Users ( UserId int generated by default as identity(start with 1 increment by 1) NOT ...'
SAP DBTech JDBC: [7]: feature not supported: cannot create row table having identity column: USERID: line 2 col 2 (at pos 23)

If HANA databaseSQL programmer changes the Row Table type to Column Table type using CREATE COLUMN TABLE syntax, table creation will be completed successfully

CREATE COLUMN TABLE Users (
 UserId int generated by default as identity(start with 1 increment by 1) NOT NULL,
 UserName nvarchar(50) NOT NULL
);
Code

So as we understand from this error row tables don't support identity columns or columns generated as identity. However, column tables can be easily created with identity columns.



SAP HANA and ABAP

Install SAP Free
CRM Companies List
Web Based CRM Software


Copyright © 2004 - 2021 Eralper YILMAZ. All rights reserved.