Hello, 
 

 We are currently having trouble entering data on one of our tables. We are 
trying to enter data on specific columns, but after refreshing it, the data is 
lost. Here is the outline of our table:
 

 

 CREATE TABLE PAYMENT
 (
   PAYMENT_DATE Timestamp DEFAULT current_timestamp     NOT NULL,
   PMID Bigint NOT NULL,
   LID Integer,
   CID Integer,
   AMOUNT CURRENCY,
   BALANCE CURRENCY,
   OVER CURRENCY,
   DEFICIT CURRENCY,
   PAYMENT_TYPE Varchar(5),
   DATE_OF_PAYMENT Varchar(15),
   CONSTRAINT PK_PAYMENT PRIMARY KEY (PMID)
 );
 

 GRANT DELETE, INSERT, REFERENCES, SELECT, UPDATE
  ON PAYMENT TO  SYSDBA WITH GRANT OPTION;
 


 

 Dependencies:
 

 SET TERM ^ ;
 ALTER TRIGGER PAYMENT_BI ACTIVE
 BEFORE INSERT POSITION 0
 AS
 DECLARE VARIABLE tmp DECIMAL(18,0);
 BEGIN
   IF (NEW.PMID IS NULL) THEN
     NEW.PMID = GEN_ID(GEN_PAYMENT_ID, 1);
   ELSE
   BEGIN
     tmp = GEN_ID(GEN_PAYMENT_ID, 0);
     if (tmp < new.PMID) then
       tmp = GEN_ID(GEN_PAYMENT_ID, new.PMID-tmp);
   END
 END^
 SET TERM ; ^
 

 SET TERM ^ ;
 ALTER TRIGGER PAYMENT_BI ACTIVE
 BEFORE INSERT POSITION 0
 AS
 DECLARE VARIABLE tmp DECIMAL(18,0);
 BEGIN
   IF (NEW.PMID IS NULL) THEN
     NEW.PMID = GEN_ID(GEN_PAYMENT_ID, 1);
   ELSE
   BEGIN
     tmp = GEN_ID(GEN_PAYMENT_ID, 0);
     if (tmp < new.PMID) then
       tmp = GEN_ID(GEN_PAYMENT_ID, new.PMID-tmp);
   END
 END^
 SET TERM ; ^
 

 

 What could be the possible cause for this? the database worked fine in the 
past days, but after yesterday we cannot enter data to it.
 

 Thanks,

 


Reply via email to