Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Delete query
Message
 
 
À
02/08/2001 18:15:36
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00539028
Message ID:
00539191
Vues:
10
Jim,

Of course, I meant the example number three and as I showed in my previous message, he should try subquery for his task.

>Nadya,
>
>Maybe we're each reading a different Hacker's guide < s >.
>
>I understand that Bharat wants to do 'synchronized' deletes. That is, multiple records for multiple different claims, based on content in table Claims02.
>
>The only possible way that it might be achievable is using Hacker's option #3 - a sub-select. That's why I suggested that he pursue the sub-select method.
>
>But I'm still not sure if his specific case can be achieved with a sub-select.
>
>If you are saying that example #2 is the applicable case, then you are incorrect.
>
>JimN
>
>>Hi Jim,
>>
>>I've checked VFP Help on DELETE-SQL and the excellent Hacker's Guide by Tamar Granor. In Hacker's Guide there is an example of what Bharat is trying to achieve:
>>
>>Example * delete all orders for a specified customer
>>DELETE FROM TasTrade!Orders WHERE customer_id="WOLZA"
>>
>>* delete all orders for the current customer record
>>* assumes Customer is open
>>DELETE FROM TasTrade!Orders ;
>>   WHERE Customer_id=Customer.Customer_id
>>
>>* Get rid of customers who've never bothered to place an order
>>DELETE FROM TasTrade!Customer ;
>>   WHERE Customer_id NOT IN ;
>>         (SELECT Customer_ID FROM Orders)
>>
>>So, it's possible. Other way would be to use SET RELATION and DELETE FOR FOUND().
>>
>>
>>>Bharat,
>>>
>>>there was a discussion similar to this a week or two ago.
>>>
>>>The final conclusion was that there cannot be a second table field involved in the WHERE that you expect to be handled in synchronization with the first table. In other words the field of the second table will stay on the same record throughout the operation.
>>>
>>>However it was felt that there was some chance of achieving a desired result using a sub-select. Maybe you should play more with your sub-select.
>>>
>>>good luck,
>>>
>>>JimN
>>>
>>> >I tried to run this query
>>>>
>>>>delete from claim_detail where;
>>>>claim_detail.line = claims02.Line and;
>>>>claim_detail.claim_num = claims02.claim_num
>>>>
>>>>This query seems to be running but does not delete the rows. I know this query should delete 140 records as this select query.
>>>>
>>>>select claim_detail.* FROM claim_detail, claims02;
>>>>where claim_detail.line = claims02.line and;
>>>>claim_detail.claim_num = claims02.claim_num
>>>>
>>>>returns 140 records. Actually these 140 records I want to delete from the claims_detail table.
>>>>
>>>>Thanks for your concern
>>>>Bhushan
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform