See Also
You are here: Interfacing > C++ Client Interface > Examples C++ Client Interface > User Defined Procedure
ContentsIndexHome
PreviousUpNext
User Defined Procedure
User Defined Stored Procedure - Example

 

Create DLL project. This needs to be linked against scdriver.lib static library and require C++ client SDK (included in all examples for download). You must also export 'Test' function. 

The procedure will perform simple SQL select query. To registry DLL use ADD MODULE command, and to execute use "EXECUTE UDI [mymodule@test]" command. 

 

// used by Microsoft Visual Studio Projects
#include "stdafx.h"

#include "scdriver.h"

void Test(CServerConnection *conn)
{
    try
    {
    CRecordset rec;
    CCommand cmd;
    cmd.PrepareText(conn,"select * from system.systables");
    cmd.Open(&rec);
    }
    catch (node_exception& e)
    {
    conn->RaiseExeption(e.msg);
    }
}

 

 

 

Related