Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Foxpro data to .Net
Message
From
14/09/2006 20:42:18
 
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01153891
Message ID:
01153927
Views:
12
>I'm going to give you two pieces of code, first some purely SQL code that you could run in a stored procedure (or even as a pass-through statement). And then I'll give you some VB.NET code in a 2nd post:
>
>From looking at the PRG, it doesn't appear there are any specific parameters for this process. It looks like you just want to update Mittellog for every row that has an valid entry for ReviewerID and ReviewerCo that exists in ReviewerIDs, and where the Estim_Id doesn't exist in Estimators - and populate the value of Mittellog.estim_id and Bill_Locat from ReviwerIDs.
>
>You can do this as one SQL statement:
>
>
>UPDATE mittellog SET ESTIM_ID = RV.ESTIM_ID, BILL_LOCAT = RV.BILL_LOCAT
>	FROM REVIEWERIDS RV, mittellog ML
>	where TRIM(ML.reviewerid) <> '' AND TRIM(ML.reviewerco) <> ''
>	AND ML.reviewerid = RV.reviewerid and ML.reviewerco = RV.reviewerco
>	and ML.estim_id not in (select estim_id from estimators)
>
>
>The only thing I don't understand about this process is that you're replacing Estim_ID in Mittellog with a value from ReviewerIDs, after you first established that it didn't exist in Estimators. If the 'original value' in mittellog differs from the value in reviewerids, it seems maybe you're losing the original value? But maybe that's how it's supposed to work, I don't know. (maybe the value of mittellog.estim_id is initially zero?)

It is in fact an interesting SQL line. I'll leave that to Patrice from here as to know if that could fit his needs. Thanks
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Reply
Map
View

Click here to load this message in the networking platform