首页 > SAP > HANA > How to create SAP HANA SQL Synonym
2019
08-27

How to create SAP HANA SQL Synonym

Hello everyone in this blog you will learn to create SAP HANA SQL synonym in SAP HANA. Lets get started.

1.What is SAP HANA SQL Synonym

SAP HANA SQL Synonym is an alternative name created for a table, view, procedure and sequence in SAP HANA. There are two types of synonyms

Private Synonym
Public Synonym

2.Prerequisites

You should have a table (or) view (or) procedure (or) sequence created in a schema

3.Syntax

Synonym can be created by using following SAP HANA SQL syntax

CREATE [PUBLIC] SYNONYM <synonym_name> FOR <table_name> or
<view_name> or
<procedure_name> or
<sequence_name>

4.Step-by-Step Procedure

1. Login to SAP HANA Studio.

2. Identify the table for which you want to create a Synonym. In this example i am going to create a synonym for the table “ARTCILE_INFO” which is in the schema “SAPLEARNERS”.

3. Right click on the table and choose New Synonym.

4. Provide the synonym name and click on Execute. Select Public checkbox to create a public synonym (or) leave it blank to create a private synonym. In this example i am creating a private synonym “SY_ARTICLES”.

5. After executing, a new private synonym will created successfully in the Synonym folder in the schema.

6. If you have selected the check box Public while creating the synonym in Step-4, a public synonym will be created in Public Synonym folder.

7. Now you can directly the query on the table with synonym name as below

SELECT * FROM P_SY_ARTICLES

Congrats! You have successfully created Synonym in SAP HANA. Please stay tuned for SAP HANA tutorials. Leave a comment in the below comment section and let us know your feedback.

最后编辑:
作者:yangsen
本站为个人博客网站,全由我个人维护,记录工作学习过程, 有SAP相关询问专、兼职工作可随时联系我。 有网站相关的问题可直接在文章下方留言,或者联系我。 邮件:yan252@163.com给我。 QQ:415402519