Comparisons Through VFP not working properly
am 15.07.2004 03:08:55 von Daniel Cummings
------=_NextPart_000_0085_01C469CD.A0CDF1C0
Content-Type: text/plain;
charset="US-ASCII"
Content-Transfer-Encoding: 7bit
I'm using SqlPassthrough In VFP 8.0
I"ve got a Sql statement that looks like this.
This following fails:
Update User
Set Active = True
Where UserId = ?pnUserId
pnUserId is 222 in this instance.
The following works fine:
Update User
Set Active = True
Where UserId = 222
The workaround is to cast the parameter "?pnUSerId" to a signed integer
but I'm trying to understand why this is happening.
I created a table from the parameter and it stored it in a table as a
double. It's probably storing it as 221.9999998 which
is why the comparison is failing.
Has anyone seen this behavior?
TIA
Dan
------=_NextPart_000_0085_01C469CD.A0CDF1C0--
Re: Comparisons Through VFP not working properly
am 15.07.2004 16:00:11 von SGreen
--=_alternative 004D0ED485256ED2_=
Content-Type: text/plain; charset="US-ASCII"
I would change the storage type on the table to an int and see how your
pass-through works then.
Yours,
Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine
"Daniel Cummings" wrote on 07/14/2004
09:08:55 PM:
> I'm using SqlPassthrough In VFP 8.0
>
>
>
> I"ve got a Sql statement that looks like this.
>
>
>
> This following fails:
>
> Update User
>
> Set Active = True
>
> Where UserId = ?pnUserId
>
>
>
> pnUserId is 222 in this instance.
>
>
>
>
>
> The following works fine:
>
> Update User
>
> Set Active = True
>
> Where UserId = 222
>
>
>
> The workaround is to cast the parameter "?pnUSerId" to a signed
integer
> but I'm trying to understand why this is happening.
>
> I created a table from the parameter and it stored it in a table as a
> double. It's probably storing it as 221.9999998 which
>
> is why the comparison is failing.
>
>
>
> Has anyone seen this behavior?
>
>
>
> TIA
>
>
>
> Dan
>
>
>
>
>
>
>
>
>
>
>
--=_alternative 004D0ED485256ED2_=--
RE: Comparisons Through VFP not working properly
am 15.07.2004 20:56:02 von Daniel Cummings
Shawn-
Thanks for responding.
The field UserId is Int and its length is 11.
I could try different types of INTs.
In reference to this comment I used the following code.
>I created a table from the parameter and it stored it in a table as a
> double.
Create Table ChkValues Select ?pnUserId From Roles
This was just to determine how MySql was translating the parameter. It
turned out to be a double in this new table.
Dan
-----Original Message-----
From: SGreen@unimin.com [mailto:SGreen@unimin.com]
Sent: Thursday, July 15, 2004 7:00 AM
To: Daniel Cummings
Cc: mysql@lists.mysql.com
Subject: Re: Comparisons Through VFP not working properly
I would change the storage type on the table to an int and see how your
pass-through works then.
Yours,
Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine
"Daniel Cummings" wrote on 07/14/2004
09:08:55 PM:
> I'm using SqlPassthrough In VFP 8.0
>
>
>
> I"ve got a Sql statement that looks like this.
>
>
>
> This following fails:
>
> Update User
>
> Set Active = True
>
> Where UserId = ?pnUserId
>
>
>
> pnUserId is 222 in this instance.
>
>
>
>
>
> The following works fine:
>
> Update User
>
> Set Active = True
>
> Where UserId = 222
>
>
>
> The workaround is to cast the parameter "?pnUSerId" to a signed
integer
> but I'm trying to understand why this is happening.
>
> I created a table from the parameter and it stored it in a table as a
> double. It's probably storing it as 221.9999998 which
>
> is why the comparison is failing.
>
>
>
> Has anyone seen this behavior?
>
>
>
> TIA
>
>
>
> Dan
>
>
>
>
>
>
>
>
>
>
>
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org