Tag Info

Hot answers tagged


The best way to support multiple database types is to optimize the sql statements for each on of them. Otherwise you will one day end up with huge performance problems on one or the other database types. Additionally to that it's unfair for your customers to tell them "I support Oracle, DB2, MSSQL, etc.) and not optimizing the SQL for each one of them. Why? ...


Found it. You have to declare a continue handler instead of an exit handler. That way even if there is an exception, it goes into the handler and continues with the next record. DECLARE CONTINUE HANDLER FOR SQLEXCEPTION, SQLWARNING BEGIN ... Code that handles the exception/warning ... END


Assuming your desired uniqueness constraint is (one,two), here is one way to do it: DELETE FROM session.test WHERE (one, two) IN ( SELECT one, two FROM session.test GROUP BY one, two HAVING COUNT(*) > 1 )


I'm going to list a different option here, having come from a development background. At one point, we had developed a client/server application, where we wanted the DDL (for the most part) to be the same between the client and the server. The challenge was the client and the server used different database engines. So what we did was use XML. We defined all ...


I ended up figuring this one out. Shrink a tablespace with DB2 9.5 is much more difficult. The reduce and resize command exist but will only work if the high water mark is low. You cannot use reduce or resize below the HWM size. You need to use DB2DART -LHWM and have the database deactivated while doing so.

Only top voted, non community-wiki answers of a minimum length are eligible