Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating views versus opening them
Message
De
17/06/2004 18:50:48
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Creating views versus opening them
Divers
Thread ID:
00914852
Message ID:
00914852
Vues:
51
I have an app, call it POS. Used to do Point-of-Sale.

I have an app, call it ITF. Used to maintain account balances just like your bank maintains their accounts.

Until now the 2 apps have been independant except:
From ITF, create a floppy with current balances.
From POS, read floppy retrieving current balances, create sales transactions and at end of day write sales transactions to floppy.
From ITF, read floppy retrieving sales transactions and update account balances.

Now we want real-time.

POS app is mobile and will be wireless networked.

POS app has taken 10 years to develop and is very complex so I MUST change as little as possible. POS app will still have local database (on it's local harddrive) and basically remains the same except:

When ready to sell to an account, go to ITF database on server and get current balance. Load that information to the same local tables that the floppy was loading it to, so nothing much changes.

When ready to save transactions to local database, ALSO send the information to ITF.

To accomplish this:

I have modified POS to open ITF database at startup.

I have created views in the POS app that retrieve one account balance (read-only) and some that basically cause creation of the same data that was created when the floppy was returned to ITF (with sales transactions).

I believe my approach is good but my details are not working too well.

1st, I am learning that CREATE SQL VIEW actually adds the view to the ITF database. I am doing this in my code. Seems that is not what I should be doing unless I only do it once during design, but not during runtime. I should instead just be populating the view or instanciating it or something.
I have no idea how to accomplish that.

When I start the POS app after it was completely shutdown, I get v_myview exists, overwrite y/n? I believe that is telling me it is already created even though it certainly does not exist in the way a temp cursor would.

I should tell you that all the views that actually pull any data from ITF are read-only so I probably should just create cursors instead for those???

All the views that are used to update ITF, have a where clause that ensures they will be empty. In other words, I am only using them to ADD records to ITF.

2nd, Then there is all the stuff I have been reading about remote vs. local and ODBC and CONNECTION etc. I am pretty confused that what I am doing may not work.

There can be multiple users accessing accounts (and thereby effecting balances) from the ITF app.

There will be multiple POS apps (remember each POS app runs on it's own PC with it's own local data), but uses a wireless network to get to the ITF database.

Thanks for any direction,
John
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform