Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can you force Integer datatype in query?
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00427622
Message ID:
00428308
Views:
15
>Bill,
>
>This works for me:
>
>create cursor x1 ( i1 i, c1 c(10))
>insert into x1 values ( .null., .null. ) && throws error
>alter table x1 alter column i1 null
>alter table x1 alter column c1 null
>insert into x1 values ( .null., .null. ) && works now
>
>
>>That's what I was afraid of. I'm going to return -999 from my Get_Age() function, instead of NULL. It seems that my REAL problem is that the CURSOR that VFP creates, doesn't allow NULLs, I thought that was because it created a Numeric instead of an Integer. Oops! As I stated elsewhere in this thread, the query is generated out of FoxFire, so I don't have an easy solution, except to avoid NULLs from functions.

I can see that, but FoxFire! generates dynamic queries. i.e.
SELECT LNm, FNm, Get_Age(Dob) AS Age, Dob FROM Member INTO CURSOR MemRqst
If Dob is NULL, the SELECT fails.

If I change the expression that FoxFire! uses for Age, I can get a query like this
SELECT LNm, FNm, nvl(Get_Age(Dob),-999), Dob FROM Member INTO CURSOR MemRqst
the error is gone.
Does that make sense? Sorry for the confusion.
Bill Armbrecht
VFP MCP
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform