Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is this a bug in CREATE CURSOR command?
Message
From
19/12/2004 09:22:40
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
19/12/2004 09:14:54
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00970382
Message ID:
00970383
Views:
16
>Hi, everyone
>
>Yesterday I was converting a MS SQL script into a VFP Create Cursor command. The script creates tables and I changed it to create VFP cursors. One of the lines in the original script was
>
>CREATE TABLE MyTable (MyField DECIMAL(10,2)).
>
>Surprise, surprise. The above command, modified as CREATE CURSOR MyCursor (MyField DECIMAL(10,2)) does not error, but instead creates a DATE datatype field. Not to mention it took me half of a day to find what the problem is (INSERTS failed constantly and I had thousands of fields in the script).
>
>Further investigations shown that
>
>
>CREATE CURSOR MyCursor (MyField DOLGHIN(10,2))
>
>
>does not error, but instead creates a DATE field in the cursor.
>
>Is this a bug or a known issue?
>
>
>Thank you.

Well, it seems quite clear, to me, what happened. If you look at the syntax, after the field name you are supposed to put a single letter, to indicate the field type. "D" is short for "Date". Perhaps VFP is a little flexible, in case you want to write "DATE" instead of "D", for instance.

And perhaps we might consider it a bug, with the idea that VFP should reject anything except "D" and "date" (and the equivalents for other field types).

But anyway, that is what is obviously happening. VFP just looks at the of the field type, and decides that it is a date.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform