sql - How should a stored proc creation script look like for db2 9.5 w/o compat vector? -


  • Any "alternate process" or "if it does not exist"
  • data Studio and clp / control Center statement terminator change individual signal
  • helpmeet many overloaded version of SP can go.
  • have to leave all of them
  • There is no built-in SP to leave another SP, correct me if I'm wrong I
  • compound statement dynamic SQL can not execute, so you need a temporary process

All these short results are very heavy script headers:

  - & lt; Script Option Description Terminator = "^" /> - # Set terminator ^ crazy processed db2 instantip_m_drop_prodes () BEGIN announcement @STMT VARCHAR (10000); Select V1 where syscat.procedures the SPECIFICNAME PROCSCHEMA = 'D22INST1' and PROCNAME = 'CREATE_OR_UPDATE_ARCH' SET @STMT = 'DROP SPECIFIC PROCEDURE DB2INST1.' || SPECIFICNAME; EXSTUTE Instant @STMT; For the end; END ^ CALL db2inst1.tmp_my_drop_procs () ^ drop process Db2inst1.tmp_my_drop_procs ^ Create process db2inst1.CREATE_OR_UPDATE_ARCH () dynamic result set 1 BEGIN ATOMIC - ... END ^  

< Div class = "post-text" itemprop = "text">

You can add a current handler which ignores the SQLSTATE '42704' (the object is not found). Here is an example that I was lying.

  create process drop_procedure (procschema varchar (128), procname varchar (128)) language sql launches tmpstmt VARCHAR (100); SET tmpstmt = 'drop process' || Procschema || '.' || ProcName; A: BEGIN - If the drop process fails, do not do anything for SQLSTATE '42704' HENDLER CONTINUE CONTINUE; Take the conclusion TMPTMT; End; END @  

Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -