Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Same named databases
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Same named databases
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01465100
Message ID:
01465100
Vues:
118
All,

I have a situation with two same named databases

\data\samename.dbc
and
\data\archive\samename.dbc

An archiving routine moves deleted records from \data\sametable.dbf to \data\archive\sametable.dbf

This routine selects the deleted records from \data\sametable.dbc into a cursor, then scans the cursor, scattering to memvar, uses the \data\archive\sametable.dbf,
appends a blank and gathers the menvars.

Adding the blank fires a trigger for a stored procedure newid() from a table (also same named, of course) that holds the next pk for every table.

The problem appears to be that the stored procedure newid() in the \data\samename.dbc fires, and draws the new id.

What SHOULD happen is for the stored procedure newid() in \data\archive\samename.dbc fires to get a new id from \data\archive\keylist.dbc

There is no SET DATABASE TO samename anywhere. The stored procedure will fire in the SET DATABASE ??????.dbc

Of course, every so often a duplicate pk from \data\keylist hits in the \data\archive\sametable.dbc and blows out several other things.

There is a lot of code to change, and the error handling consists of a cascade of ON ERROR thiserror = .T. style code which is very convoluted.

Is there any way to handle a 'SET DATABASE TO samename' with something like an alias to be sure the correct stored procdure is being called?

TIA for ideas.

Al Allison
Répondre
Fil
Voir

Click here to load this message in the networking platform