Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
PierrickB
Contributor III
Contributor III

Put custom value in sql query doesn't work

Hi,

 

 

i try to use custom code in sql query in tDBROW to delete data but it's not working...

 

Here is my request in tDBRow :

 

"DELETE  FROM `pricelistdetailed` WHERE `MonthYear` = " +TalendDate.getDate("YYYY")+ "-"+ TalendDate.addDate(TalendDate.getDate("MM") , "MM", -1,"MM")

 

I got no error when i execute the job.

 

for testing i used a tMsgBox to display the custom value :

 

"Hello world!" + TalendDate.getDate("YYYY")+ "-"+ TalendDate.addDate(TalendDate.getDate("MM") , "MM", -1,"MM")

 

This work, it display : 2020-01

 

It's someting miising?

 

Thanks,

Pierrick

 

 

 

 

 

 

 

Labels (2)
1 Solution

Accepted Solutions
PierrickB
Contributor III
Contributor III
Author

Hi,

 

i find the solution there is missing quote at the end of the line :

 

"DELETE  FROM `pricelistdetailed` WHERE `MonthYear` = ' " +TalendDate.getDate("YYYY")+ "-"+ TalendDate.addDate(TalendDate.getDate("MM") , "MM", -1,"MM") +" ' "

 

Regards

 

 

View solution in original post

1 Reply
PierrickB
Contributor III
Contributor III
Author

Hi,

 

i find the solution there is missing quote at the end of the line :

 

"DELETE  FROM `pricelistdetailed` WHERE `MonthYear` = ' " +TalendDate.getDate("YYYY")+ "-"+ TalendDate.addDate(TalendDate.getDate("MM") , "MM", -1,"MM") +" ' "

 

Regards