Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SPT w/MySql quirks
Message
From
07/08/2004 16:35:07
James Blackburn
Qualty Design Systems, Inc.
Kuna, Idaho, United States
 
 
To
06/08/2004 16:08:08
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00931420
Message ID:
00931577
Views:
19
This message has been marked as a message which has helped to the initial question of the thread.
Dan,

I have not worked with MySql but I have done a lot of work with Sybase ASA. I was curious if the following made a difference?
  lcSql = textmerge("Select * From User Where UserId = <<pnUserId>>")
>I'm using parameters but I am finding some disturbing quirks w/MySql and Fox.
>
>Take the following simple query.
>
>Select * From User Where UserId = ?pnUserId
>
>
>This works in most cases but not all.
>In one case when the user id is 253 it will not bring down a record.
>
>But if I change the code to this:
>
>Select * From User Where UserId = Cast( ?pnUserId As Signed )
>
>
>This works every time but this is a PITA to add to all integer parameters.
>
>Sometimes bringing down dates from MySql brings down the dates as character fields. I can't reproduce this yet but it seems to be some kind of combination of an aggregate function and an outer join.
>
>The fix for this is to wrap the aggregate function with the date function
>
>Select Date( Max( UserCompany.StartDate ) ) As MaxStartDate
>   From User
>   Left Outer Join UserCompany On
>      User.UserId = UserCompany.UserId
>   Where User.UserId = Cast( ?pnUserId As Signed )
>   Group By UserId
>
>
>Counts and booleans seem to come down as characters most of the time. The only fix for this is to use the Truncate function. This assumes you are dealing with integers.
>
>
>Select Truncate( Count(*), 0 ) As UserCount
>   From UserCompany
>   Where UserId = Cast( ?pnUserId As Signed )
>
>
>Has anyone had similar experiences with MySql? Are there better solutions to the above problems?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform