Forum Discussion
Desktop dynamic mysql query with parameters works; In service DOES NOT
Okay, I narrowed it down that the service does not allow a parameter as the table. I removed all other functions and only have the below which still has the combine error. It does not like that I concatenate the date parameter with the prefix of the table name. I need that though because it is the only way to allow the user to select the desired table. My workaround in case anyone is interest was just put a cgi page that allows the date to be selected then I dynamically CREATE OR REPLACE VIEW and use that view in the query.
I think that the code on the service needs updating and is not in sync with the desktop being too restrictive here.
let
sql_query = "SELECT * #(lf)FROM HistoryTable_" & date & " #(lf)WHERE DATE_FORMAT(FROM_UNIXTIME(lms), ""%i"") = '00' #(lf)AND DATE_FORMAT(FROM_UNIXTIME(lms), ""%H"") in ('00')",
Source = MySQL.Database("mydb.fakedomain.net", "mydb", [ReturnSingleDatabase=true, Query=sql_query])
in
Source
Thanks,
Bryant
Hi Anonymous ,
Hope these help😀
Best Regards,
Eyelyn Qin
- Anonymous5 years agoNot applicable
Wow, it looks like this went full circle to my original post. No, those don't help. The first one is for Excel. The second one is what I explained I did in my original post for the desktop but *DOES NOT* apply in the service when publishing. Please re-read the entire posts and threads again to fully understand my issue. Basically desktop allows you to relax the privacy level while the service still has code that restricts it and has no tuneables to relax it.
Thanks!
Bryant