Forum: Ruby on Rails How to call stored procedure on iodbc

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
682160c839461c5ace2e7284da8298f7?d=identicon&s=25 vikas (Guest)
on 2007-04-18 16:40
(Received via mailing list)
Hi all,
I am getting a problem in calling Stored Procedure from C++
application on macintosh using OpenLink.

Exact scenario is that my stored procedure takes 6 parameters out of
which 1 parameter is out parameter and other 5 are input parameters.

So it uses 5 IN parameters as values for inserting a row in database
and returns its max id as out parameter.

Code Snippet is given below :--

    SWORD  returnCode = 0;
    SDWORD bindReturnCode = 0;
    RETCODE returnVal;
    char sqlString[500];

    HSTMT hstmt = ptrDB->GetHSTMT();
    returnVal = SQLAllocStmt(ptrDB->GetHDBC(), &hstmt);

    if (returnVal == SQL_SUCCESS)
        returnVal = SQLBindParameter(hstmt, 1, SQL_PARAM_OUTPUT,
                           0,0, &returnCode,0, &bindReturnCode);

        //strcpy(sqlString,"{call PI_ShBlobData (?, 0, 0, 0,
EMPTY_BLOB(), null)}");
        returnVal = SQLExecDirectA(hstmt, (UCHAR*)sqlString,

    refPk = returnCode;
    bRetVal = true;

SQLFreeStmt(hstmt, SQL_DROP);

Thanks for help in advance.
682160c839461c5ace2e7284da8298f7?d=identicon&s=25 vikas (Guest)
on 2007-04-24 12:19
(Received via mailing list)
Got the solution!!!

This topic is locked and can not be replied to.