Importing bigint to SPSS from MySql

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Importing bigint to SPSS from MySql

Jeff-3
I have data in a mysql database on a server and am trying to import
from a particular table into SPSS. The syntax below works fine with
one exception. One of the database columns is a 'bigint' with length
16 and this field/variable is not importing correctly.

e.g., although the original number appearing in the database is
something like, '96000131851' what shows up in spss is something
like, '14690781825611576'  additionally, it seems that all values in
this particular field show up as the same number even if they don't
start the same in the database table.

all other integers and strings seem to import correctly.

I'm unsure what's going on and how to correct this.

Thanks in advance
Jeff

Get data
  /type=odbc  /Connect="DATABASE=XXXXXXXX;DSN=YYYYYYY;PWD=WWWWWWW;"+
"SERVER=000.00.000.000;UID=UserName"
   /sql='SELECT * FROM table1'.
Exe.
Dataset name Data WINDOW=front.

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: Importing bigint to SPSS from MySql

Albert-Jan Roskam
Hi,
 
What happens if you CAST is as a string?
 
Cheers!!
Albert-Jan


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
All right, but apart from the sanitation, the medicine, education, wine, public order, irrigation, roads, a fresh water system, and public health, what have the Romans ever done for us?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



From: Jeff <[hidden email]>
To: [hidden email]
Sent: Fri, September 3, 2010 1:56:26 AM
Subject: [SPSSX-L] Importing bigint to SPSS from MySql

I have data in a mysql database on a server and am trying to import
from a particular table into SPSS. The syntax below works fine with
one exception. One of the database columns is a 'bigint' with length
16 and this field/variable is not importing correctly.

e.g., although the original number appearing in the database is
something like, '96000131851' what shows up in spss is something
like, '14690781825611576'  additionally, it seems that all values in
this particular field show up as the same number even if they don't
start the same in the database table.

all other integers and strings seem to import correctly.

I'm unsure what's going on and how to correct this.

Thanks in advance
Jeff

Get data
/type=odbc  /Connect="DATABASE=XXXXXXXX;DSN=YYYYYYY;PWD=WWWWWWW;"+
"SERVER=000.00.000.000;UID=UserName"
  /sql='SELECT * FROM table1'.
Exe.
Dataset name Data WINDOW=front.

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD

Reply | Threaded
Open this post in threaded view
|

Re: Importing bigint to SPSS from MySql

Gad Chen
In reply to this post by Jeff-3
I guess you are using old version of SPSS. e.g. version 12.

One solution I did before is to create the SQL View to covert bigint into
Float. Then just select * from V_Table1.

Cheers.

Gad

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Jeff
Sent: Thursday, September 02, 2010 4:56 PM
To: [hidden email]
Subject: Importing bigint to SPSS from MySql

I have data in a mysql database on a server and am trying to import
from a particular table into SPSS. The syntax below works fine with
one exception. One of the database columns is a 'bigint' with length
16 and this field/variable is not importing correctly.

e.g., although the original number appearing in the database is
something like, '96000131851' what shows up in spss is something
like, '14690781825611576'  additionally, it seems that all values in
this particular field show up as the same number even if they don't
start the same in the database table.

all other integers and strings seem to import correctly.

I'm unsure what's going on and how to correct this.

Thanks in advance
Jeff

Get data
  /type=odbc  /Connect="DATABASE=XXXXXXXX;DSN=YYYYYYY;PWD=WWWWWWW;"+
"SERVER=000.00.000.000;UID=UserName"
   /sql='SELECT * FROM table1'.
Exe.
Dataset name Data WINDOW=front.

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD