Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to find out what tables in a view programmatically
Message
From
18/10/2002 09:00:01
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
 
 
To
18/10/2002 07:22:22
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00712321
Message ID:
00712820
Views:
7
Hi cetin,

beg your pardon on that it looks like we run in a missunderstanding.
>Hi Agnes,
>I'm afraid I don't understand what you mean.
>I think I didn't say a different syntax. However both DbGetProp(..,..,'Tables') and cursorgetprop('Tables',..) return tables in view as a comma delimited list. Those tables in the list are the sources for the view.
>Is it something else you want to find out ? Or do you mean you get the list only for the updatable ones ? Yes you do get only for updatable ones and need to parse SQL then.

In fact any kind of cursor could be used.
The tables listed are the targets for updates. They do not need to be related to the sources. (It's strange but possible)
If the view is joined and update only one target, I strongly recommend set the value of 'tables' to that target only.
On the other hand if the is a non-update one, clean up the property to prevent mistakes.

>Actually I wouldn't even create a view that I wouldn't update. In that case DBC would only be serving as SQL code storage ...

But a parameterized view could do a lot of fun with REQUERY

Try
lcPara = ''
CREATE SQL VIEW Tralla AS SELECT
*;
FROM SomeTable;
&?lcPara


USE Tralla
BROW
lcPara = 'INNER JOIN OtherTable ON YourCondition'

REQUERY()
BROW NOWAIT
See?

And update may be changed on the fly using CURSORSETPROP anyway.

>... and rather limiting prior to VFP8.

Beg your pardon, but I talk about available versions only. ::)

Agnes
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform