Hi Everyone,I have a table with one column type as JSON datatype and using to save the data through write to records. Now I have to export this table data into excel file and share it everyday so I have created a CDT for that table.In CDT it is defaulted to text even I have given longtext datatype. Now there is an issue with the data as the database table have more than 4000 characters the CDT is not allowing more the 4000 so my data into excel is not exceeding more than 4000 characters.Please suggest how to handle this or any alternate better approach.
Discussion posts and replies are publicly visible
You need to manually update the XSD to use @Column(columnDefinition = "TEXT") for the desired column.
does this will help to get the data more than 4000 characters ?
Yes.
HI Mathieu,Thanks for the quick response.I have updated the annotation on XSD file. Now I have observed while querying the data using query record I see the field is not calling complete JSON data it is able to pull only 4497 characters.I have checked the datatype of that particular column in record which is set as follows.
Could you please suggest how to pull all the available JSON data into queryrecord instead of breaking.
Via queryRecord it is limited to 4000 (before 25.1)
You need to use queryEntity.
Now I am trying to create entity and map in datastore but getting this error :
The data source schema does not match the type mappings: Schema-validation: wrong column type encountered in column [JSON_DATA] in table [`LKG_TEST`]; found [longtext (Types#LONGVARCHAR)], but expecting [text (Types#VARCHAR)] (APNX-2-4056-000)
Just created a table and created a data type from the table and this is the XSD that it generated.
Seems like it used LONGTEXT.
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="urn:com:appian:types:S" targetNamespace="urn:com:appian:types:S"> <xsd:complexType name="S_JSON"> <xsd:annotation> <xsd:appinfo source="appian.jpa">@Table(name="S_JSON")</xsd:appinfo> </xsd:annotation> <xsd:sequence> <xsd:element name="id" nillable="true" type="xsd:int"> <xsd:annotation> <xsd:appinfo source="appian.jpa">@Id @GeneratedValue @Column(name="id", nullable=false, unique=true, columnDefinition="INT")</xsd:appinfo> </xsd:annotation> </xsd:element> <xsd:element name="jsontext" nillable="true" type="xsd:string"> <xsd:annotation> <xsd:appinfo source="appian.jpa">@Column(name="jsonText", columnDefinition="LONGTEXT")</xsd:appinfo> </xsd:annotation> </xsd:element> </xsd:sequence> </xsd:complexType> </xsd:schema>
Thanks for all your response and patience, dedication.Able to fetch all the data only when limit the pagination to 200.
You still have the 1MB data cap for queries.