I have a proble using Querys

I have a problem using Querys, I need to use these 3 Querys but I get the same error when I put them in Assign Activity

Query 1:
“SELECT NO_OC,ESTADO_OC,NO_RECEPCION,COUNT(1) FROM (”+ Environment.NewLine+
“SELECT T.PMG_PO_NUMBER NO_OC ,”+ Environment.NewLine+
“(select (select PMG_STAT_NAME from pmgstscd where PMG_STAT_CODE= o.pmg_stat_code) from pmghdree o where o.pmg_po_number= t.pmg_po_number) as ESTADO_OC,”+ Environment.NewLine+
“(SELECT DISTINCT d.RCV_SESSION_ID FROM RCVSSDEE D WHERE d.pmg_dtl_tech_key = t.pmg_dtl_tech_key and d.pmg_seq_num = t.pmg_seq_num and rownum = 1) NO_RECEPCION”+ Environment.NewLine+
+NoRecepcion±-1 no_recepcion
“FROM pmgdtlee T”+ Environment.NewLine+
“WHERE t.PMG_PO_NUMBER”+ Environment.NewLine+
“IN (“Variable”))”+ Environment.NewLine+
“Group By NO_OC,ESTADO_OC,NO_RECEPCION;”

Query 2:
“SELECT DISTINCT A.NUMERO_DOCUMENTO, A.CODIGO_PROVEEDOR, A.NUMERO_UUID NUM FROM ENVIOS_AP A”+Environment.NewLine+
“WHERE 1=1”+Environment.NewLine+
“AND A.ORIGEN_ETL=‘ODBMS’”+Environment.NewLine+
“AND (A.NUMERO_UUID) in (’”+UUID+’");"

Query 3:
“SELECT DISTINCT A.NUMERO_DOCUMENTO, A.CODIGO_PROVEEDOR, A.NUMERO_UUID NUM FROM ENVIOS_AP A”+Environment.NewLine+
“WHERE 1=1”+Environment.NewLine+
“And A.ORIGEN_ETL=‘ODBMS’”+Environment.NewLine+
“And (A.NUMERO_UUID) In (”’+UUID+’");"

@Edher_Castro,

Welcome back to the Community!

Share the error you are getting when you are using Assign Activity for the above queries

thank you!
Compiler error encountered processing expression. The end of an expression was expected

Hi @Edher_Castro,

Environment.Newline is not required to can give it in the single line query.

Regards,
Arivu

Hi @Edher_Castro,

For example I have modified the 3rd query use below format.

"SELECT DISTINCT A.NUMERO_DOCUMENTO, A.CODIGO_PROVEEDOR, A.NUMERO_UUID NUM FROM ENVIOS_AP A WHERE 1=1 And A.ORIGEN_ETL=‘ODBMS’ And A.NUMERO_UUID In ('"+UUID+"')"

Regards,
Arivu