Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating a light version of a database
Message
From
07/07/2004 17:37:34
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00921520
Message ID:
00921643
Views:
20
>Here are my thoughts:
>
>1. Run GenDBC to make an empty copy of a database.

I would not use GenDBC to do this, but this is a possibility.

Personally, I keep an empty copy of the database handy, and make all structural changes there. That makes it simple to then update the changes (APPEND FROM for each table), a) in a directory I use for testing, b) at the client site (or shared folder in a network).

>2. I need a select statement to select two most recently run jobs per each job type, I'm not sure, how to write this select. I do not remember, if the Jobs table has a timestamp, but I want to have recent jobs per each type. Some jobs could be run year ago (for some job type), but I still want them, since I want to have every possible Job Type.

I am not so sure whether this can be done with "standard" SQL... I think this has been discussed a few days ago. For a single record in each group, it should be simpler: max(...) and GROUP BY. But it should be fairly simple to write a UDF that uses structural programming to select the PKs of the last two records in each group.

>3. Once I have JobIDs with these jobs, I can create selects for all related tables and then append from the resulting cursors...

Yes, I think that would be the procedure to follow.
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