<html><head></head><body data-blackberry-caret-color="#00a8df" style="background-color: rgb(255, 255, 255); line-height: initial;"><div id="BB10_response_div" style="width: 100%; font-size: initial; font-family: Calibri, 'Slate Pro', sans-serif; color: rgb(31, 73, 125); text-align: initial; background-color: rgb(255, 255, 255);"><br style="display:initial"></div> <div id="response_div_spacer" style="width: 100%; font-size: initial; font-family: Calibri, 'Slate Pro', sans-serif; color: rgb(31, 73, 125); text-align: initial; background-color: rgb(255, 255, 255);"><br style="display:initial"></div> <div id="_signaturePlaceholder" style="font-size: initial; font-family: Calibri, 'Slate Pro', sans-serif; color: rgb(31, 73, 125); text-align: initial; background-color: rgb(255, 255, 255);">I'm a little rusty on the emysql driver but I think you can :</div><div style="font-size: initial; font-family: Calibri, 'Slate Pro', sans-serif; color: rgb(31, 73, 125); text-align: initial; background-color: rgb(255, 255, 255);"><br></div><div style="font-size: initial; font-family: Calibri, 'Slate Pro', sans-serif; color: rgb(31, 73, 125); text-align: initial; background-color: rgb(255, 255, 255);">emysql:execute(hello_pool, "update hello_table set hello_text = ? where hello_id = ?", <span style="line-height: initial;">["baz", 1337]</span><span style="font-size: initial; text-align: initial; line-height: initial;">)</span></div><div style="font-size: initial; font-family: Calibri, 'Slate Pro', sans-serif; color: rgb(31, 73, 125); text-align: initial; background-color: rgb(255, 255, 255);"><br></div><div style="font-size: initial; font-family: Calibri, 'Slate Pro', sans-serif; color: rgb(31, 73, 125); text-align: initial; background-color: rgb(255, 255, 255);"><br></div> <table width="100%" style="background-color:white;border-spacing:0px;"> <tbody><tr><td id="_persistentHeaderContainer" colspan="2" style="font-size: initial; text-align: initial; background-color: rgb(255, 255, 255);"> <div id="_persistentHeader" style="border-style: solid none none; border-top-color: rgb(181, 196, 223); border-top-width: 1pt; padding: 3pt 0in 0in; font-family: Tahoma, 'BB Alpha Sans', 'Slate Pro'; font-size: 10pt;"> <div><b>From: </b>Bernardo Alvez</div><div><b>Sent: </b>Thursday, October 31, 2013 5:21 PM</div><div><b>To: </b>Thomas Elsgaard</div><div><b>Cc: </b>erlang-questions@erlang.org</div><div><b>Subject: </b>Re: [erlang-questions] emysql</div></div></td></tr></tbody></table><div id="_persistentHeaderEnd" style="border-style: solid none none; border-top-color: rgb(186, 188, 209); border-top-width: 1pt; font-size: initial; text-align: initial; background-color: rgb(255, 255, 255);"></div><br><div id="_originalContent" style="">Hi Thomas,<br><br>Why not?<br><br>Baz = <<"some_text">>,<br>emysql:execute(hello_pool,<<"UPDATE hello_table SET hello_text = '", Baz/binary, "'">>).<br><br>Best regards<br><br>Dmitry Kolesnikov escribió:<br>> Hello,<br>><br>> You can take a look to my template library<br>> https://github.com/fogfish/swirl<br>><br>> Here is quick code snippet<br>><br>> swirl:c(my_query, "UPDATE hello_table SET hello_text = '{baz}'").<br>> my_query:render([{baz, "my text"}]).<br>><br>> Output:<br>><br>> "UPDATE hello_table SET hello_text = 'my text'"<br>><br>> Best Regards,<br>> Dmitry<br>><br>> On Oct 31, 2013, at 10:08 PM, Thomas Elsgaard <thomas.elsgaard@gmail.com> wrote:<br>><br>>> Hi list<br>>> <br>>> How can i easiest replace 'baz' with content from an variable ?<br>>> <br>>> emysql:execute(hello_pool, <<"UPDATE hello_table SET hello_text = 'baz'">>)<br>>> <br>>> Thomas<br>>> _______________________________________________<br>>> erlang-questions mailing list<br>>> erlang-questions@erlang.org<br>>> http://erlang.org/mailman/listinfo/erlang-questions<br>> _______________________________________________<br>> erlang-questions mailing list<br>> erlang-questions@erlang.org<br>> http://erlang.org/mailman/listinfo/erlang-questions<br>><br><br>_______________________________________________<br>erlang-questions mailing list<br>erlang-questions@erlang.org<br>http://erlang.org/mailman/listinfo/erlang-questions<br></div></body></html>