Re: How to concat UUID into a SQL query string to MariaDB
On Tuesday, 27 August 2019 at 08:54:21 UTC, Anders S wrote: Hi again, the auto declaration worked as I expected my catenations should with the string Great to hear that ! Strings are a bit "different" in D. Please help yourself and read the following that IMO is the best introduction to the topic: http://ddili.org/ders/d.en/strings.html Also see http://ddili.org/ders/d.en/auto_and_typeof.html for auto keyword.
Re: How to concat UUID into a SQL query string to MariaDB
On Tuesday, 27 August 2019 at 08:30:50 UTC, Jani Hur wrote: On Tuesday, 27 August 2019 at 08:08:05 UTC, Anders S wrote: Any ideas? + is not a string concatenation. Try ~ instead: auto x = "aa" ~ "bb" ~ "cc"; Hi again, the auto declaration worked as I expected my catenations should with the string So thanks
Re: How to concat UUID into a SQL query string to MariaDB
On Tuesday, 27 August 2019 at 08:30:50 UTC, Jani Hur wrote: On Tuesday, 27 August 2019 at 08:08:05 UTC, Anders S wrote: Any ideas? + is not a string concatenation. Try ~ instead: auto x = "aa" ~ "bb" ~ "cc"; Hi thanks for answer, but didn't help. Got this error instead : Error: cannot implicitly convert expression "UPDATE guirequest SET done_request = SYSDATE() WHERE request_id=" ~ cast(const(char)[])hash[cast(uint)i] ~ ";" of type char[] to string Notice you use auto x Am I better of using something like auto sql_respons ="UPDATE guirequest SET done_request = SYSDATE() WHERE request_id=" ~ hash[i] ~ ";";
Re: How to concat UUID into a SQL query string to MariaDB
On Tuesday, 27 August 2019 at 08:08:05 UTC, Anders S wrote: Any ideas? + is not a string concatenation. Try ~ instead: auto x = "aa" ~ "bb" ~ "cc";