Welcome, Guest
Username: Password: Remember me

TOPIC: [ERROR: value too long for type character varying(5)]

[ERROR: value too long for type character varying(5)] 2 years 5 months ago #78394

  • hrshdhgd
  • hrshdhgd's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 29
  • Karma: 0
Hello all,

I am facing a problem where in when I import an external database into LimeSurvey (the database is modified to comply with the import requirements), I get an error message for all the entries which have long comments (in the 'others' option of my survey) saying that the data is too long for a varchar(5) data type declared column. I want to change the varchar(5) data type of those columns to varchar(255). All other entries without comments have been imported successfully. How do I go about doing it? Is it something that can be easily done in LimeSurvey itself or do I have to access the database (using pgAdmin/phpMyAdmin) and do the required changes?

The exact error message "[ERROR: value too long for type character varying(5)]"

Thanks in advance,
H.
Last Edit: 2 years 5 months ago by hrshdhgd.
The administrator has disabled public write access.

Re: [ERROR: value too long for type character varying(5)] 2 years 5 months ago #78404

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6318
  • Thank you received: 812
  • Karma: 242
Hello,

For other, you have another column in LS database.
with ssss for surveyid, gggg for group id and qqqq for qiestion number;

ssssXggggXqqqq : varchar(5) linked with lime_answers.code
ssssXggggXqqqqother : text : for -oth- answer in ssssXggggXqqqq.

Denis
The administrator has disabled public write access.
The following user(s) said Thank You: hrshdhgd

Re: [ERROR: value too long for type character varying(5)] 2 years 5 months ago #78423

  • hrshdhgd
  • hrshdhgd's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 29
  • Karma: 0
Hey DenisChenu,

So how do I change varchar(5) to varchar(255)?

Thanks,
H.
Last Edit: 2 years 5 months ago by hrshdhgd. Reason: I figured out what lime_answers.code is.
The administrator has disabled public write access.

Re: [ERROR: value too long for type character varying(5)] 2 years 5 months ago #78442

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6318
  • Thank you received: 812
  • Karma: 242
You can change it in database with phpmyadmin, but you need an answer with the same code.

The best is to use 2 column like LimeSurvey ....
The administrator has disabled public write access.
The following user(s) said Thank You: hrshdhgd

Re: [ERROR: value too long for type character varying(5)] 2 years 5 months ago #78662

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5325
  • Thank you received: 296
  • Karma: 249
It's hard to help if the database was modified. If this is an older Limesurvey database, check the current structure to see which table/column formats might have changed.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Re: [ERROR: value too long for type character varying(5)] 2 years 5 months ago #78882

  • hrshdhgd
  • hrshdhgd's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 29
  • Karma: 0
I figured it out!

1) I filled in dummy data in the LimeSurvey database and in that, filled the comment section with several lines.
2) Exported this database as a csv.
3)Copy-pasted the first two lines on to the old database csv file (which was already arranged to be LS compliant)
4) Imported the file and everything has migrated smoothly into the new LS db.

Thus the varchar(n) adjusted itself without me messing with it.

I thank you both (DenisChenu & Mazi) for your inputs!
The administrator has disabled public write access.

Re: [ERROR: value too long for type character varying(5)] 2 years 5 months ago #78883

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5325
  • Thank you received: 296
  • Karma: 249
hrshdhgd wrote:
I thank you both (DenisChenu & Mazi) for your inputs!
You're welcome :-)

If our hints have been helpful and you enjoy limesurvey please consider a donation to give Limesurvey a future .
We do all this in our free time and you don't have to pay a penny for this software.

Without your help we can't keep this project alive.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.173 seconds
Donation Image