Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
14 replies
Subscribers
8 subscribers
Views
6753 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
Updated CDT error
judym598
Certified Senior Developer
over 8 years ago
I was recently updating a data type and when Appian validated it with the data store, I got the following error, "The data source schema does not match the type mappings: Wrong column type in Appian.pshactiveagreementsdetail_v for column urlfordocuments. Found: text, expected: varchar(255)"
This data store contains data types associated with views. I recently changed the size of one of the fields in the original table used in this view from a varchar(450) to varchar(1000). The table still shows it as varchar but the view shows it as 'text'. Since the type I selected for this field in the CDT is 'Text', why am I getting this error? Why is it showing up as text in my view vs a varchar type? I'm guessing because of the size. Can I safely change the type in my table to 'text'? I have several tables that have fields with a varchar type > 255. Is that a problem? I need this view in order to display data from multip...
OriginalPostID-235237
Discussion posts and replies are publicly visible
0
judym598
Certified Senior Developer
over 8 years ago
...le tables in a user input form and on a record.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Stefan Helzle
A Score Level 3
over 8 years ago
Changing to text should not be a problem. If this field is part of an index it might be an issue. You can also modify your CDT to match the field definition. See:
forum.appian.com/.../Custom_Data_Types_from_XSD.html
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
marky
over 8 years ago
forum.appian.com/.../Custom_Data_Types_from_XSD.html
This will let you know how to map the CDTs to the database table/views columns. Note: some column data types are not supported in Appian, such as Oracle CLOBs.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
judym598
Certified Senior Developer
over 8 years ago
We're using MySQL 5.6.32 (Appian 16.2 - cloud). I read the documentation on this and it appears as if the XSD should be of type 'string' which I have it but in the column section, it shows varchar(255). I read through entries in the Forum and found nothing to indicate that having a varchar size > 255 would be an issue.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Colton Beck
over 8 years ago
Alternatively you may be able to cast the field as char(255) in the view definition. Then you wouldn't need to make a CDT update.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
judym598
Certified Senior Developer
over 8 years ago
This field is not part of an index. I'm guessing if I don't want to change the type in the table to 'text(1000)', I could add the @Column notation like this:
<xsd:element name="renewalStatus" nillable="true" type="xsd:string" />
<xsd:annotation>
<xsd:appinfo source="appian.jpa">
@Column(columnDefinition="TEXT")
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
Does this make sense? (see attached)
Colton - If I did as you suggested, I would have to cast it as 'char(1000)' to match the table definition, right?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Colton Beck
over 8 years ago
Yes that's correct. I missed that piece of your question.
Also, if your CDT is expecting varchar(255), you'll probably need to update that to reflect the change to 1000.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
judym598
Certified Senior Developer
over 8 years ago
Colton - I tried updating the view as you suggested, specifically included the following when I updated my view:
CAST(`a`.`urlfordocuments` AS CHAR(1000)) AS `urlfordocuments`,
and it still showed up as 'text'. I tried validating my DS and got the same error ("Wrong column type in Appian.pshactiveagreementsdetail_v for column urlfordocuments. Found: text, expected: varchar(255)" I guess I will need to use the jpa notation to update the view.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
chandu
A Score Level 2
over 8 years ago
If I understand correctly, u have changed the original table column from varchar(450) top varchar(1000). In this case can you delete the view, Create it again,
and Check the Cloumn Definition. Is that still showing as "Text"?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
chandu
A Score Level 2
over 8 years ago
Hi judy if the view still shows as "text" can you check with the annotation (columnDefinition="TEXT",length=1000)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
>