Beispiel #1
0
SQLRETURN _FreeStmtList( SQLHDBC hDrvDbc )
{
	HDRVDBC hDbc	= (HDRVDBC)hDrvDbc;

	if ( hDbc == SQL_NULL_HDBC )
		return SQL_SUCCESS;

	if ( hDbc->hFirstStmt == NULL )
		return SQL_SUCCESS;
	
	while ( _FreeStmt( hDbc->hFirstStmt ) == SQL_SUCCESS )
	{
	}

	return SQL_SUCCESS;
}
Beispiel #2
0
SQLRETURN SQLFreeStmt(	SQLHSTMT        hDrvStmt,
						SQLUSMALLINT    nOption )
{
    HDRVSTMT hStmt	= (HDRVSTMT)hDrvStmt;

	/* SANITY CHECKS */
    if( hStmt == SQL_NULL_HSTMT )
        return SQL_INVALID_HANDLE;

	sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt );
    logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg );

    /*********
     * RESET PARAMS
     *********/
    switch( nOption )
    {
	case SQL_CLOSE:
		break;

    case SQL_DROP:
        return _FreeStmt( hStmt );

	case SQL_UNBIND:
		break;

    case SQL_RESET_PARAMS:
        break;

    default:
		sprintf((char*) hStmt->szSqlMsg, "SQL_ERROR Invalid nOption=%d", nOption );
		logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg );
        return SQL_ERROR;
    }

    return SQL_SUCCESS;
}
Beispiel #3
0
SQLRETURN  SQLFreeHandle(    SQLSMALLINT    nHandleType,
                             SQLHANDLE      nHandle
                        )
{
    switch( nHandleType )
    {
    case SQL_HANDLE_ENV:
        return _FreeEnv( (SQLHENV)nHandle );

    case SQL_HANDLE_DBC:
        return _FreeConnect( (SQLHDBC)nHandle );

    case SQL_HANDLE_STMT:
        return _FreeStmt( (SQLHSTMT)nHandle );

    case SQL_HANDLE_DESC:
        break;

	default:
		return SQL_ERROR;
    }

    return SQL_ERROR;
}
SQLRETURN _FreeStmtList( SQLHDBC hDrvDbc )
{
	#ifndef __FUNC__
		#define _OTAR_RM_FUNC_
		#define __FUNC__ "_FreeStmtList"
	#endif
	HDRVDBC hDbc	= (HDRVDBC)hDrvDbc;

	if ( hDbc == SQL_NULL_HDBC )
		return SQL_SUCCESS;

	if ( hDbc->hFirstStmt == NULL )
		return SQL_SUCCESS;
	
	while ( _FreeStmt( hDbc->hFirstStmt ) == SQL_SUCCESS )
	{
	}

	return SQL_SUCCESS;
	#ifdef _OTAR_RM_FUNC_
		#undef _OTAR_RM_FUNC_
		#undef __FUNC__
	#endif
}