Gérer la suppression de table SQL DB2 i

Pour éviter des erreurs de création avec DROP TABLE dans l’utilisation de RUNSQLSTM, vous pouvez utiliser ce bout de code:

 

BEGIN
   DECLARE CONTINUE HANDLER FOR SQLEXCEPTION
      BEGIN END;
   DROP TABLE RNPROW;
END;  

Faking Create Or Replace Table – IT Jungle

The new CREATE OR REPLACE feature of SQL has been most helpful to me. It works for aliases, functions, masks, permissions, procedures, sequences, triggers, variables and views. It would be nice if it worked for tables, especially when I’m developing a new application. Here’s a workaround. The trick is to use a dynamic compound statement.

Source: www.itjungle.com/2015/01/20/fhg012015-story01/