[erlang-questions] HowTo: Stored Procedure

Robert Raschke <>
Wed Feb 4 10:45:30 CET 2009


On Tue, Feb 3, 2009 at 7:17 PM, marmll <> wrote:
> i must call a stored procedure on a MS SQL Server 2005 database. How can i
> do it with erlang ? I have an ODBC Driver installed and everything works
> fine. I can make select, insert over param_query but how can i execute an
> parameter stored procedure ? a code snip was very nice

This an ODBC question rather than an Erlang one. In ODBC you can say:

{call storedproc(params)}

For example:

19> odbc:sql_query(R1, "{call sp_server_info}").
{selected,["attribute_id","attribute_name",
           "attribute_value"],
          [{1,"DBMS_NAME","Microsoft SQL Server"},
           {2,"DBMS_VER","Microsoft SQL Server Yukon - 9.00.3042"},
           {10,"OWNER_TERM","owner"},
           {11,"TABLE_TERM","table"},
etc.

Any params have to be given by position, rather than named. I have no
idea how in/out params work.

Robby



More information about the erlang-questions mailing list