cancel
Showing results for 
Search instead for 
Did you mean: 

Hana table creation ?

Former Member
0 Kudos

Hi to  every one,

Ii would like to know regarding the table creation in hana ? Ur suggestions accepted.

Thanks.

Accepted Solutions (0)

Answers (7)

Answers (7)

Former Member
0 Kudos

hi,

We can create table in following ways:

Row Store-

create TABLE <schema name><table name>

(col1 [constraint1] ,col2…..coln);

Column Store

create COLUMN TABLE <schema name><table name>

( col1,col2[constraint2]...);

Regards,

Vikram NIppani

Former Member
0 Kudos

Hi Praveen,

In this hana we  are creating  tables  on  sql  Editor  (SQL Console) .

This table are three type  . they are

  1. Row  store table
  2. Column Store table
  3. Table type.

Before creating  table ,create  schema in catalog

Create schema <schemaname>.

After  that you givening to privileges to that schema.

Grant all  on  schema < schemaname> to _sys_repo with grant option;

Table creaton:

1.Row store table

CREATE  TABLE  "<SCHEMA_NAME>"."<TABLE_NAME>''

(Column Data_Type,

Column Data_Type,

Column Data_Type NOT NULL,

Column Data_Type NOT NULL,

Column Data_Type DEFAULT Default_Value,

Column Data_Type NOT NULL DEFAULT Default_Value,

PRIMARY REY(Colurnn, Column));

2.Column Store Table

CREATE  COLUMN TABLE  "<SCHEMA_NAME>"."<TABLE_NAME>''

(Column Data_Type,

Column Data_Type,

Column Data_Type NOT NULL,

Column Data_Type NOT NULL,

Column Data_Type DEFAULT Default_Value,

Column Data_Type NOT NULL DEFAULT Default_Value,

PRIMARY REY(Colurnn, Column));

3.Table Type


CREATE  TYPE  "<SCHEMA_NAME>"."<TABLE_NAME>'' AS TABLE

(Column Data_Type,

Column Data_Type,

Column Data_Type ,

Column Data_Type,

Column Data_Type,

Column Data_Type);

--After executing the statement you can go to  schema and find the table type under Procedures -> Table Types section.

--Remember that we cannot add record to table type. If you try to insert record, you will get an error.

Converting to one store to anthor store:


ALTER TABLE <schemaname>.<tablename> column --row store to column store.

ALTER TABLE <schemaname>.<tablename> row --column store to row store.


regards,

khaga.

Former Member
0 Kudos

Hi Praveen,

Below official links is more helps for you.

http://help.sap.com/hana/html/sql_create_table.html

&

some more forum also help:

http://www.saphana.com/docs/DOC-3284

Thanks & Regards,

V Srinivasan

chinthan_yajamaan
Active Contributor
0 Kudos

Hi Rahul/Suma,

I have created tables in HANA studio by right clicking on schema name in catalog object, but I am unable to see it in my Repository or Project explorer. Can you please suggest if there is a way to do it?

Thanks & Regards,

Chinthan

vivekbhoj
Active Contributor
0 Kudos

Hi Chinthan,

These tables won't be visible in Project Explorer or Repository.

Only tables created as design time objects can be viewed in Project Explorer or Repository.

Regards,

Vivek

chinthan_yajamaan
Active Contributor
0 Kudos

Hi Vivek,

Thanks for your reply. So do you suggest using only the script mode during development?

Regards

Chinthan

Former Member
0 Kudos

Hello Pravven,

 

In SAP HANA, we can create tables in two ways.

1) Using SQL editor.

2) Using Information Modeler.

We can open SQL editor from i) Quick Launch ii) Right click on your schema --> SQL

Editor iii) Right click on your system --> SQL Editor..

If you are not familiar with SQL you go for Using Information Moduleler.

If you need any information please let me know.

Regards,

Former Member
0 Kudos

Thanks Sbbarao Amarthaluri for your valuable information.

I have an another query pertaining to the business objects, technical mapping document.

I am new to the technical mapping in business objects,

So kindly share me any of the technical documents , thats going to help me out.

Kindly guide me in ths preperation.

Your suggestions are welcome.

0 Kudos

Hi Praveen,

Tables can be created in the HANA repository by the following methods :

1. Using Script editor, specify the Schema name , Table Type (Row/Column) and Columns (Name, type, length etc) and Primary Key as shown below: 

2. Tables can also be replicated from ERP / CRM or any other system to HANA, through standard replication mechanisms.

3. In HANA studio, right click on the Schema name in the catalog object and choose option 'New Table'. A table Definition tab will open and then you can give the table name inputs, Change you Schema and type of table.

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

Hi Praveen ,

You can create tables in SAP HANA using SAP Studio as your frontend.

When you have added a system in your studio, click on the SQL Editor and you can type the following SQL:

1) Create Schema <Schema_Name>;

 

1) For  a row based table 

CREATE TABLE "<SCHEMA_NAME>"."<TABLE_NAME>'' ( publisher INTEGER, name VARCHAR(50), price DECIMAL, cnt INTEGER);

2) For a Columnar table creation :

CREATE COLUMN TABLE "<SCHEMA_NAME>"."<TABLE_NAME>'' ( publisher INTEGER, name VARCHAR(50), price DECIMAL, cnt INTEGER);

Please refer to the SQL Guide for more options  create table using the SQL

Another way is to right click on the Schema name in the catalog object and choose option 'New Table'. A table Definition tab will open and then you can give the table name inputs, Change you Schema and type of table. Further you will be able to Create columns along with the data types.

Hope it helps!!

Regards

Rahul Jha

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

Hi all,

I have created a code generator for creating Table .

Steps

Project Explorer>new>others>Database table>Next> <enter table name>.hdbtable

Then put the generated code into that and activate.

Sharing the link for the excel file.

https://drive.google.com/file/d/0B0JxWhe9A09pcU1hNFpTS2dxV1E/view?usp=docslist_api



Thanks & regards,

Arihant