[erlang-questions] Null parameter for ODBC param_query

Andy Richards <>
Fri Apr 20 12:29:49 CEST 2012


Hi Ingela,

Thanks for the confirmation we'll probably proceed with the sql_query approach then. If possible I'll feed what i can back to the community.

I intend to submit a patch for the socket issue I found however unfortunately the steps outlined at https://github.com/erlang/otp/wiki/submitting-patches fail for me even after getting the appropriate git ports opened through our corporate firewall. I'll post a separate thread detailing the error.

Thanks,

Andy.

Sent from my iPad

On 20 Apr 2012, at 10:48, Ingela Andin <> wrote:

> Hi!
> 
> The problem is that with param_query  at the moment does not support
> all data types and null
> values that will be handled by sql_query.  If someone wants this you
> are more then welcome to contribute. I can not see that this would get
> a high priority any time soon within Ericsson.
> 
> Please submit your socket issue patch so that other people also can
> benefit from it.
> 
> Regards Ingela Erlang/OTP team - Ericsson AB
> 
> 2012/4/20, Avinash Dhumane <>:
>> I use the ODBC application of Erlang (presently, on R14B02) quite heavily
>> and with proprietary drivers like AS400 and Netezza.
>> 
>> I rely on odbc:sql_query() - even with parameters - more than on
>> odbc:param_query(). I use the latter only when to submit a batch of
>> INSERTs. With former, I construct the SQL string by duly substituting all
>> the parameter values and submit. So, the submission through ODBC becomes
>> exactly same as I would do on the SQL command-line interface tool provided
>> by the DBMS. Applying to your case, I would have done as follows:
>> 
>> lists:flatten(io_lib:fwrite("exec User_Read ~w", [Param])
>> 
>> On Thu, 19 Apr 2012 18:54:16 +0530, Andy Richards
>> <> wrote:
>> 
>>> Hi all,
>>> 
>>> I found this previous unanswered post to the mailing list and I now face
>>> the same problem....
>>> 
>>> http://erlang.2086793.n4.nabble.com/NULL-parameter-for-ODBC-param-query-td3226735.html
>>> 
>>>> "Is it possible to use null values in a parameterised odbc param_query?
>>>> 
>>>> example: odbc:param_query("exec User_Read ?", [{sql_integer, Param}]).
>>>> %
>>>> Param is either an integer or null
>>>> 
>>>> The odbc driver returns the 'null' atom when selecting rows, but I
>>>> haven't
>>>> found a value that allows me to specify a null parameter ('null',
>>>> 'NULL',
>>>> <<"null">>, etc...)"
>>> 
>>> 
>>> According to the documentation value = null | term() however an
>>> exception is thrown if the atom null is used?
>>> 
>>> Has anyone come across this or are there any workarounds to this issue ?
>>> 
>>> I've already patched the c portion of the odbc driver to resolve a
>>> socket issue under Linux so I'm wondering if this module is used much in
>>> the Erlang world?
>>> 
>>> Many thanks,
>>> 
>>> Andy.
>>> 
>>> 
>>> 
>> 
>> 
>> --
>> Using Opera's revolutionary email client: http://www.opera.com/mail/
>> _______________________________________________
>> erlang-questions mailing list
>> 
>> http://erlang.org/mailman/listinfo/erlang-questions
>> 



More information about the erlang-questions mailing list