Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Unexplained value in SQL field
Message
From
09/10/2006 14:34:43
 
 
To
09/10/2006 14:31:35
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01160578
Message ID:
01160669
Views:
8
>If you are on the vfp-backend side have in your schema
>Member.NoSchool N(6)
>and hardcode your SQL as nvl(Member.NoSchool, CAST(0 as N(6,0)) you could get problems if you change your schema to
>Member.NoSchool N(9)
>you will get overflows again, if you by any chance change into
>Member.NoSchool C(12)
>you will return a wrong type. CAst(nvl(Member.NoSchool, 0) as N(6)) at least will guarantee the same field type in the resulting cursor, but you can run into overflows from the changed field type N(9). But if you datadrive like
>lcCast = " CAst(nvl(Member.NoSchool, 0) as " + Type("Member.NoSchool") + "(" + Fsize("NoSchool", "Member") + ")"
>or go via afields() for decimal places as well you can change your DB schema without worry.

Ok, thanks

For now, I only use that approach for Integer. All relation fields used in those INNER JOIN are on integer.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Reply
Map
View

Click here to load this message in the networking platform