Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
darrellbutler
Creator
Creator

MySQL Longtext Data Type

Hi, I'm pulling data from a MySQL database. Several fields are of the type LONGTEXT, when creating a QVD from these extracts the contents of these fields look like a hexadecimal representation of the textual data. The original MySQL field length can be up to 1k characters.

I need to see the actual text as it sits in the source database, when it comes into Qlikview it makes no sense. If anybody has any tips on making this data readable I'd be keen to hear from you.

Many thanks

Darrell

1 Solution

Accepted Solutions
Colin-Albert

I think you will have to use CAST  to change the data from Longtext to char or varchar, specifying the maximum number of characters.

     cast(Fieldname as varchar(255))

Note - Cast is a SQL function so will need to be done in the sql part of the script not the QlikView section of the load.

View solution in original post

8 Replies
Anil_Babu_Samineni

May be use Text(FieldName) as Field..

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
darrellbutler
Creator
Creator
Author

Thanks Anil, I tried that but it didn't work !

Anil_Babu_Samineni

Can you show the image in MySQL and Qlikview after load the values?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
darrellbutler
Creator
Creator
Author

mysql issue.PNG

Hi Anil, on the left we have the field, "title" when loaded into QV12 and on the right is the source data.

Colin-Albert

I think you will have to use CAST  to change the data from Longtext to char or varchar, specifying the maximum number of characters.

     cast(Fieldname as varchar(255))

Note - Cast is a SQL function so will need to be done in the sql part of the script not the QlikView section of the load.

Anil_Babu_Samineni

How you are created the table. Can you show the table struture and definition of table. I am assuming you may need to change from byte to Character using Cast..

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
darrellbutler
Creator
Creator
Author

Many thanks guys, I had to use Convert as I think we're on an older version of MySQL and cast isn't supported. It appears to have worked can I both give you correct answer status ?

Colin-Albert

Its only 1 correct and numerous helpfuls.