orclib-users Mailing List for OCILIB - C and C++ Driver for Oracle (Page 6)
Open source C and C++ library for accessing Oracle Databases
Brought to you by:
vince_del_paris
You can subscribe to this list here.
2008 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
2011 |
Jan
(1) |
Feb
(3) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
(5) |
Apr
(16) |
May
(2) |
Jun
(4) |
Jul
|
Aug
(6) |
Sep
(5) |
Oct
(4) |
Nov
|
Dec
(12) |
2013 |
Jan
(6) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(5) |
Sep
(4) |
Oct
|
Nov
(8) |
Dec
|
2014 |
Jan
|
Feb
|
Mar
(2) |
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(4) |
Dec
|
2015 |
Jan
(18) |
Feb
(9) |
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(5) |
Dec
(1) |
2016 |
Jan
(1) |
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Coulibaly O. D. <cou...@ca...> - 2011-03-11 06:34:12
|
Hi, I change like this : .... else if (OCI_ColumnGetType(col)==OCI_CDT_LOB) { OCI_Lob * data = (OCI_Lob *) OCI_BindGetData(bnd); OCI_Lob **photo = (OCI_Lob **)data; boolean a = OCI_LobAssign(photo[pos], OCI_GetLob(rs_src, i)); } But OCI_LobAssign always return FALSE in my case. Regards 2011/3/10, vincent rogier <vin...@ya...>: > you can't do : > > photo[pos] =OCI_GetLob(rs_src, i); > > you should do ;: > > OCI_LobAssign(photo[pos], OCI_GetLob(rs_src, i)); > > 2011/3/10 Coulibaly Ouekalo Daniel <cou...@ca...> > >> Hi, >> >> I have a problem when i try to insert a array of blob. >> There is a part of code : >> >> if (OCI_IsNull(rs_src, i)) >> { >> OCI_BindSetNullAtPos(bnd, pos); >> } >> else if (OCI_ColumnGetType(col)==OCI_CDT_LOB) >> { >> OCI_Lob * data = (OCI_Lob *) OCI_BindGetData(bnd); >> OCI_Lob **photo = (OCI_Lob **)data; >> photo[pos] =OCI_GetLob(rs_src, i); >> } >> else >> {.....} >> >> ........ >> OCI_Execute(st) >> >> the OCI_Execute(st) encounter errors >> >> >> ------------------------------------------------------------------------------ >> Colocation vs. Managed Hosting >> A question and answer guide to determining the best fit >> for your organization - today and in the future. >> http://p.sf.net/sfu/internap-sfd2d >> _______________________________________________ >> Orclib-users mailing list >> Orc...@li... >> https://lists.sourceforge.net/lists/listinfo/orclib-users >> > > > > -- > Vincent Rogier > |
From: Coulibaly O. D. <cou...@ca...> - 2011-03-10 19:44:33
|
Hi, I have a problem when i try to insert a array of blob. There is a part of code : if (OCI_IsNull(rs_src, i)) { OCI_BindSetNullAtPos(bnd, pos); } else if (OCI_ColumnGetType(col)==OCI_CDT_LOB) { OCI_Lob * data = (OCI_Lob *) OCI_BindGetData(bnd); OCI_Lob **photo = (OCI_Lob **)data; photo[pos] =OCI_GetLob(rs_src, i); } else {.....} ........ OCI_Execute(st) the OCI_Execute(st) encounter errors |
From: vincent r. <vin...@ya...> - 2011-02-13 12:42:58
|
use the right printf token for integers : printf("FILL_VOL %d \n", OCI_ObjectGetUnsignedInt(MyObj, "FILL_VOL")); Regards, Vincent Rogier 2011/2/13 Hayyan Rafiq <hay...@ho...> > Problem solved.... I managed to solve the problem and now its worrking > great. However I have one last question > when i use > printf("SYMBOL %s \n", OCI_ObjectGetString(MyObj, "SYMBOL")); > The output is correct as the above is a string > however when i use > printf("FILL_VOL %s \n", OCI_ObjectGetUnsignedInt(MyObj, "FILL_VOL")); > I get an error as above is a number any idea what i should use??? > > ------------------------------ > From: hay...@ho... > To: orc...@li... > Subject: Problem with advancedQues > Date: Sun, 13 Feb 2011 08:32:42 +0000 > > > Hi I just started using OCILIB and so far I just got it to unblock whenever > there is an object in my Queues. > Here is what really happens when the queue is empty > my_msg = OCI_DequeueGet(MyDeque); > Blocks as it should however when I insert something into the Queue the > above procedure unblocks however my_msg is still NULL. Any idea what i could > be doing wrong > here ?? The code which i wrote is given below:: > > OCI_Connection *con; > OCI_Agent *MyAgent; > OCI_Agent *RetAgent; > OCI_Dequeue *MyDeque; > OCI_TypeInfo *Typeinf; > boolean ConsRet; > boolean AgentSet; > OCI_Msg *my_msg; > boolean BoolDequeueSetAgentList; > boolean DeqMode; > boolean set_msg; > OCI_Object *MyObj; > > > OCI_Initialize(NULL, NULL,OCI_ENV_DEFAULT); //OCI_ENV_CONTEXT > OCI_ENV_DEFAULT > > con = OCI_ConnectionCreate(ConnString , username, pass, > OCI_SESSION_DEFAULT); > > //Create Agent which holds the consumer Name > MyAgent = OCI_AgentCreate(con,AgentName,AgentAddress); //Agent Name = > ULTRADBA Address=ULTRADBA.ACT_Q //OK > > //Set The Agent Name > AgentSet = OCI_AgentSetName(MyAgent,AgentName); //OKAY > //AgentName > > //Create a Type Info Indicating Object Payload > Typeinf = > OCI_TypeInfoGet(con,"ULTRADBA.ACTIVITY_DET_QMSG",OCI_TIF_TYPE); //Okay > > //Use OCI_DequeueCreate To Initialize Dequeing > MyDeque = OCI_DequeueCreate(Typeinf, QueueName); ///NOT SURE //QUEUE > NAME > > > //OCI_DequeueSetAgentList Attach agent with deque > BoolDequeueSetAgentList = OCI_DequeueSetAgentList(MyDeque,&MyAgent,1); > //OK > > //ConsRet Set Consumer > ConsRet = OCI_DequeueSetConsumer(MyDeque,NULL); //OKAY > > printf("Starting Listening To Messages \n"); > > > //Listen For Messages Using OCI_DequeueListen > RetAgent = OCI_DequeueListen(MyDeque,80); //Agent Address Returned > //OCI_DequeueSetWaitTime(MyDeque,200); //OKAY > > > ////////////////////////////////////////////////////////////////////////////////////////// > ///////////////////////////////////SETUP THE > MESSAGE////////////////////////////////////// > my_msg = OCI_MsgCreate(Typeinf); > MyObj = OCI_ObjectCreate(con, Typeinf); > set_msg = OCI_MsgSetObject(my_msg,MyObj); > OCI_MsgFree(my_msg); > > ////////////////////////////////////////////////////////////////////////////////////////// > > //DeqMode= OCI_DequeueSetMode(MyDeque,OCI_ADM_REMOVE ); > my_msg = OCI_DequeueGet(MyDeque); //Blocking Call > > > MyObj = OCI_MsgGetObject(my_msg); > > //Get Consumer Name using OCI_DequeueGetConsumer > > // printf("Messages Received \n"); > > > ///================================================================================ > > ////=============================================================================== > > /////============================================================================== > > printf("Consumer Name %s",OCI_DequeueGetConsumer(MyDeque)); > > > Any help would be appreciated... Thanks > > > ------------------------------------------------------------------------------ > The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: > Pinpoint memory and threading errors before they happen. > Find and fix more than 250 security defects in the development cycle. > Locate bottlenecks in serial and parallel code that limit performance. > http://p.sf.net/sfu/intel-dev2devfeb > _______________________________________________ > Orclib-users mailing list > Orc...@li... > https://lists.sourceforge.net/lists/listinfo/orclib-users > > -- Vincent Rogier |
From: Hayyan R. <hay...@ho...> - 2011-02-13 11:06:05
|
Problem solved.... I managed to solve the problem and now its worrking great. However I have one last question when i use printf("SYMBOL %s \n", OCI_ObjectGetString(MyObj, "SYMBOL")); The output is correct as the above is a string however when i use printf("FILL_VOL %s \n", OCI_ObjectGetUnsignedInt(MyObj, "FILL_VOL")); I get an error as above is a number any idea what i should use??? From: hay...@ho... To: orc...@li... Subject: Problem with advancedQues Date: Sun, 13 Feb 2011 08:32:42 +0000 Hi I just started using OCILIB and so far I just got it to unblock whenever there is an object in my Queues. Here is what really happens when the queue is empty my_msg = OCI_DequeueGet(MyDeque); Blocks as it should however when I insert something into the Queue the above procedure unblocks however my_msg is still NULL. Any idea what i could be doing wrong here ?? The code which i wrote is given below:: OCI_Connection *con; OCI_Agent *MyAgent; OCI_Agent *RetAgent; OCI_Dequeue *MyDeque; OCI_TypeInfo *Typeinf; boolean ConsRet; boolean AgentSet; OCI_Msg *my_msg; boolean BoolDequeueSetAgentList; boolean DeqMode; boolean set_msg; OCI_Object *MyObj; OCI_Initialize(NULL, NULL,OCI_ENV_DEFAULT); //OCI_ENV_CONTEXT OCI_ENV_DEFAULT con = OCI_ConnectionCreate(ConnString , username, pass, OCI_SESSION_DEFAULT); //Create Agent which holds the consumer Name MyAgent = OCI_AgentCreate(con,AgentName,AgentAddress); //Agent Name = ULTRADBA Address=ULTRADBA.ACT_Q //OK //Set The Agent Name AgentSet = OCI_AgentSetName(MyAgent,AgentName); //OKAY //AgentName //Create a Type Info Indicating Object Payload Typeinf = OCI_TypeInfoGet(con,"ULTRADBA.ACTIVITY_DET_QMSG",OCI_TIF_TYPE); //Okay //Use OCI_DequeueCreate To Initialize Dequeing MyDeque = OCI_DequeueCreate(Typeinf, QueueName); ///NOT SURE //QUEUE NAME //OCI_DequeueSetAgentList Attach agent with deque BoolDequeueSetAgentList = OCI_DequeueSetAgentList(MyDeque,&MyAgent,1); //OK //ConsRet Set Consumer ConsRet = OCI_DequeueSetConsumer(MyDeque,NULL); //OKAY printf("Starting Listening To Messages \n"); //Listen For Messages Using OCI_DequeueListen RetAgent = OCI_DequeueListen(MyDeque,80); //Agent Address Returned //OCI_DequeueSetWaitTime(MyDeque,200); //OKAY ////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////SETUP THE MESSAGE////////////////////////////////////// my_msg = OCI_MsgCreate(Typeinf); MyObj = OCI_ObjectCreate(con, Typeinf); set_msg = OCI_MsgSetObject(my_msg,MyObj); OCI_MsgFree(my_msg); ////////////////////////////////////////////////////////////////////////////////////////// //DeqMode= OCI_DequeueSetMode(MyDeque,OCI_ADM_REMOVE ); my_msg = OCI_DequeueGet(MyDeque); //Blocking Call MyObj = OCI_MsgGetObject(my_msg); //Get Consumer Name using OCI_DequeueGetConsumer // printf("Messages Received \n"); ///================================================================================ ////=============================================================================== /////============================================================================== printf("Consumer Name %s",OCI_DequeueGetConsumer(MyDeque)); Any help would be appreciated... Thanks |
From: Hayyan R. <hay...@ho...> - 2011-02-13 08:32:49
|
Hi I just started using OCILIB and so far I just got it to unblock whenever there is an object in my Queues. Here is what really happens when the queue is empty my_msg = OCI_DequeueGet(MyDeque); Blocks as it should however when I insert something into the Queue the above procedure unblocks however my_msg is still NULL. Any idea what i could be doing wrong here ?? The code which i wrote is given below:: OCI_Connection *con; OCI_Agent *MyAgent; OCI_Agent *RetAgent; OCI_Dequeue *MyDeque; OCI_TypeInfo *Typeinf; boolean ConsRet; boolean AgentSet; OCI_Msg *my_msg; boolean BoolDequeueSetAgentList; boolean DeqMode; boolean set_msg; OCI_Object *MyObj; OCI_Initialize(NULL, NULL,OCI_ENV_DEFAULT); //OCI_ENV_CONTEXT OCI_ENV_DEFAULT con = OCI_ConnectionCreate(ConnString , username, pass, OCI_SESSION_DEFAULT); //Create Agent which holds the consumer Name MyAgent = OCI_AgentCreate(con,AgentName,AgentAddress); //Agent Name = ULTRADBA Address=ULTRADBA.ACT_Q //OK //Set The Agent Name AgentSet = OCI_AgentSetName(MyAgent,AgentName); //OKAY //AgentName //Create a Type Info Indicating Object Payload Typeinf = OCI_TypeInfoGet(con,"ULTRADBA.ACTIVITY_DET_QMSG",OCI_TIF_TYPE); //Okay //Use OCI_DequeueCreate To Initialize Dequeing MyDeque = OCI_DequeueCreate(Typeinf, QueueName); ///NOT SURE //QUEUE NAME //OCI_DequeueSetAgentList Attach agent with deque BoolDequeueSetAgentList = OCI_DequeueSetAgentList(MyDeque,&MyAgent,1); //OK //ConsRet Set Consumer ConsRet = OCI_DequeueSetConsumer(MyDeque,NULL); //OKAY printf("Starting Listening To Messages \n"); //Listen For Messages Using OCI_DequeueListen RetAgent = OCI_DequeueListen(MyDeque,80); //Agent Address Returned //OCI_DequeueSetWaitTime(MyDeque,200); //OKAY ////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////SETUP THE MESSAGE////////////////////////////////////// my_msg = OCI_MsgCreate(Typeinf); MyObj = OCI_ObjectCreate(con, Typeinf); set_msg = OCI_MsgSetObject(my_msg,MyObj); OCI_MsgFree(my_msg); ////////////////////////////////////////////////////////////////////////////////////////// //DeqMode= OCI_DequeueSetMode(MyDeque,OCI_ADM_REMOVE ); my_msg = OCI_DequeueGet(MyDeque); //Blocking Call MyObj = OCI_MsgGetObject(my_msg); //Get Consumer Name using OCI_DequeueGetConsumer // printf("Messages Received \n"); ///================================================================================ ////=============================================================================== /////============================================================================== printf("Consumer Name %s",OCI_DequeueGetConsumer(MyDeque)); Any help would be appreciated... Thanks |
From: Ameo G. <ame...@re...> - 2011-01-31 14:28:00
|
Hi Team, I was creating Session Pool using OCI_ConnPool *pool = OCI_PoolCreate("service", "user","pwd", OCI_POOL_SESSION, OCI_SESSION_DEFAULT, 2, 10, 2); OCI_Connection cn1 = OCI_PoolGetConnection(pool, NULL); OCI_Connection cn2 = OCI_PoolGetConnection(pool, NULL); Second call to getConnection is failing with "ORA-24427: Invalid attributes on user handle" Source: Connection.c - OCISessionGet (Line: 504) OCILib v3.8.1 Oracle Version: 11gR2 /Ameo Email: ame...@re...<mailto:ame...@re...> |
From: Xun C. <ch...@av...> - 2009-11-09 11:09:58
|
Thanks for you prompt reply. I added some printf() in string.c and recompiled the library. I found it returns in the check at function OCI_StringToStringPtr() . That is wired. Is the handle in the OCI_Elem struct initialized properly after calling the OCI_ElemCreate()? Btw, I didn't encounter problem with OCI_ObjectSetString(). Best, Xun ________________________________ ???: vincent rogier [mailto:vin...@gm...] ????: 2009?11?9? ??? 18:47 ???: Xun Chen ??: Re: ??: [Bulk] [Orclib-users] how to pass a varray of varchar2 to oracle database using ocilib the check is normal... OCI_ElemSetString() calls OCI_ElemSetNull() is the passed string is null and OCI_StringToStringPtr() if not. 2009/11/9 Xun Chen <ch...@av...> Hi Vincent, Thanks for your reply. But I found that the function OCI_ElemSetString() always returns false. It returns false when performing the check of OCI_CHECK(str == NULL, FALSE); in line 664 of the source file string.c. Best regards, Xun ________________________________ ???: vin...@gm... [mailto:vin...@gm...] ?? vincent rogier ????: 2009?11?9? ??? 18:05 ???: Xun Chen ??: Re: [Bulk] [Orclib-users] how to pass a varray of varchar2 to oracle database using ocilib Hi Xun, there is a error in your code. It should be : /* .. */ type = OCI_TypeInfoGet(conn, "string_array20", OCI_TIF_TYPE); vchars = OCI_CollCreate(type); elem = OCI_ElemCreate(type); for (i=0; i<n; i++) { OCI_ElemSetString(elem, s[i])); OCI_CollAppend(vchars, elem); } /* .. */ Regards, Vincent 2009/11/9 Xun Chen <ch...@av...> Hi, I want to call a procedure which take a varray of varchar2 as a in parameter. As a test, I write the following code to set the data OCI_Coll * vchars; OCI_Elem * elem; OCI_TypeInfo *type; char s[5][64]; int n; strcpy(s[0], "2009-01-04 11:22:15"); strcpy(s[1], "2009-03-14 01:12:25"); strcpy(s[2], "2009-04-24 11:42:35"); strcpy(s[3], "2009-05-04 21:52:45"); strcpy(s[4], "2009-06-04 13:32:55"); .... n=5; type = OCI_TypeInfoGet(conn, "string_array20", OCI_TIF_TYPE); vchars = OCI_CollCreate(type); for (i=0; i<n; i++) { elem = OCI_ElemCreate(type); OCI_ElemSetColl(elem, vchars); OCI_ElemSetString(elem, s[i])); OCI_CollAppend(vchars, elem); } where string_array20 is defined by following pl/sql statement: create type string_array20 is varray(20) of varchar2(64); Run the code show following message: Elements are not compatible. It seems that I should not use OCI_ElemSetString() here. If so, what should I do to pass such a data type to the database? Best regards, Xun ---------------------------------------------------------------------------- -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Orclib-users mailing list Orc...@li... https://lists.sourceforge.net/lists/listinfo/orclib-users -- Vincent Rogier -- Vincent Rogier |
From: Xun C. <ch...@av...> - 2009-11-09 10:36:57
|
Hi Vincent, Thanks for your reply. But I found that the function OCI_ElemSetString() always returns false. It returns false when performing the check of OCI_CHECK(str == NULL, FALSE); in line 664 of the source file string.c. Best regards, Xun ________________________________ ???: vin...@gm... [mailto:vin...@gm...] ?? vincent rogier ????: 2009?11?9? ??? 18:05 ???: Xun Chen ??: Re: [Bulk] [Orclib-users] how to pass a varray of varchar2 to oracle database using ocilib Hi Xun, there is a error in your code. It should be : /* .. */ type = OCI_TypeInfoGet(conn, "string_array20", OCI_TIF_TYPE); vchars = OCI_CollCreate(type); elem = OCI_ElemCreate(type); for (i=0; i<n; i++) { OCI_ElemSetString(elem, s[i])); OCI_CollAppend(vchars, elem); } /* .. */ Regards, Vincent 2009/11/9 Xun Chen <ch...@av...> Hi, I want to call a procedure which take a varray of varchar2 as a in parameter. As a test, I write the following code to set the data OCI_Coll * vchars; OCI_Elem * elem; OCI_TypeInfo *type; char s[5][64]; int n; strcpy(s[0], "2009-01-04 11:22:15"); strcpy(s[1], "2009-03-14 01:12:25"); strcpy(s[2], "2009-04-24 11:42:35"); strcpy(s[3], "2009-05-04 21:52:45"); strcpy(s[4], "2009-06-04 13:32:55"); .... n=5; type = OCI_TypeInfoGet(conn, "string_array20", OCI_TIF_TYPE); vchars = OCI_CollCreate(type); for (i=0; i<n; i++) { elem = OCI_ElemCreate(type); OCI_ElemSetColl(elem, vchars); OCI_ElemSetString(elem, s[i])); OCI_CollAppend(vchars, elem); } where string_array20 is defined by following pl/sql statement: create type string_array20 is varray(20) of varchar2(64); Run the code show following message: Elements are not compatible. It seems that I should not use OCI_ElemSetString() here. If so, what should I do to pass such a data type to the database? Best regards, Xun ---------------------------------------------------------------------------- -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Orclib-users mailing list Orc...@li... https://lists.sourceforge.net/lists/listinfo/orclib-users -- Vincent Rogier |
From: Xun C. <ch...@av...> - 2009-11-09 09:33:58
|
Hi, I want to call a procedure which take a varray of varchar2 as a in parameter. As a test, I write the following code to set the data OCI_Coll * vchars; OCI_Elem * elem; OCI_TypeInfo *type; char s[5][64]; int n; strcpy(s[0], "2009-01-04 11:22:15"); strcpy(s[1], "2009-03-14 01:12:25"); strcpy(s[2], "2009-04-24 11:42:35"); strcpy(s[3], "2009-05-04 21:52:45"); strcpy(s[4], "2009-06-04 13:32:55"); .... n=5; type = OCI_TypeInfoGet(conn, "string_array20", OCI_TIF_TYPE); vchars = OCI_CollCreate(type); for (i=0; i<n; i++) { elem = OCI_ElemCreate(type); OCI_ElemSetColl(elem, vchars); OCI_ElemSetString(elem, s[i])); OCI_CollAppend(vchars, elem); } where string_array20 is defined by following pl/sql statement: create type string_array20 is varray(20) of varchar2(64); Run the code show following message: Elements are not compatible. It seems that I should not use OCI_ElemSetString() here. If so, what should I do to pass such a data type to the database? Best regards, Xun |
From: vincent r. <vin...@ya...> - 2008-02-17 08:43:22
|
Hi, I open this topic to incite OCILIB users to report the use of OCILIB in their project, application , ... I 'd like to start a list of projects using OCILIB to put on the OCILIB website. So, just then reply in this topic or send me an email with your project name and/or details Thanks Vincent |
From: vincent r. <vin...@ya...> - 2008-02-17 08:31:10
|
Hi, I open this topic to incite OCILIB users to report successful uses of OCILIB on various platform. => Please, report : * OS Type and version * Oracle client et server versions * Compiler name and version => Actual compatibility list : * Validated Platforms : - Windows - UP/UX - Linux - Solaris - AIX * Validated Compilers : - GCC / MinGW - MS Compilers - XLC - CC * Validated Oracle versions : - Oracle 8i - Oracle 9i - Oracle 10g - Oracle 11g Thanks Vincent |