What is the difference between to write code in code page and Stored Procedures in data page of the Project manager.
And how and from where to call stored procedures.
I assume you talk about the Code page tab of the project manager and the Stored Procedures node of a database in the data page tab.
Well, the code you write in the code tab is written into prgs, stored procedures are stored in the DBC file, you just have one Memo for all stored procedures. You can reference external classes, prg or vcx, whatever you like, you just need to assure the DBC would find it.
Typically you only make use of stored procedures for code handling referential integrity (via database insert/update/delete triggers), audit trail and other data related stuff.
Forget about stored procedures, if you don't know much about referential integrity, this is what VFP will automatically generate, if you MODIFY DATABASE and in the database menu "edit referential integrity".
When you write code in the "code page", it is stored in a PRG file, which is an ordinary text file. You can run it directly from the development environment, or execute it with a DO command. Alternatively, it can contain function, procedure or class definitions.
Code in a stored procedure is stored in a database, that is, a DBC file. It can be executed as a function or procedure just like any similar code, but it forms an intimate part of the database.
The above is a simplification, but it should tell you what you need to know. Just keep in mind that PRG files are used much more often than stored procedures.
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.