Expand my Community achievements bar.

Announcing the launch of new sub-community for Campaign Web UI to cater specifically to the needs of Campaign Web UI users!
SOLVED

Does column name length in adobe campaign restricted to limited characters?

Avatar

Level 4

Hi All,

 

Recently I cam across an issue in adobe campaign classic where the length of a field name exceeded 35 characters and I observed the query (in additional data) in which this field was fetched converted this column name to 's' in sql code which caused an issue pulling this field in the next activity. However adding an alias to this field name reduced its length and the problem was solved.

 

However, In the context of above, Is there a limit of the number of characters for column name in adobe campaign (Note: I'm not asking but data length and clearly asking about column name length).

 

Thank you,

Rutuja Kelkar

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hello @Rut7 

 

If you are using enrichment to create a new attribute based on an attribute defined in an actual schema then it will inherit the length of the attribute defined in the schema.

 

If you want to change the length of that attribute then you can use the ALTER query to update the character length. 

 

Sample Code:

 ALTER TABLE "mytable" ALTER COLUMN "mycolumn" TYPE varchar(LENGTH_IN_NUMBER);

 

Note: If the length is not defined in a string data type field then the default length is 255 characters.


     Manoj
     Find me on LinkedIn

View solution in original post

2 Replies

Avatar

Community Advisor

Hi @Rut7 ,

It depends on the Database. When the workflow runs, a temporary table will get created in the database. These additional data are created as a field (column name) in that temp table.
As per PostgreSQL documentation, it states that 'The system uses no more than NAMEDATALEN-1 characters of a name; By default, NAMEDATALEN is 32 so the maximum name length is 31 (but at the time the system is built, NAMEDATALEN can be changed in src/include/postgres_ext.h)'
So if you exceed this limit, the column name will get truncated. When you use alias with allowed character length, then the actual column name will get replaced by alias's name.

Reference link: https://www.postgresql.org/docs/7.0/syntax525.htm#:~:text=The%20system%20uses%20no%20more,h)

Avatar

Correct answer by
Community Advisor

Hello @Rut7 

 

If you are using enrichment to create a new attribute based on an attribute defined in an actual schema then it will inherit the length of the attribute defined in the schema.

 

If you want to change the length of that attribute then you can use the ALTER query to update the character length. 

 

Sample Code:

 ALTER TABLE "mytable" ALTER COLUMN "mycolumn" TYPE varchar(LENGTH_IN_NUMBER);

 

Note: If the length is not defined in a string data type field then the default length is 255 characters.


     Manoj
     Find me on LinkedIn