Example #1
0
OCI_Date * OCI_API OCI_MsgGetEnqueueTime
(
    OCI_Msg *msg
)
{
    boolean res    = TRUE;
    OCI_Date *date = NULL;
    OCIDate oci_date;

    OCI_CHECK_PTR(OCI_IPC_MSG, msg, NULL);

    OCI_CALL2
    (
        res, msg->typinf->con,

        OCIAttrGet((dvoid *) msg->proph,
                   (ub4    ) OCI_DTYPE_AQMSG_PROPERTIES,
                   (dvoid *) &oci_date,
                   (ub4   *) NULL,
                   (ub4    ) OCI_ATTR_ENQ_TIME,
                   msg->typinf->con->err)
    )

    if (res == TRUE)
    {
        date = OCI_DateInit(msg->typinf->con, &msg->date, &oci_date, FALSE, FALSE);

        res = (date != NULL);
    }

    OCI_RESULT(res);

    return date;
}
Example #2
0
OCI_Date * OCI_API OCI_DateCreate
(
    OCI_Connection *con
)
{
    OCI_LIB_CALL_ENTER(OCI_Date*, NULL)

    OCI_CHECK_INITIALIZED()

    call_retval = OCI_DateInit(con, &call_retval, NULL, TRUE, FALSE);
    call_status = (NULL != call_retval);

    OCI_LIB_CALL_EXIT()
}
boolean OCI_ArrayInit
(
    OCI_Array    *arr,
    OCI_TypeInfo *typinf
)
{
    unsigned int i;

    for (i = 0; i < arr->nb_elem; i++)
    {
        void *handle = NULL;

        if (OCI_CDT_DATETIME == arr->elem_type)
        {
            handle = &(((OCIDate *)(arr->mem_handle))[i]);
        }
        else
        {
            handle = ((void **)(arr->mem_handle))[i];
        }

        arr->tab_obj[i] = ((char *) arr->mem_struct) + (arr->struct_size * i);

        ((OCI_Datatype *) (arr->tab_obj[i]))->hstate = OCI_OBJECT_ALLOCATED_ARRAY;

        switch (arr->elem_type)
        {
            case OCI_CDT_DATETIME:
            {
                OCI_DateInit(arr->con, (OCI_Date **) &arr->tab_obj[i],
                             (OCIDate *) handle, FALSE, FALSE);
                break;
            }
            case OCI_CDT_LOB:
            {
                OCI_LobInit(arr->con, (OCI_Lob **) &arr->tab_obj[i],
                            (OCILobLocator *) handle, arr->elem_subtype);
                break;
            }
            case OCI_CDT_FILE:
            {
                OCI_FileInit(arr->con, (OCI_File **) &arr->tab_obj[i],
                             (OCILobLocator *) handle, arr->elem_subtype);
                break;
            }
            case OCI_CDT_TIMESTAMP:
            {
                OCI_TimestampInit(arr->con, (OCI_Timestamp **) &arr->tab_obj[i],
                                  (OCIDateTime *) handle, arr->elem_subtype);
                break;
            }
            case OCI_CDT_INTERVAL:
            {
                OCI_IntervalInit(arr->con, (OCI_Interval **) &arr->tab_obj[i],
                                 (OCIInterval *) handle, arr->elem_subtype);
                break;
            }
            case OCI_CDT_OBJECT:
            {
                OCI_ObjectInit(arr->con, (OCI_Object **) &arr->tab_obj[i],
                               handle, typinf, NULL, -1, TRUE);
                break;
            }
            case OCI_CDT_COLLECTION:
            {
                OCI_CollInit(arr->con, (OCI_Coll **) &arr->tab_obj[i], handle, typinf);
                break;
            }
            case OCI_CDT_REF:
            {
                OCI_RefInit(arr->con, &typinf, (OCI_Ref **) &arr->tab_obj[i], handle);
                break;
            }
        }
    }

    return TRUE;
}