Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

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

[ERROR: value too long for type character varying(5)] 4 years 3 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: 4 years 3 months ago by hrshdhgd.
The administrator has disabled public write access.

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

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 9254
  • Thank you received: 1319
  • Karma: 382
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
Assistance on LimeSurvey forum and LimeSurvey core developpement are on my free time (Say thanks ?).
A bug not reported is a bug not corrected. | Please, read the documentation | La doc en français à besoin de vous
The administrator has disabled public write access.
The following user(s) said Thank You: hrshdhgd

[ERROR: value too long for type character varying(5)] 4 years 3 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: 4 years 3 months ago by hrshdhgd. Reason: I figured out what lime_answers.code is.
The administrator has disabled public write access.

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

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 9254
  • Thank you received: 1319
  • Karma: 382
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 ....
Assistance on LimeSurvey forum and LimeSurvey core developpement are on my free time (Say thanks ?).
A bug not reported is a bug not corrected. | Please, read the documentation | La doc en français à besoin de vous
The administrator has disabled public write access.
The following user(s) said Thank You: hrshdhgd

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

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5974
  • Thank you received: 366
  • Karma: 260
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.

[ERROR: value too long for type character varying(5)] 4 years 3 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.

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

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5974
  • Thank you received: 366
  • Karma: 260
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: 1.246 seconds
Imprint                   Data Protection Statement                  Revocation information and revocation form