[erlang-questions] How to insert null value into map

Palanikumar Gopalakrishnan palani@REDACTED
Wed Sep 13 14:50:38 CEST 2017


Hi Hugo,

                Null value showed in sql

 +---------------------+
| NULL                |
| NULL                |
+---------------------+

When we applied it with map like below, It returns the following error








*(cowboy_ws_server@REDACTED)27> maps:get("A", NULL, Some).* 1: variable
'NULL' is unbound(cowboy_ws_server@REDACTED)28> *


On 13 September 2017 at 17:35, Hugo Mills <hugo@REDACTED> wrote:

> On Wed, Sep 13, 2017 at 05:01:37PM +0530, Palanikumar Gopalakrishnan wrote:
> > Hi Guys,
> >                 I want to get data from mysql and append them into map.
> But
> > some row had null values. Hence i cant able to convert the null value
> into
> > map. Its there any way to convert null value into map.
>
>    Why can't you put nulls into a map? This works, for example:
>
> 2> #{null => null}.
> #{null => null}
>
> so we can clearly put some null atom in both key and value positions
> in a map.
>
>    If you could show an example row without a null, and what that
> turns into when you put it in a map, and then show how this fails when
> you do have a null, then it might be easier to answer your question.
>
>    Hugo.
>
> --
> Hugo Mills             | Klytus! Are your men on the right pills? Maybe you
> hugo@REDACTED carfax.org.uk | should execute their trainer!
> http://carfax.org.uk/  |
> PGP: E2AB1DE4          |                      Ming the Merciless, Flash
> Gordon
>



-- 

*Warm Regards,*

*Palanikumar Gopalakrishnan *[image: ✌]
*Developer*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170913/e8c9096b/attachment.htm>


More information about the erlang-questions mailing list