Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Correct way to call DBC stored procedure
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Correct way to call DBC stored procedure
Divers
Thread ID:
00523854
Message ID:
00523854
Vues:
72
Hi everyone,

We were just hit by this problem: we have lNextID function in our common procedure file. We also have a function with the same name in different DBC stored procedure. I noticed, that the wrong function was called, even if I set database to myDatabase. I have a view, which is based on tables from two databases (Stats - my database and Customer table, which is part of JobControl database). I put code in form's Add method:
lnRegionID=lNextID('Regions') and it invokes lNextID from JobControl database stored procedure, not my Stats database.

So, how should I ensure, that my code is called. Right now I decided to change name of my stored procedure function to GetNext_ID, but it's not a universal solution.

Another problem:
My underlaying table has a default value, which is (changed it right now) GetNext_ID('Regions')

In my add method I do:
lnRegionID=GetNext_ID('Regions')
insert into RegionsInfo (RegionID,...) values (m.lnRegionID,...), where RegionsInfo is a view based on Regions table (only this table).

The question is: when I save the record, would it try to excecute this GetNext_ID twice, since my table has default value? Right now it seems to be doing that. What should I do to do it only once?

Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform