0

This is my SQL adding code:

 return db.query(  " 
 insert  into SAPSR3.[/BNT/HP10] 
 (CLID,BDNM,NOTE,ACTIVE,CRUS,CRDT,CRTM,CHUS,CHTM,CHDT) 
 values  
 ('"+ Bina.BDNM+ "'
 ,'"+ Bina.CLID+ "'
 , '"+ Bina.NOTE + "'
 , '"+ Bina.ACTIVE + "'
 , '"+ Bina.CRUS + "'
 , '"+ Bina.CRDT + "'
 , '"+ Bina.CRTM + "'
 , '"+ Bina.CHUS + "'
 , '"+ Bina.CHDT + "'
 , '"+ Bina.CHTM + "')" 
 , callback);

It gives an error because there are two key fields in the table:

Attempt to insert duplicate key row in object '/BNT/HP10' with unique index '/BNT/HP10~0'

I've studied much of this topic without help.

johnabrams7
  • 399
  • 2
  • 10
  • I am working on a SAP database on saybase –  Jul 25 '18 at 08:42
  • You are trying to insert a new value for `/BNT/HP10` while it has an unique index set. If you need to change it try `UPDATE`. – Xaqron Aug 08 '18 at 00:31

0 Answers0