Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error using remote view with POSTGRESQL
Message
From
21/11/2002 12:31:33
Liam O'Hagan
O'Hagan Programming Ltd
Ireland
 
 
To
21/11/2002 09:26:35
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00724395
Message ID:
00725331
Views:
18
Hi Dany,

Thanks for posting the example, it was very helpful. I see now what you mean. After much hair-pulling and teeth-grinding and wrestling with the problem I was in the process of replying to you to say that I couldn't find a solution when a thought occurred to me....

I changed the data type of Balance from Numeric(10,2) to Real and now the view works. This brings it's own problems, however. Real is a Floating Point implementation and, as such, is not an exact value. For a value like 'Balance' I imagine that you want an exact figure. In order to get around this you could put a trigger on the insert and update event for each row on the table to copy the Balance value to another Field (of type 'Real'). Your view would reference this new field instead of the Balance field.

It's a bit of a messy solution, but if you must use a view then this will work for you. On the other hand, you may wish to dynamically create the SQL statements for selecting and updating and use SQLExec() to execute them against PG.

Anyway, hope this works for you.

Regards,

Liam


>Liam,
>
>If you have time to spend try this:
>
>1. In the database create a table with 3 columns: an Id, a name, and a column called "balance" (numeric 10,2).
>
>2. Then in VFP create a remote view with all those fields and a calculated column: balance*2 as newbalance. That view has to have a filter. Use a filter for the ID field, like id=?idsel
>
>3. Input some data in that table (3 rows are enough)
>
>4. Open the remote view with NODATA clause
>
>5. set the idsel variable to a value contained in the table. Then execute the REQUERY().
>
>So far I allways got "view definition has been changed"
>
>In fact, that error occurs every time that view would return a valid result (at least one row) after being empty (because of the last result).
>
>Regards,
>
>Dany
Liam O'Hagan
MCP VFP Desktop Apps
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform