SAP CAP Blog Posts
cancel
Showing results for 
Search instead for 
Did you mean: 

As in most contexts, there are some name restrictions in the underlying database systems, with regards to unusual or special characters, or reserved words. When you use names like this in your CDS models they are escaped when they're converted to the equivalent DDL, and in all queries sent to the database.

The names are escaped in the DDL by enclosing them in double quotes. Here's an example:

CREATE TABLE BadNames (
  "a name" NVARCHAR(255),
  "drôle"  NVARCHAR(255),
  "select" NVARCHAR(255),
  "group"  NVARCHAR(255)
);

While it's not good practice to define element names like this, CDS allows for such definitions.

Take the first element in this DDL definition: "a name". To express this name, which contains whitespace, in the CDS model, it would also need to be escaped. Not using double quotes as above, but using the CDS model convention.

In other words, here's what the CDS model source might have started out looking like:

entity BadNames {
  SOMETHING : String;
}

But what would have needed to appear in place of the SOMETHING here?

This is a question from the June Developer Challenge on CAP Knowledge. And don't forget: always submit your answer as a hash, on its own - read the Taking part section of the intro post for more info. At the end of today, this question will be updated with links to further reading on this topic.

Further info:

31 Comments
Swathi_SAP_Philomath
Participant

cc3acb5bec547e09a5dbce76210b048b49644cecfd4f8ca6bb31ca8453f32e23

mvaibhav
Contributor

a1ce1bea2833ab3e5a896536749df224d94d4efb193514b9b6909f4a380f08c8

furkan5
Participant

941b90765f6dcb963fb7e1c83d3b7855f82fc7a31d764ba71bf01ac37ebc8bca

 

FlorianP1
Explorer

01917a45235172926faae041c79ee8e1f6e4d00a0cb08a0a65e308c0cf7d5024

shotokka
Explorer

ec361ea4572f242227a58d5393cd21490079a1319486d0715b1aaf3528cdc2ad

Joery
Participant

f68b78474ce22afd06f5810d024f2c155ca69ade1aa191ae2163ce306bbc34d9

soheil_st
Explorer

492de374de4d6cd667489b83673f47435868bbed90cd10d92b826f801913fd9a

d868d468eaefcddc9c98eaad1c78f72172cf5eb3602f61ef4d32353a17992fc8

SachinArtani
Active Participant

4202e90f917e773c1dfbcc83bd6d8e329e1e025b88ea18a1462a6ec7d1972ab8

berkaydurmaz
Explorer

9168380c976b7610cd8cafc658f4e118d587b2cf20601b99cad384fec163717a

VishnAndr
Active Contributor

2e06ee1fc1b22044b312833dccde1768c563e9f82610ef702b963a2ea964f443

Rupesh_Kumar25
Explorer

c60be21228a5e94849b88e917739d1dd58013723bb431ff665a3103aabe17bc8

ajmaradiaga
Developer Advocate
Developer Advocate

a6db06ef903db28ce718afc87e64bdb285e52ea5b90545fdae91460c51bea5a4

lidavidlee
Explorer

496c04e38e54dd4e9e21db7c9addba80ebfd7d064a3db1a36d0fdd78b6fe2dec

Chaimae_Chairi27
Participant

af2e13c15d295e7754bc9a8b6d95ddde4535fb16eb832f06ebf8ba58ebc1e5f5

Dan_Wroblewski
Developer Advocate
Developer Advocate

2f261abbfda57e6f13d34a1fb4dd89b4036dd4b84dc7580b6cba7c0cb5f06b7d

parthasaradhi
Explorer

bfb9ab6909af7692e7cf0fde893075a67c3b0432e78fd696e6863d340c72f719

Caisi
Explorer

7d462b6259759132969dcb539754d92646d401279b7d5d72102497075c4c939e

MioYasutake
SAP Champion
SAP Champion

c0662e31b7a1d78edacc9ecf0dc0e110b347199c165cd6dcb6f352a9067a702b

aelghannam
Participant

dda342b67a20e140cd4617041eb3bf7acffd6f9550c2cb9f67a9d655fa2a89af

NakulG
Explorer

9f9ed61be578c3d6d8cffb70952694814d1619106d11adb7d583a4aadc6d3b90

SergioG_TX
SAP Champion
SAP Champion

d8026cec50906f519ba075f553400688f356685ca0980192acfefa7ad4580957

kasch-code
Participant

8da57c985788b2bb8d972f7e3f920e432e241f3149f9c546a36a40ada15468ef

Laco
Participant

8231c6725e8b51be1da98258051351aaf2a92a5baabdf6d0eb3020aba190e73e

Anusha2025
Explorer
57881032ab3cd5c01576db93838a2a26715e332ea468c276d1b78ba150844e0e
AndriiDanilishin
Participant

71315e851747475f9b449a99b5256694f804f6d8dd6fe9dc3e4cf7a1e8a62ef3

MatLakaemper
Participant

5875c3eb4e99d759c6f918a79c1da3ae500a8a71f3c661c91a7c94baea0d5c97

nagarjundas_1994
Explorer

3d0d6d708b014e776efcd2f93a9d1431c8f673de0b7e72c150c568d359336eb1

stickman_0x00
Participant

b4d7fa472af366ad9453e71aea518889d4e9d560566b8b3adb3dd32450217197

Ihor_Haranichev
Participant

6f4584a44b324435a57875468aebe3e2911f8f94db10b52fa3942758a2cd87e6

gouthamKumar
Explorer

af65784c82f0d19d21708ac7a27fcebf4448a5cfedc1657477be1b0ff08436ba