Expand my Community achievements bar.

Java script in adobe campaign workflow

Avatar

Level 1

var result1 = sqlSelect("rec_cnt, @rec_cnt:Int64",

        "SELECT count(*) from pl_aud_interaction where business_unit_cd in ('BTXU','BTXN') and file_id in (select file_id from pl_aud_file_detail where batch_id in (+ batch_id_btxu +, + batch_id_btxn +))");

When i run this i found below error code:

07/09/2018 10:42:00 AM Oracle error: ORA-00936: missing expression

07/09/2018 10:42:00 AM SQL statement 'SELECT count(*) from pl_aud_interaction where business_unit_cd in ('BTXU','BTXN') and file_id in (select file_id from pl_aud_file_detail where batch_id in (+ batch_id_btxu +, + batch_id_btxn +))' could not be executed (error in position 17

07/09/2018 10:42:00 AM 3: ',').

However the below similar code works fine when i execute :

var result1 = sqlSelect("rec_cnt, @rec_cnt:Int64",

        "SELECT count(*) from pl_aud_interaction where business_unit_cd in ('BTXU','BTXN') and file_id in (select file_id from pl_aud_file_detail where batch_id= " +batch_id+ ")");

Can someone please suggest where i am going wrong?

[Question moved to the Adobe Campaign forum]

2 Replies

Avatar

Level 3

Why do you post this in the forum for Acrobat JavaScript?

Avatar

Level 1

Hi mate,

Just by comparing the SQL statements, i can see that the following string isn't correctly formatted:

"SELECT count(*) from pl_aud_interaction where business_unit_cd in ('BTXU','BTXN') and file_id in (select file_id from pl_aud_file_detail where batch_id in (+ batch_id_btxu +, + batch_id_btxn +))");

Instead try:

"SELECT count(*) from pl_aud_interaction where business_unit_cd in ('BTXU','BTXN') and file_id in (select file_id from pl_aud_file_detail where batch_id in ("+ batch_id_btxu + ", " + batch_id_btxn +" ))");

Good luck and let me know how you get on!