CREATE TABLE "&1".MESSAGE_FROM_SOLACE_ERROR
(
  MESSAGE   CLOB,
  TOPIC     VARCHAR2(100),
  ERROR     VARCHAR2(1000),
  TIMESTAMP DATE
);

CREATE TABLE "&1".MESSAGE_FROM_SOLACE_NOT_PROCESSED
(
  MESSAGE   CLOB NOT NULL,
  TOPIC     VARCHAR2(100) NOT NULL,
  TIMESTAMP DATE NOT NULL
);

CREATE TABLE "&1".MESSAGE_FROM_SOLACE_PROCESSED
(
  MESSAGE   CLOB NOT NULL,
  TOPIC     VARCHAR2(100) NOT NULL,
  TIMESTAMP DATE NOT NULL
);

CREATE TABLE "&1".SOLACE_TOPIC
(
  SOLACE_TOPIC_IN   VARCHAR2(100) NOT NULL,
  PRIORITY          NUMBER NOT NULL,
  PROCESSING_NUMBER NUMBER DEFAULT 0 NOT NULL,
  SOLACE_TOPIC_OUT  VARCHAR2(100)
);

ALTER TABLE "&3".ERP_I_CUSTOMER ADD CRMCUSTOMERNUMBER VARCHAR2(18);
ALTER TABLE "&3".ERP_I_CUSTOMER ADD SEND_RESPONSE VARCHAR2(1);

BEGIN
EXECUTE IMMEDIATE 'DROP INDEX "&3".XAK3CUSTOMER';
EXCEPTION
  WHEN OTHERS THEN 
    null;
END;
/
BEGIN
EXECUTE IMMEDIATE 'CREATE INDEX "&3".XIE6CUSTOMER ON "&3".CUSTOMER (CRMCUSTOMERNUMBER)';
EXCEPTION
  WHEN OTHERS THEN 
    null;
END;
/

exit;