OCILIB new Features coming soon !


Hello all,

The new version of OCILIB v.3.7.0 is bringing new features :

This version will be released by mi july !

Here is an example of basic AQ use in OCILIB :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
    
    #include "ocilib.h"
    
    int main(int argc, char *argv[])
    {
        OCI_Connection *con;
        OCI_Enqueue    *enq;
        OCI_Dequeue    *deq;
        OCI_Msg        *msg;
        OCI_TypeInfo   *inf;
        OCI_Object     *obj;
       
        OCI_Initialize(NULL, NULL, OCI_ENV_DEFAULT);
         
        con = OCI_ConnectionCreate("db", "usr", "pwd", OCI_SESSION_DEFAULT);
    
        inf = OCI_TypeInfoGet(con, "MY_MESSAGE", OCI_TIF_TYPE);
        
        enq = OCI_EnqueueCreate(inf, "my_queue");
        deq = OCI_DequeueCreate(inf, "my_queue");
        
        msg = OCI_MsgCreate(inf);
        obj = OCI_ObjectCreate(con, inf);
    
        OCI_ObjectSetString(obj, "TITLE", "NEXT MEETING");
        OCI_ObjectSetString(obj, "CONTENT", "12:00 PM IN STARBUCKS");
    
        OCI_MsgSetObject(msg, obj);
    
        OCI_EnqueuePut(enq, msg);
    
        OCI_MsgFree(msg);
        OCI_ObjectFree(obj);
    
        OCI_Commit(con);
        
        msg = OCI_DequeueGet(deq);
        obj = OCI_MsgGetObject(msg);
    
        printf("MSG '%s' => %s\n",  OCI_ObjectGetString(obj, "TITLE"),
                                    OCI_ObjectGetString(obj, "CONTENT"));
    
        OCI_Commit(con);
    
        OCI_EnqueueFree(enq);
        OCI_DequeueFree(deq);
    
        OCI_ConnectionFree(con);
    
        OCI_Cleanup();
    
       return EXIT_SUCCESS;
    }