[erlang-questions] SQLite ODBC

Robert Raschke <>
Mon Apr 26 17:20:36 CEST 2010


On Mon, Apr 26, 2010 at 4:09 PM, maruthavanan s
<>wrote:

>  Hi,
>
> Thanks a lot got the problem,
>
> When I select INT column it is working fine, but when I try to get VARCHAR
> still could not make it up.
>
> Do I need to write any custom function.
>
> I am using the below query. and get the below result.
>
>
> 11> odbc:sql_query(Pid,"select SERVER_ID from Server").
> {selected,["Server_ID"],[{2}]}
>
> 12>odbc:sql_query(Pid,"select {fn CONVERT(SERVER_IP, SQL_VARCHAR)} "har"
> from Server").
> * 1: syntax error before: har
>
> I think I dont know to proceed with ODBC functions. Please help.
>
> Thanks,
> Marutha
>
>
>
Ah, you'll need to escape internal " characters. Try:

odbc:sql_query(Pid,"select {fn CONVERT(SERVER_IP, SQL_VARCHAR)} \"har\" from
Server").


Robby


More information about the erlang-questions mailing list