Sybase 2 Barcode Reader User Manual


 
Using stored procedures to update the database
198 DataWindow .NET
How to choose a
setting
Consider the following when choosing the Key Modification setting:
If multiple rows are changed,
DELETE and INSERT always work. In some
DBMSs,
UPDATE fails if the user modifies two keys and sets the value in
one row to the original value of the other row.
You might choose the setting here based on your DBMS triggers. For
example, if there is an Insert trigger, select Use Delete then Insert.
If only one row can be modified by the user before the database is updated,
use
UPDATE because it is faster.
Using stored procedures to update the database
Updates to the database can be performed using stored procedures.
Why use stored
procedures?
The DataWindow control submits updates to the database by dynamically
generating
INSERT, DELETE, and UPDATE SQL statements after determining
the status of each row in the DataWindow object. You can also define
procedural SQL statements in a stored procedure for use by all applications
accessing a database. Using stored procedures to perform database updates
allows you to enhance database security, integrity, and performance. Since
stored procedures provide for conditional execution, you can also use them to
enforce additional business rules.
Updating using stored
procedures
The Stored Procedure Update dialog box only allows you to associate an
existing stored procedure with your DataWindow object. The stored procedure
must have been previously defined in the database.