Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP Code to MySQL
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01158996
Message ID:
01159082
Views:
21
Hello there, Borislav. Good to hear from you again.

>>Okay. I have a couple of questions. First, what the heck is "x.fsc-x.fsc as Savings"
>>and the other lines like it? Is this just an easy way to set these values to zero?
>>If so, why would the original programmer want to do this? This is a query is used
>>in report generation, and the code does and OLEControl call to Crystal Reports 10.
>>Does this have anything to do with this, folks?
>
>
>I think so. It get zero but keep field type, because if you put: 0 AS Savings you
>will get an integer field, not float or money.

Ah. Ok. That makes sense, but this remark leads me to another question: Does VFP
allow type casting, as in "lfFloatValue = (float) lnSomeIntegerValue?"

>>Also, I know that MySQL supports cursors using embedded SQL (in C), but I have
>>yet to find out via books like "SQL: The Complete Reference 2nd Ed" and "MySQL 2nd Edition"
>>(and web search) if SQL or MySQL supports VFP-like cursors natively. If they don't,
>>would anyone out there suggest the best way to pull this off (besides the way that
>>uses uses a billon variables and doesn't really act like a cursor? :^) )??? I guess
>>I could just throw the cursor away and not use it, but would that be to my
>>advantage?
>
>What do you mean with VFP like cursor?

Well, as far as I've been able to find out, and from the RDBMS' that I've used (Access,
Oracle, postgresql, and MySQL), only VFP uses cursors and cursor adaptors to the extent
that it does. Cursors are used in the other database engines, but they are used rarely.
Also, VFP has it's own way of doing cursors that, as far as I've been able to find out,
isn't compatible with anyone elses cursors, and VFP's way of doing things is not SQL
compliant (as far as I can tell and have read). (The POSIX group would have fun with
Microsoft if they could :^). GOD: I HATE MICROSOFT!!!! (Guess that blows my chances
at an MVP. LOL!! :^) :^) :^)

>and where you want to use it?

Well, I'd love to keep the MySQL code close to the original VFP query, but something
tells me that won't be too possible. I was hoping that I could read all the records
into a cursor, then I could just pass a pointer to the cursor as a parameter to a
PHP function that would dynamically create a report using ezPDF, which is an open
source PDF class for PHP.

>I am not so familiar with MySQL but all articles I read about SQL Sever said:
>Stay away from cursors :-) they decrease speed dramaticly.

Hmmm. Wonder why? You would think that a cursor was nothing more than a memory-allocated
array of records that matched the query criteria, right?(Shrug.) Maybe they are worried
about Windows or SQL Server having to page on large queries or something, and they don't
want to make SQL Server and Windows look bad :^) :^) :^).

Randall
--
Randall Jouett
Amateur/Ham Radio: AB5NI
I eat spaghetti code out of a bit bucket while sitting at a hash table! Someone
asked me if I needed salt, and I said, "I'm not into encryption." :^)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform