Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help with Query problems
Message
From
09/02/2000 17:16:08
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00329428
Message ID:
00329749
Views:
28
>>Hi Mark,
>>
>>Your close enough to the problem. Now you can see why I need to get rid of any refrence to the table name because It will be not available. I will have recreate the alias with only the fields that are need for comparison, but I still need to be able to a query on the recreated alias, but I can not. Any help is very much appreciate.
>
>Once the saving of the QPR is completed, you might try the FileToStr() to convert the QPR to a string. Something like--
>lcQPR = FileToStr("MyQuery.QPR")
>lcQPR = strtran(lcQPR, "MyTable.", "")   && removes all the <b>MyTable.</b> strings
>** of course you would have to figure out what tables were used
>** you can use the AT() function to look for the periods
>lnRetVal = StrToFile(lcQPR, "MyQuery.QPR")
>if lnRetVal > 0
>   *** successful
>else
>   *** not successful
>endif
>I am afraid there are not many options for you on this.

Another altertnative is to get the SQL command from the view definition in the dbc using DBGETPROP, put that command into a string variable, manipulate the string to change the dbf name (including path) to the table's alias, then use the the CREATE SQL VIEW using the newly changed string as the SQL command and overwriting the prior SQL view with the new one.

For example,

theSQL = DBGETPROP('someview','view','sql')
***
*** manipulate theSQL to the new SQL syntax replacing the dbf with the alias
***
CREATE SQL VIEW someview as &theSQL
Previous
Reply
Map
View

Click here to load this message in the networking platform