/scripts/ahub.form.attachments.js
0

SAP HANA CDS - Assign Alias

Nov 21, 2016 at 10:35 AM

156

avatar image
Former Member

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Thomas Jung
Nov 23, 2016 at 02:28 PM
1

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.

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member
Nov 28, 2016 at 01:04 PM
0

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!

Share
10 |10000 characters needed characters left characters exceeded
Skip to Content