Hi, I'd appreciate your help. I need to insert a new record into an already existing list.
I did an update instead of an insert, and it updated all the records in the list, and even when recipients_2.length == 1.
However, doing and INSERT I get:
06/13/2025 2:11:55 PM SCR-160012 Javascript: error while evaluating script 'WKF212/js2'.
06/13/2025 2:11:55 PM WDB-200001 SQL statement 'INSERT grp1270 SET sCAMPOVAR02='YOLO',sCAMPOVAR03='YOLO', sCAMPOVAR04='XXX', sCIC='TRTR'' could not be executed.
06/13/2025 2:11:55 PM PGS-220000 PostgreSQL error: ERROR: syntax error at or near "grp1270" LINE 1: INSERT grp1270 SET sCAMPOVAR02='YOLO',sCAMPOVAR03='YOLO', sC... ^ .
06/13/2025 2:11:55 PM ### Length recipients_2.length : 1 ###
for(i=0;i<recipients_2.length;i++){
sql = "INSERT grp1270 SET sCAMPOVAR02='YOLO',sCAMPOVAR03='YOLO', sCAMPOVAR04='XXX', sCIC='TRTR'";
sqlExec(sql);
}
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hello @god_prophet,
The reason your INSERT statement doesn't work is because the postgresql syntax is incorrect.
The right syntax is :
INSERT INTO grp1270 (sCAMPOVAR02, sCAMPOVAR03, sCAMPOVAR04, sCIC)
VALUES ('YOLO', 'YOLO', 'XXX', 'TRTR');
Br,
Hello @god_prophet,
The reason your INSERT statement doesn't work is because the postgresql syntax is incorrect.
The right syntax is :
INSERT INTO grp1270 (sCAMPOVAR02, sCAMPOVAR03, sCAMPOVAR04, sCIC)
VALUES ('YOLO', 'YOLO', 'XXX', 'TRTR');
Br,
It worked, however the new record didn't get a primarykey niether a targeting dimension, why? Will that affect the use of the record in any Campaign?:
for(i=0;i<recipients_2.length;i++){
sql = "INSERT INTO grp1270 (sCAMPOVAR02, sCampovar03, sCampovar04, CIC) VALUES ('Yolo', 'Yolo', 'Yolo', 'TRTR');";
sqlExec(sql);
}
This is how the for loop ended and it worked. Ty.
Views
Replies
Total Likes
Hi @god_prophet ,
Is primary key generation auto-incremental or manual in schema definition?
And Yes, the lack of a primary key and proper targeting dimension will significantly affect the use of these records in your campaigns. Without a primary key, you won't be able to uniquely identify and manage individual records. Without the correct targeting dimension, the records won't be included in the target audience for your campaigns. You must address these issues before using the records in any Adobe Campaign activities.
Thanks,
Jyoti
Views
Likes
Replies