Example 7 54 Example of a DB2 CONTINUE handler
CREATE PROCEDURE PROC1()
LANGUAGE SQL
BEGIN
DECLARE SQLCODE, v_error INT;
DECLARE CONTINUE HANDLER FOR
SQLEXCEPTION,
SET v_error = SQLCODE;
DELETE FROM emp
WHERE empno BETWEEN 100 and 200;
IF (v_error = 147 ) THEN
INSERT . . .
UPDATE staff SET salary = salary * 1.25;
IF (v_error <> 0 ) THEN
RETURN 1;
END IF;
END
7.2.7 Special conversions
MySQL provides access control on the level of hosts. That means specific
privileges are granted depending on the host from which the user connects. DB2
UDB does not provide this control mechanism. So, if you use this MySQL
feature, you have to implement a workaround in the application. Applications
which use the MySQL host authentication feature to control user privileges on a
database or global level will require code change.
There are many ways to implement this authentication mechanism on the
application level. Here we demonstrate a workaround using a simple example
application that has two functions
SELECT
and
INSERT
, which use the MySQL
security feature to limit selecting and inserting data on the host level.
Example 7 55 shows that the MySQL host access data for four users controlled
by our example.
Chapter 7. Application porting
221
footer
Our partners:
PHP: Hypertext Preprocessor Cheap Web Hosting
JSP Web Hosting
Ontario Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Java Hosting
Cheapest Hosting
Visionwebhosting.net Business web hosting division of Vision Web Hosting Inc.. All rights reserved