sqlureot (reorg api) in a stored procedure (w2k, v6.1, fp11)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mark Barinstein

    sqlureot (reorg api) in a stored procedure (w2k, v6.1, fp11)

    Hello.

    I am trying to call sqlureot from stored procedure. I use VC++ 6.0. Here is
    the c - code of my routine and DDL for creating my procedure.

    --- bisp.c sample code ---
    #include <sqlenv.h>
    #include <sqlutil.h>

    SQL_API_RC SQL_API_FN reorg(
    char fullTableName[254],
    char fullIndexName[254],
    char sysTempSpaceNam e[254],
    sqlint32 *sql_code,
    sqlint16 nullinds[4])
    {
    struct sqlca sqlca;
    sqlureot(fullTa bleName, nullinds[1]<0?NULL:fullInd exName,
    nullinds[2]<0?NULL:sysTemp SpaceName, &sqlca);
    *sql_code = sqlca.sqlcode;
    return(SQLZ_DIS CONNECT_PROC);
    }
    }
    --- bisp.c sample code end ---

    -- DDL --
    CREATE PROCEDURE mark.REORGTABLE (
    IN TABNAME CHAR(254),
    IN INDEXNAME CHAR(254),
    IN TBSPACENAME CHAR(254),
    OUT SQLCODE INTEGER)
    EXTERNAL NAME 'bisp!reorg' LANGUAGE C PARAMETER STYLE GENERAL WITH NULLS
    NOT DETERMINISTIC FENCED NO DBINFO CALLED ON NULL INPUT PROGRAM TYPE SUB;
    -- DDL end --

    Whenever I issue "call mark.reorgtable (...)" I get SQL2215N with
    sqlcode=-751.
    What did I do wrong? Who have managed to make it work on DB2 v6.1 on NT?
    With db2 vv7, 8 reorg api works in a stored procedure...

    Thanks in advance,
    Barinstein Mark.


Working...