Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7916127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:41:39+00:00 2026-06-03T14:41:39+00:00

I’m trying to export data from SPSS (Statistics program) to a local mysql database.

  • 0

I’m trying to export data from SPSS (Statistics program) to a local mysql database. For some reason i’m getting the ‘Column count doesn’t match value count’ message. I’m used to getting that error when something in the SQL statement is wrong. But after hours of testing in a lot of different setting, it’s clear that that is not the problem.

SPSS syntax is in SQL. The syntax that will work is for example this one:

SAVE TRANSLATE /TYPE=ODBC
/CONNECT='DSN=localhost;UID=root;PWD=!S%E&u#k;'
/ENCRYPTED
/MISSING=IGNORE
/SQL='CREATE TABLE test1 (jaar double , maand double , dag double , huishoud double , persoon double , verpl double , rit double )'
/REPLACE
/TABLE='SPSS_TEMP_2'
/KEEP=jaar, maand, dag, huishoud, persoon, verpl, rit
/SQL='INSERT INTO test1 (jaar, maand, dag, huishoud, persoon, verpl, rit) SELECT jaar, maand, dag, huishoud, persoon, verpl, rit FROM SPSS_TEMP_2'
/SQL='DROP TABLE SPSS_TEMP_2'.

After running this command the mysql database looks like this:

CREATE TABLE `test1` (
  `jaar` double DEFAULT NULL,
  `maand` double DEFAULT NULL,
  `dag` double DEFAULT NULL,
  `huishoud` double DEFAULT NULL,
  `persoon` double DEFAULT NULL,
  `verpl` double DEFAULT NULL,
  `rit` double DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 

With the following data:

INSERT INTO `test1` (`jaar`, `maand`, `dag`, `huishoud`, `persoon`, `verpl`, `rit`) VALUES
(2005, 1, 3, 1, 1, 1, 1),
(2005, 1, 3, 0, 0, 1, 1),
(2005, 1, 3, 1, 1, 1, 1),
(2005, 1, 3, 0, 0, 1, 1),
(2005, 1, 3, 0, 0, 1, 1),
(2005, 1, 3, 0, 0, 1, 1),
(2005, 1, 3, 0, 1, 1, 1),
(2005, 1, 3, 0, 0, 1, 1),
(2005, 1, 3, 0, 0, 1, 1),
(2005, 1, 3, 0, 0, 1, 1);

So far so good. However, the complete dataset comes with 129 variables (sql fields). The first one that gives a error is called ‘ritid’. When it is inserted along with others, it stops the complete process. But even when inserted alone, it breaks. It creates the table but without any data. As seen below. I’t is strange to me that this type of error shows up. Someone able to give some word of advice?

SAVE TRANSLATE /TYPE=ODBC
  /CONNECT='DSN=localhost;UID=root;PWD=!l*z%J,[;'
  /ENCRYPTED
  /MISSING=IGNORE
  /SQL='CREATE TABLE Test2 (ritid double )'
  /REPLACE
  /TABLE='SPSS_TEMP_2'
  /KEEP=ritid
  /SQL='INSERT INTO Test2 (ritid) SELECT ritid FROM SPSS_TEMP_2'
  /SQL='DROP TABLE SPSS_TEMP_2'.

>Error # 6491.  Text: Case #1 has been dropped
>Insert record failed
>Execution of this command stops.
>[Actual][MySQL] Column count doesn't match value count at row 1

>Error # 6487
>Write request failed - couldn't write any data.

The mysql DB:

CREATE TABLE `Test2` (
  `ritid` double DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

(as said before, no data is present in this one)

EDIT:
When skipping the ‘drop SPSS_TEMP_2’ command, the SPSS_TEMP_2 database turns out exactly the same as the Test2 database.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T14:41:41+00:00Added an answer on June 3, 2026 at 2:41 pm

    Finally I found the solution, with a nice hint from IBM Support.

    There two variables in SPSS (fields in SQL) that are causing the trouble. They are ‘ritid’ and ‘hhid’. When viewed in SPSS, there values occur as numbers without any dot or comma. When exported as a .csv file, there still not showing any problem, although they .csv file does report the same SQL error when importing through mysql.

    But when saving the SPSS file as a .dbf file and opening in FileMaker Pro, the exact same variables are shown as a values with a comma after the first character. There should be one though; the nature of the data doesn’t want one over there. But still…

    To make the export from SPSS to mysql possible, I changed the ‘type’ field of the variables in SPSS to ‘type=string’ instead of ‘type=numeric’. That makes the export possible.

    Still, there are a couple of things to think about. For instance, exporting them this way has some implications for importing them back again, since they tend to do contain a comma. But that’s easily to cath by editing the sql data in mysql with PHP.

    Thanks for all the suggestions!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have some data like this: 1 2 3 4 5 9 2 6
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.