Question
· 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 
    (ID,Name,SSN) 
    VALUES ('205','Swift,Jonathan','111-22-3333'))

 IF (SQLCODE = 0) {
     Write "New Person inserted with ID: ", %ROWID,!
 }
 else
 {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
 

thanks

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