[erlang-questions] emysql

Bernardo Alvez manprog@REDACTED
Thu Oct 31 22:21:45 CET 2013


Hi Thomas,

Why not?

Baz = <<"some_text">>,
emysql:execute(hello_pool,<<"UPDATE hello_table SET hello_text = '", Baz/binary, "'">>).

Best regards

Dmitry Kolesnikov escribió:
> Hello,
>
> You can take a look to my template library
> https://github.com/fogfish/swirl
>
> Here is quick code snippet
>
> swirl:c(my_query, "UPDATE hello_table SET hello_text = '{baz}'").
> my_query:render([{baz, "my text"}]).
>
> Output:
>
> "UPDATE hello_table SET hello_text = 'my text'"
>
> Best Regards,
> Dmitry
>
> On Oct 31, 2013, at 10:08 PM, Thomas Elsgaard <thomas.elsgaard@REDACTED> wrote:
>
>> Hi list
>>   
>> How can i easiest replace 'baz' with content from an variable ?
>>   
>> emysql:execute(hello_pool, <<"UPDATE hello_table SET hello_text = 'baz'">>)
>>   
>> Thomas
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED
>> http://erlang.org/mailman/listinfo/erlang-questions
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>




More information about the erlang-questions mailing list