SQL0444N reason code 6

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Dan Pichler
    New Member
    • May 2011
    • 1

    SQL0444N reason code 6

    I have done several hours of online research for help on this error and have had zero luck. I am hoping that someone can help.

    I have a simple stored procedure that compiles clean, but gets a SQL0444N return code 6. I am running IBM DB2 LUW v9.7.2 on windows.

    Here are the details

    The stored procedure
    ---------------------------
    CREATE OR REPLACE PROCEDURE RETURN_PLAY_SQR _COUNT (
    IN BodyKey INTEGER,
    OUT RowCount INTEGER)
    EXTERNAL NAME 'StoredProc!Ret urnPlaySqrCount '
    SPECIFIC CPP_RETURN_PLAY _SQR_COUNT
    DYNAMIC RESULT SETS 0
    NOT DETERMINISTIC
    NOT FENCED
    NOT THREADSAFE
    LANGUAGE C
    NO DBINFO
    PARAMETER STYLE GENERAL


    The server side code
    -----------------------------------
    #include <stdio.h>
    #include <string.h>
    #include <stdlib.h>
    #include <sqlda.h>
    #include <sqlca.h>
    #include <sqludf.h>
    #include <sql.h>
    #include <memory.h>

    extern "C" SQL_API_RC SQL_API_FN ReturnPlaySqrCo unt(
    sqlint32*,
    sqlint32*,
    sqlint16*,
    sqlint16*,
    char*,
    char*,
    char*,
    char* );

    SQL_API_RC SQL_API_FN ReturnPlaySqrCo unt(
    sqlint32* inBodyKey,
    sqlint32* outRowCount,
    sqlint16* inBodyKeyN,
    sqlint16* outRowCountN,
    char sqlstate[6],
    char qualName[28],
    char specName[19],
    char diagMsg[71] )
    {
    EXEC SQL INCLUDE SQLCA;

    EXEC SQL BEGIN DECLARE SECTION;
    sqlint32 BodyKey;
    sqlint32 RowCount;
    EXEC SQL END DECLARE SECTION;

    EXEC SQL SELECT count(*)INTO :RowCount
    FROM universe.playin g_square
    WHERE owner_key = :BodyKey;

    *outRowCount = RowCount;

    return (0);

    }


    client side code
    ---------------------------
    #include <stdio.h>
    #include <string.h>
    #include <stdlib.h>
    #include <sqlda.h>
    #include <sqlca.h>
    #include <sqludf.h>
    #include <sql.h>
    #include <memory.h>
    // #include "utilemb.h"

    EXEC SQL INCLUDE SQLCA;

    EXEC SQL BEGIN DECLARE SECTION;
    sqlint32 BodyKeyX;
    sqlint32 RowCountX;
    sqlint16 BKN;
    sqlint16 RCN;
    char C1[200];
    char C2[200];
    char C3[200];
    char C4[200];
    EXEC SQL END DECLARE SECTION;

    void PrintError( ) {
    printf( "********** DUMP OF SQLCA *************** *******\n" );
    printf( "SQLCAID: %s\n", sqlca.sqlcaid );
    printf( "SQLCABC: %ld\n", (long)sqlca.sql cabc );
    printf( "SQLCODE: %ld\n", (long)sqlca.sql code );
    printf( "SQLERRML: %ld\n", (long)sqlca.sql errml );
    printf( "SQLERRD[0]: %ld\n", (long)sqlca.sql errd[0] );
    printf( "SQLERRD[1]: %ld\n", (long)sqlca.sql errd[1] );
    printf( "SQLERRD[2]: %ld\n", (long)sqlca.sql errd[2] );
    printf( "SQLERRD[3]: %ld\n", (long)sqlca.sql errd[3] );
    printf( "SQLERRD[4]: %ld\n", (long)sqlca.sql errd[4] );
    printf( "SQLERRD[5]: %ld\n", (long)sqlca.sql errd[5] );
    printf( "SQLWARN: %s\n", sqlca.sqlwarn );
    printf( "SQLSTATE: %s\n", sqlca.sqlstate );
    printf( "********** END OF SQLCA DUMP *************** ****\n") ;

    char msg[1025];
    sqlaintp( msg, 1024, 0, &sqlca );
    printf( "%s\n", msg );
    }

    int main( ) {
    BodyKeyX = 1011111;
    RowCountX = -1;
    EXEC SQL CONNECT TO SAMPLE;
    EXEC SQL CALL RETURN_PLAY_SQR _COUNT( :BodyKeyX:BKN, :RowCountX:RCN );
    PrintError();
    }



    THE RESULTS...
    -----------------------------
    ********** DUMP OF SQLCA *************** *******
    SQLCAID: SQLCA ê
    SQLCABC: 136
    SQLCODE: -444
    SQLERRML: 70
    SQLERRD[0]: 0
    SQLERRD[1]: 0
    SQLERRD[2]: 0
    SQLERRD[3]: 0
    SQLERRD[4]: 0
    SQLERRD[5]: 0
    SQLWARN: 42724ºm☼
    SQLSTATE: 42724ºm☼
    ********** END OF SQLCA DUMP *************** ****
    SQL0444N Routine "*QR_COUNT" (specific name "CPP_RETURN_PLA Y_SQR_COUNT") is implemented with code in library or path "...StoredProc" , function "ReturnPlaySqrC ount" which cannot be accessed. Reason code: "6". SQLSTATE=42724




    Any help would be greatly appreciated!!!
    Thanks - DP
Working...