cancel
Showing results for 
Search instead for 
Did you mean: 

SAP HANA CDS - Assign Alias

jansch
Participant
0 Kudos

Hi all

I just started using CDS to create the database structure.

How can I assign my created tables an alias?

Because they are created in the format of "file_location::context_name.table_name". If I use my tables like that in XSJS for example, it's still kind of 'hardcoded'. If there is a possibility to assign aliases to the tables in CDS, this would save the problem. I would just assign a (hopefully) unique alias for each table and would not have to use the full file path name.

Has anyone had this problem / thought before?

BR

Jan

Accepted Solutions (0)

Answers (2)

Answers (2)

thomas_jung
Developer Advocate
Developer Advocate

You can create database synonym for them. But synonym doesn't have a design time construct until HDI in SPS 11. Of course with HDI as of SPS 11, the namespace part of all design time objects is optional. You could just choose not to have the "file_location" part of the name.

I'm not really getting what you feel is hard coded about this situation however. The package path ensures a globally unique name.

jansch
Participant
0 Kudos

Hi Thomas

I found your post about HDI - really interesting topic. I will try using HCI to solve the "problem".

It's not actually a problem but it would be "nicer" if I could assign alias when copying a project on the same server. In which case the file location changes for the design time objects and needs to be adjusted in all XSJS files and SQL queries.

Thanks for your answer!