text: 
      
  --DROP PROCEDURE GPSQLWEB.procCreateTabsb42
      
  CREATE PROCEDURE GPSQLWEB.procCreateTabsb42
  (
     IN P_T42NOM VARCHAR(50),
                  
    IN P_USERNAME VARCHAR(50),
    IN P_IPADDRESS VARCHAR(255),
    IN P_USERAGENT VARCHAR(500),
    OUT P_T42COD INTEGER
  )
  LANGUAGE SQL
  BEGIN
    Declare StringSQL Varchar(32000) Default '';
    
          SELECT  COALESCE(MAX(T42COD), 0) +1 INTO P_T42COD FROM GPDATWEB.TABSB42;
          INSERT INTO GPDATWEB.TABSB42 (T42COD, T42NOM ) VALUES (P_T42COD,  P_T42NOM );
  
    Set StringSQL = 'INSERT INTO GPDATWEB.TABSB42 (T42COD T42NOM ) VALUES (''' || P_T42COD  ||''' ,  '''|| P_T42NOM || ''' )'; 
    CALL GPSQLWEB.procCreateWebAudit (P_IPADDRESS, P_USERAGENT, P_USERNAME, 'Crear', 'procCreateTabsb42', StringSQL);
  END
  GO
  
  
  