Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select a deleted flag
Message
From
03/04/2009 19:38:48
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
03/04/2009 19:30:47
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01393204
Message ID:
01393206
Views:
46
>How can I create a field via SELECT that will identify the record as deleted in the original table (r1)? This is my SELECT but del1 comes up false regardless of the record's original status.
>
>
>select r1.system, r1.rtp_id, trim(r1.st_name) + " / " + trim(r1.termini) as st_name_a, r1.lead, ;
>r2.rtp_id, trim(r2.st_name) + " / " + trim(r2.termini) as st_name_b, r2.lead, ;
>r3.rtp_id, trim(r3.st_name) + " / " + trim(r3.termini) as st_name_c, r3.lead, ;
>deleted() as del1 ;
>from rtp_projects r1 ;
>left join rtp_projects r2 on r1.rtp_id = r2.parentproject ;
>left join rtp_projects r3 on r2.rtp_id = r3.parentproject ;
>where (r1.parentproject = 0 or isnull(r1.parentproject)) and ! isnull(r1.st_name) and ! isblank(r1.st_name);
>order by r1.system, r1.st_name, r2.st_name, r3.st_name
>
>
>Thanks

Make sure you have SET DELETED OFF.

However, the real problem is that you are selecting data from several tables. deleted("Table1") won't work either, because Visual FoxPro will do the equivalent of USE...AGAIN when opening the tables.

I think you must SELECT from one table first (including the deleted() status), and then combine the resulting cursor with additional tables. (Don't forget to include NOFILTER in the first query.)
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform