Rochdi Badis · Mar 24, 2022

Insert Row by enforcing ID

Hi Guys,

Can I insert a new row and enforcing my own ID not the default id increment? 

 &sql(INSERT INTO Sample.Person 
    VALUES ('205','Swift,Jonathan','111-22-3333'))

 IF (SQLCODE = 0) {
     Write "New Person inserted with ID: ", %ROWID,!
 {WRITE !,"SQLCODE=",SQLCODE," ",%msg }


I tried this in samples and got the below error:  

SQLCODE=-111 INSERT of Default Only RowID Field 'ID' in table 'Sample.Person' not allowed


Product version: Caché 2014.1
0 155
Discussion (1)2
Log in or sign up to continue