Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Difference between

Status
Not open for further replies.

alisaif

ISP
Apr 6, 2013
418
AE
Hi,

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.

Saif
 
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".

Bye, Olaf.
 
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)

Visual FoxPro articles, tips, training, consultancy
 
Thanks Mike and Olaf for the well explanations !!

Saif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top