can anyone explain about stored procedure,Triggers and
transaction in php?
Answers were Sorted based on User's Feedback
Answer / prasadkonnur
A stored procedure is a set of SQL commands that can be
compiled and stored in the server. Once this has been done,
clients don’t need to keep re-issuing the entire query but
can refer to the stored procedure.This provides better
overall performance because the query has to be parsed only
once, and less information needs to be sent between the
server and the client. However, stored procedures of
course do increase the load on the database server system,
as more of the work is done on the server side and less on
the client (application) side.
A trigger is effectively a type of stored procedure, one
that is invoked when a particular event occurs.For example,
you can install a stored procedure that is triggered each
time a record is deleted from a transaction table and that
stored procedure automatically deletes the corresponding
customer from a customer table when all his transactions are
eleted.
Indexes are used to find rows with specific column values
quickly.Without an index, MySQL must begin with the first
row and then read through the entire table to find the
relevant rows. The larger the table, the more this costs. If
the table has an index for the columns in question, MySQL
can quickly determine the position to seek to in the
middle of the data file without having to look at all the
data. If a table has 1,000 rows, this is at least 100 times
faster than reading sequentially. If you need to access most
of the rows, it is faster to read sequentially, because this
minimizes disk seeks.
Is This Answer Correct ? | 8 Yes | 2 No |
Answer / jit
A stored procedure is simply a procedure that is stored on
the database server. MySQL developers have to date
unthinkingly written and stored their procedures on the
application (or web) server, mainly because there hasn't
been an option. That has been limiting. Some have claimed
that there are two schools of thought - one claiming that
logic should be in the application, the other saying it
should reside in the database. However, most professionals
would not bind themselves to one or other viewpoint at all
times. As always, there are times when doing either makes
sense. Unfortunately, some of the staunchest adherents of
the in the application school are only there because until
now they have had no choice, and it is what they are used to
doing.
Triggers are programmable events that react to queries and
reside directly on the database server. Triggers can be
executed before or after INSERT, UPDATE or DELETE
statements.There are several reasons to use triggers.
Triggers can automate a lot of stuff that you may have been
doing by hand before. The main reason I use triggers is to
maintain the integrity of one table that might rely on
another table. For example, if TableA references TableB and
a value from TableB gets deleted, you could have a trigger
setup to handle the data in TableA. Perhaps the data in
TableA should be reset to a generic value or maybe the data
should just be deleted completely.
Is This Answer Correct ? | 5 Yes | 0 No |
If anybody integrate "First Data Global Payment Gateway" in your site?
What are the three classes of errors that can occur in php?
What is strcmp () in php?
What are the method available in form submitting?
What is data abstraction in php?
What is the use of dual table in mysql?
How to randomly retrieve a value from an array?
Do you know what does $globals means?
How to get number of elements in an array?
What are the rules for naming a php variable?
Name and explain five of the PHP error constants?
How to include a file to a PHP page?