def numpy2oracle(dtype):
    """Takes a numpy dtype object and converts to an Oracle data type
    string.

    TODO: Vectorize?

    Parameters:
    ----------
    dtype: Numpy dtype object

    Returns:
    --------
    otype: Oracle data type string
    """
    kind = dtype.kind
    size = dtype.itemsize
    if kind == 'S':
        return 'VARCHAR2(%d)' % size
    elif kind == 'i' or kind == 'u':
        if size == 1:
            return 'NUMBER(3,0)'
        elif size == 2:
            return 'NUMBER(5,0)'
        elif size == 4:
            return 'NUMBER(10,0)'
        else:
            return 'NUMBER(20,0)'
    elif kind == 'f':
        if size == 4:
            return 'BINARY_FLOAT'
        elif size == 8:
            return 'BINARY_DOUBLE'
        else:
            msg = 'Unsupported float type: %s' % kind
            raise ValueError(msg)
    elif kind == 'M':
        return 'DATETIME'
    elif kind == 'O':
        return 'OBJECT'
    else:
        return ''
