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 00:37:41
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
 
 
To
17/10/2002 12:11:58
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:
00712709
Views:
10
Hi,
Syntax for DBGETPROP is:
DBGETPROP(cViewName,'View','Tables'),
for Cursorgetprop
CursorGETPROP('Tables',cViewName)
but IMHO this returns the updatepath tor the view. I guess what's needed are the sources of the views, i.e. all in the FROM cause of the SELECT SQL. I now no command for this. All what can be done is to extract the SQL string from the DBC and parse it for FROM and JOIN in all there configurations....
CursorGETPROP('SQL',cViewName)
returns the complete SELECT SQL that was used to create the view, at least at my VFP 7.0

Agnes


>>>>Hi
>>>>
>>>>I have a view that I want to change programmatically and I want to do it once if possible.
>>>>
>>>>Thanks
>>>
>>>Title : cursorgetprop('Tables',cViewName)
>>>
>>>Couldn't understand message.
>>>Cetin
>>
>>Hi Cetin
>>
>>(example)I have a view:
>>create sql view myView as;
>>select a.field1, a.field2, b.field3, c.field4;
>>from table1 a, table2 b, table3 c;
>>....
>>
>>I want to see if table2 is used in the view WITHOUT opening the view, so I can update the view if table2 does not exist.
>>
>>Now, if I have to open the view to find out what table are used by using cursorgetprop('Tables',cViewName) then I believe I am getting a bug where the only result I get from using CursorGetprop('Tables',cViewName) is the name of 1 table.
>>From my above example I get "table1" only instead of table1 , table2 and table3.
>>
>>in brief, I have to update a view by adding a table to it and I want to do it only once by checking if this new table already exist.
>>In theory cursorgetprop('Tables',cViewName) should solve the rpoblem.
>>
>>Thanks
>>Mo
>
>Then query from dbc :
>?DBGETPROP(ViewName,"VIEW","SQL")
>?DBGETPROP(ViewName,"VIEW","Tables")
>Cetin
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