Controlling WKF table field length | Community
Skip to main content
March 3, 2020
Solved

Controlling WKF table field length

  • March 3, 2020
  • 1 reply
  • 12349 views

I have a schema with a string field of length 2100.

In enrichment, an expression field is added which does a substring of that field such as this: Substring(@recommendation, 101, Length(@recommendation)-100)

 

 

This is the error I get:

03/03/2020 12:01:29 PM enrich PostgreSQL error: ERROR: value too long for type character varying(255)

 

Which mean the WKF field is created with length of 255, while the source of that expression field is much longer than that.

 

Is there a way to define the length for the expression field or maybe controlling the WKF field length instead?

 

 

 

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 Jonathon_wodnicki

Hi,

 

This isn't possible with ordinary ootb query activities.

Alternative options in descending order of maintainability:

  • Use sql or js activity to alter the temp table's structure and populate it with substrings
  • Write substrings to a file then load them into workflow with Data loading (file) activity formatted with long text col
  • Create a permanent temp schema with big string col and in workflow truncate then use Update data activity to write substrings to it, with outgoing transition (replaces enrichment)
  • Create your own temp schema in the workflow in js with undocumented registerSchema(), setSchemaSqlTable(), buildSqlTable(), etc.

 

Thanks,

-Jon

1 reply

Jonathon_wodnicki
Community Advisor
Jonathon_wodnickiCommunity AdvisorAccepted solution
Community Advisor
March 3, 2020

Hi,

 

This isn't possible with ordinary ootb query activities.

Alternative options in descending order of maintainability:

  • Use sql or js activity to alter the temp table's structure and populate it with substrings
  • Write substrings to a file then load them into workflow with Data loading (file) activity formatted with long text col
  • Create a permanent temp schema with big string col and in workflow truncate then use Update data activity to write substrings to it, with outgoing transition (replaces enrichment)
  • Create your own temp schema in the workflow in js with undocumented registerSchema(), setSchemaSqlTable(), buildSqlTable(), etc.

 

Thanks,

-Jon

awijayaAuthor
March 3, 2020

Hi Jon,

These are really thoughtful answer. Thank you for that.

I ended up using Edit Schema activity to create the expression. 

Btw, how do you find those undocumented js functions? I tried to look them up under Configuration > JavaScript codes, but they are not there.

Thanks,

- Alwi