General information
Category:
Coding, syntax & commands
Your way seem more efficent, I seem to use views (because I am more familiar with SQL) for everything. I didn't do any programming in DOS really, just started when VFP5 came out.
Thanks
Nick Patel
>Still not quite sure why you want to use a view. From old DOS time I used to use a procedure like this:
>
>use (table_where_to_recall or archive_view) order key
>sele 0
>use (list_of_key_need_to_be_recalled)
>scan for (records need to be recalled)
>lldele=.f.
>set dele off
>if seek(key, table_where_to_recall)
>sele (table_where_to_recall)
>if deleted()
>lldele=.t.
>recall
>endif
>endif
>set dele on
>sele (list_of_key_need_to_be_recalled) && just in case
>if lldele
>* do appropriate deletion in archive_table
>endif
>endscan
>
><\vfp>
>
>
>>Well actually, you hit it on the ball with the archive part. What I created is an employee program. Every application is entered into employee program. Hired and extra help employees are entered into employee table, non-hired and people like extra help that leave are put into archive table. If the extra help return (which happen quite bit in our shop), then I delete record on archive and recall the record on employee. If I deleted the information completely on employee table (pack records) then my users will have to re-enter information again. Also employee table (and archive table in identical way) is linked to other tables. If I create a new record in employeee then new id is generated, and id will have to be updated in other tables. So you see having both an employee table and archive table, I just have to recall the records from appropriate tables leaving the link tables intact with changing their id's. Also I could have created a field in employee table call archive_flag
>and
>>just show which information the user wanted to see ( 1=hires, 2=archived) but my users will be using this table for a number of years (10 years on previous program) and I didn't want the search time to bog down.
>>
>>Thanks
>>Nick Patel
>>
>>Thanks
>>Nick Patel
>>
>>>Yes, it is possible, but I do not believe there exist any practical reason to allow user to do it.
>>>
>>>I support the idea that View gives the user ability to modify, add and delete records. Recall is a special maintenance tool that should not be used regularly but in emergency situation and by the database professional.
>>>
>>>Sometimes user needs to see records, which were removed for history/archive purposes. But in this case I believe that those records should not be recalled but only displayed because there is no reason for regular user to modify them.
>>>
>>>Do you have any other special situation that I did not describe here?
>>>
>>>>Thanks for answering, just wondering is it possible to use RECALL using a view?
>>>>
>>>>Thanks
>>>>Nick Patel
>>>>
>>>>>Recall for...
>>>>>
>>>>>
>>>>>>How do I recall a specific record in a table that has been deleted? My table has a primary key (e_id) that I need to lookup by, and then restore that record.
>>>>>>
>>>>>>Thanks
>>>>>>Nick Patel
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only