Sunday, August 23, 2020

[Oracle][Resolved] Invalid number -1722 insert

Error message:

Error starting at line 2 in command:

INSERT INTO LIB_BUFFER(BATCH_NO,CLINK_ID,PGM_FM,ID_FM,REMARK,CRE_USER,CRE_DATE)

VALUES ('20991131-2','LIBVDO_'+11110001),'LIBVDO',1111001,'title1','Super',sysdate);

Error report:

SQL Error : ORA-01722: invalid number

* Cause:

* Action:

SQL:

INSERT INTO LIB_BUFFER(BATCH_NO,CLINK_ID,PGM_FM,ID_FM,REMARK,CRE_USER,CRE_DATE)

VALUES ('20991131-2','LIBVDO_'+11110001,'LIBVDO',1111001,'title1','Super',sysdate);

We should not use symbol + to connect 2 values, use CONCAT function

INSERT INTO LIB_BUFFER(BATCH_NO,CLINK_ID,PGM_FM,ID_FM,REMARK,CRE_USER,CRE_DATE)

VALUES ('20991131-2',CONCAT('LIBVDO_',11110001),'LIBVDO',1111001,'title1','Super',sysdate);

Reference:

https://www.techonthenet.com/oracle/functions/to_char.php

https://stackoverflow.com/questions/33994013/invalid-number-during-insert-query

No comments :

Post a Comment