Does column name length in adobe campaign restricted to limited characters? | Community
Skip to main content
Level 3
January 20, 2024
Solved

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

  • January 20, 2024
  • 2 replies
  • 1130 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Manoj_Kumar

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.

2 replies

ParthaSarathy
Community Advisor
Community Advisor
January 21, 2024

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)

~  ParthaSarathy S~  Click here to join ADOBE CAMPAIGN USER GROUP for Quarterly In-person | Hybrid | Virtual Meetups
Manoj_Kumar
Community Advisor
Manoj_KumarCommunity AdvisorAccepted solution
Community Advisor
January 21, 2024

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  | https://themartech.pro