[erlang-questions] Null parameter for ODBC param_query

Ingela Andin ingela.andin@REDACTED
Fri Apr 20 11:48:02 CEST 2012


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 <avinash@REDACTED>:
> 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
> <andy.richards.iit@REDACTED> 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
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>



More information about the erlang-questions mailing list