Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

delete from SQL table based on global variable

Hi
I am trying delete data from SQL server based on a date range that I am passing to the SQl statement using a global variable.
I am not where my statement is wrong, but it is giving me an error. (see screen shots)
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
Syntax error on token "(", Expression expected after this token
at talenddemosjava.test_delete_data_from_sql_server1_0_1.Test_Delete_Data_From_SQL_Server1.tFileInputExcel_1Process(Test_Delete_Data_From_SQL_Server1.java:3406)
Please help
0683p000009MDED.jpg 0683p000009MDH2.jpg 0683p000009MDJ7.jpg
Labels (4)
1 Reply
willm1
Creator
Creator

You need to distinguish what is SQL and what are Talend/Java variables. You're missing """ and "+"s in your where clause.
Should be: "select * from table where date1 >= " + globalVar1 + " and date2 <= " + globalVar2
0683p000009MDDU.png