OCILIB (C and C++ Driver for Oracle)  4.0.0
ocilib_impl.hpp
1 /*
2  +-----------------------------------------------------------------------------------------+
3  | |
4  | |
5  | OCILIB ++ - C++ wrapper around OCILIB |
6  | |
7  | (C Wrapper for Oracle OCI) |
8  | |
9  | Website : http://www.ocilib.net |
10  | |
11  | Copyright (c) 2007-2014 Vincent ROGIER <vince.rogier@ocilib.net> |
12  | |
13  +-----------------------------------------------------------------------------------------+
14  | |
15  | This library is free software; you can redistribute it and/or |
16  | modify it under the terms of the GNU Lesser General Public |
17  | License as published by the Free Software Foundation; either |
18  | version 2 of the License, or (at your option) any later version. |
19  | |
20  | This library is distributed in the hope that it will be useful, |
21  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
22  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
23  | Lesser General Public License for more details. |
24  | |
25  | You should have received a copy of the GNU Lesser General Public |
26  | License along with this library; if not, write to the Free |
27  | Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
28  | |
29  +-----------------------------------------------------------------------------------------+
30 
31  +-----------------------------------------------------------------------------------------+
32  | IMPORTANT NOTICE |
33  +-----------------------------------------------------------------------------------------+
34  | |
35  | This C++ header defines C++ wrapper classes around the OCILIB C API |
36  | It requires a compatible version of OCILIB |
37  +-----------------------------------------------------------------------------------------+
38 
39  */
40 
41 /* --------------------------------------------------------------------------------------------- *
42  * $Id: ocilib_impl.hpp, Vincent Rogier $
43  * --------------------------------------------------------------------------------------------- */
44 
45 namespace ocilib
46 {
47 
48 /* ********************************************************************************************* *
49  * IMPLEMENTATION
50  * ********************************************************************************************* */
51 
52 inline void Check()
53 {
54  OCI_Error *err = OCI_GetLastError();
55 
56  if (err)
57  {
58  throw Exception(err);
59  }
60 }
61 
62 template<class TResultType>
63 inline TResultType Check(TResultType result)
64 {
65  Check();
66 
67  return result;
68 }
69 
70 inline ostring MakeString(const otext *result)
71 {
72  return ostring(result ? result : OTEXT(""));
73 }
74 
75 
76 inline Raw MakeRaw(void *result, unsigned int size)
77 {
78  unsigned char *start = static_cast<unsigned char *>(result);
79 
80  return Raw(start, start + size);
81 }
82 
83 
84 /* --------------------------------------------------------------------------------------------- *
85  * Enum
86  * --------------------------------------------------------------------------------------------- */
87 
88 template<class TEnum>
89 inline Enum<TEnum>::Enum(void) : _value(0)
90 {
91 }
92 
93 template<class TEnum>
94 inline Enum<TEnum>::Enum(TEnum value) : _value(value)
95 {
96 }
97 
98 template<class TEnum>
99 inline TEnum Enum<TEnum>::GetValue()
100 {
101  return _value;
102 }
103 
104 
105 template<class TEnum>
106 inline Enum<TEnum>::operator TEnum ()
107 {
108  return _value;
109 }
110 
111 template<class TEnum>
112 inline Enum<TEnum>::operator unsigned int ()
113 {
114  return static_cast<unsigned int>(_value);
115 }
116 
117 template<class TEnum>
118 inline bool Enum<TEnum>::operator == (const Enum& other) const
119 {
120  return other._value == _value;
121 }
122 
123 template<class TEnum>
124 inline bool Enum<TEnum>::operator != (const Enum& other) const
125 {
126  return !(*this == other);
127 }
128 
129 template<class TEnum>
130 inline bool Enum<TEnum>::operator == (const TEnum& other) const
131 {
132  return other == _value;
133 }
134 
135 template<class TEnum>
136 inline bool Enum<TEnum>::operator != (const TEnum& other) const
137 {
138  return !(*this == other);
139 }
140 
141 /* --------------------------------------------------------------------------------------------- *
142  * Flags
143  * --------------------------------------------------------------------------------------------- */
144 
145 template<class TEnum>
146 inline Flags<TEnum>::Flags(void) : _flags( (TEnum) 0)
147 {
148 }
149 
150 template<class TEnum>
151 inline Flags<TEnum>::Flags(TEnum flag) : _flags( flag)
152 {
153 }
154 
155 template<class TEnum>
156 inline Flags<TEnum>::Flags(const Flags& other) : _flags(other._flags)
157 {
158 }
159 
160 
161 template<class TEnum>
162 inline Flags<TEnum>::Flags(unsigned int flag) : _flags( (TEnum) flag)
163 {
164 }
165 
166 template<class TEnum>
167 inline Flags<TEnum> Flags<TEnum>::operator~ () const
168 {
169  return Flags<TEnum>(~_flags);
170 }
171 
172 template<class TEnum>
173 inline Flags<TEnum> Flags<TEnum>::operator | (const Flags& other) const
174 {
175  return Flags<TEnum>(_flags | other._flags);
176 }
177 
178 template<class TEnum>
179 inline Flags<TEnum> Flags<TEnum>::operator & (const Flags& other) const
180 {
181  return Flags<TEnum>(_flags & other._flags);
182 }
183 
184 template<class TEnum>
185 inline Flags<TEnum> Flags<TEnum>::operator ^ (const Flags& other) const
186 {
187  return Flags<TEnum>(_flags ^ other._flags);
188 }
189 
190 template<class TEnum>
191 inline Flags<TEnum> Flags<TEnum>::operator | (TEnum other) const
192 {
193  return Flags<TEnum>(_flags | other);
194 }
195 
196 template<class TEnum>
197 inline Flags<TEnum> Flags<TEnum>::operator & (TEnum other) const
198 {
199  return Flags<TEnum>(_flags & other);
200 }
201 
202 template<class TEnum>
203 inline Flags<TEnum> Flags<TEnum>::operator ^ (TEnum other) const
204 {
205  return Flags<TEnum>(_flags ^ other);
206 }
207 
208 template<class TEnum>
209 inline Flags<TEnum>& Flags<TEnum>::operator |= (const Flags<TEnum>& other)
210 {
211  _flags |= other._flags;
212  return *this;
213 }
214 
215 template<class TEnum>
216 inline Flags<TEnum>& Flags<TEnum>::operator &= (const Flags<TEnum>& other)
217 {
218  _flags &= other._flags;
219  return *this;
220 }
221 
222 template<class TEnum>
223 inline Flags<TEnum>& Flags<TEnum>::operator ^= (const Flags<TEnum>& other)
224 {
225  _flags ^= other._flags;
226  return *this;
227 }
228 
229 
230 template<class TEnum>
231 inline Flags<TEnum>& Flags<TEnum>::operator |= (TEnum other)
232 {
233  _flags |= other;
234  return *this;
235 }
236 
237 template<class TEnum>
238 inline Flags<TEnum>& Flags<TEnum>::operator &= (TEnum other)
239 {
240  _flags &= other;
241  return *this;
242 }
243 
244 template<class TEnum>
245 inline Flags<TEnum>& Flags<TEnum>::operator ^= (TEnum other)
246 {
247  _flags ^= other;
248  return *this;
249 }
250 
251 template<class TEnum>
252 inline bool Flags<TEnum>::operator == (TEnum other) const
253 {
254  return _flags == other;
255 }
256 
257 template<class TEnum>
258 inline bool Flags<TEnum>::operator == (const Flags& other) const
259 {
260  return _flags == other._flags;
261 }
262 
263 template<class TEnum>
264 inline bool Flags<TEnum>::IsSet(TEnum other) const
265 {
266  return ((_flags & other) == _flags);
267 }
268 
269 template<class TEnum>
270 inline unsigned int Flags<TEnum>::GetValues() const
271 {
272  return _flags;
273 }
274 
275 #define OCI_DEFINE_FLAG_OPERATORS(TEnum) \
276 inline Flags<TEnum> operator | (TEnum a, TEnum b) { return Flags<TEnum>(a) | Flags<TEnum>(b); } \
277 
278 OCI_DEFINE_FLAG_OPERATORS(Environment::EnvironmentFlagsValues)
279 OCI_DEFINE_FLAG_OPERATORS(Environment::SessionFlagsValues)
280 OCI_DEFINE_FLAG_OPERATORS(Environment::StartFlagsValues)
281 OCI_DEFINE_FLAG_OPERATORS(Environment::ShutdownFlagsValues)
282 OCI_DEFINE_FLAG_OPERATORS(Transaction::TransactionFlagsValues)
283 OCI_DEFINE_FLAG_OPERATORS(Column::PropertyFlagsValues)
284 OCI_DEFINE_FLAG_OPERATORS(Subscription::ChangeTypesValues)
285 
286 /* --------------------------------------------------------------------------------------------- *
287  * ManagedBuffer
288  * --------------------------------------------------------------------------------------------- */
289 
290 template< typename TBufferType>
291 inline ManagedBuffer<TBufferType>::ManagedBuffer() : _buffer(NULL), _size(0)
292 {
293 }
294 
295 template< typename TBufferType>
296 inline ManagedBuffer<TBufferType>::ManagedBuffer(TBufferType *buffer, size_t size) : _buffer(buffer), _size(size)
297 {
298 }
299 
300 template< typename TBufferType>
301 inline ManagedBuffer<TBufferType>::ManagedBuffer(size_t size) : _buffer(new TBufferType[size]), _size(size)
302 {
303  memset(_buffer, 0, sizeof(TBufferType) * size);
304 }
305 template< typename TBufferType>
306 inline ManagedBuffer<TBufferType>::~ManagedBuffer()
307 {
308  delete [] _buffer;
309 }
310 
311 template< typename TBufferType>
312 inline ManagedBuffer<TBufferType>::operator TBufferType* () const
313 {
314  return _buffer;
315 }
316 
317 template< typename TBufferType>
318 inline ManagedBuffer<TBufferType>::operator const TBufferType* () const
319 {
320  return _buffer;
321 }
322 
323 /* --------------------------------------------------------------------------------------------- *
324  * Handle
325  * --------------------------------------------------------------------------------------------- */
326 
327 template<class THandleType>
328 inline HandleHolder<THandleType>::HandleHolder() : _smartHandle(0)
329 {
330 }
331 
332 template<class THandleType>
333 inline HandleHolder<THandleType>::HandleHolder(const HandleHolder &other) : _smartHandle(0)
334 {
335  Acquire(other, 0, other._smartHandle ? other._smartHandle->GetParent() : 0);
336 }
337 
338 template<class THandleType>
339 inline HandleHolder<THandleType>::~HandleHolder()
340 {
341  Release();
342 }
343 
344 template<class THandleType>
345 inline HandleHolder<THandleType>& HandleHolder<THandleType>::operator = (const HandleHolder<THandleType> &other)
346 {
347  Acquire(other, 0, other._smartHandle ? other._smartHandle->GetParent() : 0);
348  return *this;
349 }
350 
351 template<class THandleType>
352 inline bool HandleHolder<THandleType>::IsNull() const
353 {
354  return (((THandleType) *this) == 0);
355 }
356 
357 template<class THandleType>
358 inline HandleHolder<THandleType>::operator THandleType()
359 {
360  return _smartHandle ? _smartHandle->GetHandle() : 0;
361 }
362 
363 template<class THandleType>
364 inline HandleHolder<THandleType>::operator THandleType() const
365 {
366  return _smartHandle ? _smartHandle->GetHandle() : 0;
367 }
368 
369 template<class THandleType>
370 inline HandleHolder<THandleType>::operator bool() const
371 {
372  return IsNull();
373 }
374 
375 template<class THandleType>
376 inline Handle * HandleHolder<THandleType>::GetHandle() const
377 {
378  return static_cast<Handle *>(_smartHandle);
379 }
380 
381 template<class THandleType>
382 inline void HandleHolder<THandleType>::Acquire(THandleType handle, HandleFreeFunc func, Handle *parent)
383 {
384  Release();
385 
386  if (func)
387  {
388  _smartHandle = new HandleHolder<THandleType>::SmartHandle(this, handle, func, parent);
389 
390  Environment::GetEnvironmentHandle().Handles.Set(handle, _smartHandle);
391  }
392  else
393  {
394  _smartHandle = dynamic_cast<HandleHolder<THandleType>::SmartHandle *>(Environment::GetEnvironmentHandle().Handles.Get(handle));
395 
396  if (!_smartHandle)
397  {
398  _smartHandle = new HandleHolder<THandleType>::SmartHandle(this, handle, 0, parent);
399  }
400  else
401  {
402  _smartHandle->Acquire(this);
403  }
404  }
405 }
406 
407 template<class THandleType>
408 inline void HandleHolder<THandleType>::Acquire(HandleHolder<THandleType> &other)
409 {
410  if (&other != this && _smartHandle != other._smartHandle)
411  {
412  Release();
413 
414  if (other._smartHandle)
415  {
416  other._smartHandle->Acquire(this);
417  _smartHandle = other._smartHandle;
418  }
419  }
420 }
421 
422 template<class THandleType>
423 inline void HandleHolder<THandleType>::Release()
424 {
425  if (_smartHandle)
426  {
427  _smartHandle->Release(this);
428  }
429 
430  _smartHandle = 0;
431 }
432 
433 
434 template <class TKey, class TValue>
435 inline ConcurrentPool<TKey, TValue>::ConcurrentPool() : _map(), _mutex(0)
436 {
437 
438 }
439 
440 template <class TKey, class TValue>
441 inline void ConcurrentPool<TKey, TValue>::Initialize(unsigned int envMode)
442 {
443  if (envMode & OCI_ENV_THREADED)
444  {
445  _mutex = Mutex::Create();
446  }
447 }
448 
449 template <class TKey, class TValue>
450 inline void ConcurrentPool<TKey, TValue>::Release()
451 {
452  if (_mutex)
453  {
454  Mutex::Destroy(_mutex);
455  }
456 
457  _mutex = 0;
458 
459  _map.clear();
460 }
461 
462 template <class TKey, class TValue>
463 inline void ConcurrentPool<TKey, TValue>::Remove(TKey key)
464 {
465  Lock();
466  _map.erase(key);
467  Unlock();
468 }
469 
470 template <class TKey, class TValue>
471 inline TValue ConcurrentPool<TKey, TValue>::Get(TKey key) const
472 {
473  TValue value = 0;
474 
475  Lock();
476  typename ConcurrentPoolMap::const_iterator it = _map.find(key);
477  if (it != _map.end() )
478  {
479  value = it->second;
480  }
481  Unlock();
482 
483  return value;
484 }
485 
486 template <class TKey, class TValue>
487 inline void ConcurrentPool<TKey, TValue>::Set(TKey key, TValue value)
488 {
489  Lock();
490  _map[key] = value;
491  Unlock();
492 }
493 
494 template <class TKey, class TValue>
495 inline void ConcurrentPool<TKey, TValue>::Lock() const
496 {
497  if (_mutex)
498  {
499  Mutex::Acquire(_mutex);
500  }
501 }
502 
503 template <class TKey, class TValue>
504 inline void ConcurrentPool<TKey, TValue>::Unlock() const
505 {
506  if (_mutex)
507  {
508  Mutex::Release(_mutex);
509  }
510 }
511 
512 template <class THandleType>
513 inline HandleHolder<THandleType>::SmartHandle::SmartHandle(HandleHolder *holder, THandleType handle, HandleFreeFunc func, Handle *parent)
514  : _holders(), _children(), _handle(handle), _func(func), _parent(parent), _extraInfo(0)
515 {
516  Acquire(holder);
517 
518  if (_parent && _handle)
519  {
520  _parent->GetChildren().push_back(this);
521  }
522 }
523 
524 template <class THandleType>
525 inline HandleHolder<THandleType>::SmartHandle::~SmartHandle()
526 {
527  boolean ret = TRUE;
528  boolean chk = FALSE;
529 
530  if (_parent && _handle)
531  {
532  _parent->GetChildren().remove(this);
533  }
534 
535  for(std::list<Handle *>::iterator it = _children.begin(); it != _children.end(); it++)
536  {
537  Handle *handle = *it;
538 
539  handle->DetachFromParent();
540  handle->DetachFromHolders();
541 
542  delete handle;
543  }
544 
545  Environment::GetEnvironmentHandle().Handles.Remove(_handle);
546 
547  if (_func)
548  {
549 
550  ret = _func(_handle);
551  chk = TRUE;
552  }
553 
554  if (chk)
555  {
556  Check(ret);
557  }
558 }
559 
560 template <class THandleType>
561 inline void HandleHolder<THandleType>::SmartHandle::Acquire(HandleHolder *holder)
562 {
563  _holders.push_back(holder);
564 }
565 
566 template <class THandleType>
567 inline void HandleHolder<THandleType>::SmartHandle::Release(HandleHolder *holder)
568 {
569  _holders.remove(holder);
570 
571  if (_holders.size() == 0)
572  {
573  delete this;
574  }
575 
576  holder->_smartHandle = 0;
577 }
578 
579 template <class THandleType>
580 inline bool HandleHolder<THandleType>::SmartHandle::IsLastHolder(HandleHolder *holder) const
581 {
582  return ((_holders.size() == 1) && (*(_holders.begin()) == holder));
583 }
584 
585 template <class THandleType>
586 inline THandleType HandleHolder<THandleType>::SmartHandle::GetHandle() const
587 {
588  return _handle;
589 }
590 
591 template <class THandleType>
592 inline Handle * HandleHolder<THandleType>::SmartHandle::GetParent() const
593 {
594  return _parent;
595 }
596 
597 template <class THandleType>
598 inline AnyPointer HandleHolder<THandleType>::SmartHandle::GetExtraInfos() const
599 {
600  return _extraInfo;
601 }
602 
603 template <class THandleType>
604 inline void HandleHolder<THandleType>::SmartHandle::SetExtraInfos(AnyPointer extraInfo)
605 {
606  _extraInfo = extraInfo;
607 }
608 
609 template <class THandleType>
610 inline std::list<Handle *> & HandleHolder<THandleType>::SmartHandle::GetChildren()
611 {
612  return _children;
613 }
614 
615 template <class THandleType>
616 inline void HandleHolder<THandleType>::SmartHandle::DetachFromHolders()
617 {
618  for(typename std::list<HandleHolder<THandleType> *>::iterator it = _holders.begin(); it != _holders.end(); it++)
619  {
620  (*it)->_smartHandle = 0;
621  }
622 
623  _holders.clear();
624 }
625 
626 template <class THandleType>
627 inline void HandleHolder<THandleType>::SmartHandle::DetachFromParent()
628 {
629  _parent = 0;
630 }
631 
632 /* --------------------------------------------------------------------------------------------- *
633  * Exception
634  * --------------------------------------------------------------------------------------------- */
635 
636 inline Exception::Exception() : _what()
637 {
638 
639 }
640 
641 inline Exception::~Exception() throw ()
642 {
643 
644 }
645 
646 inline Exception::Exception(OCI_Error *err) : _what()
647 {
648  Acquire(err, 0, 0);
649 
650  const otext *str = OCI_ErrorGetString(*this);
651 
652  if (str)
653  {
654  size_t i = 0, size = ostrlen(str);
655 
656  _what.resize(size);
657 
658  while (i < size) { _what[i] = static_cast<char>(str[i]); i++; }
659  }
660 }
661 
662 inline const char * Exception::what() const throw()
663 {
664  return _what.c_str();
665 }
666 
668 {
669  return MakeString(OCI_ErrorGetString(*this));
670 }
671 
673 {
674  return Exception::ExceptionType(static_cast<ExceptionType::type>(OCI_ErrorGetType(*this)));
675 }
676 
678 {
679  return OCI_ErrorGetOCICode(*this);
680 }
681 
683 {
684  return OCI_ErrorGetInternalCode(*this);
685 }
686 
688 {
689  return Statement(OCI_ErrorGetStatement(*this), 0);
690 }
691 
693 {
694  return Connection(OCI_ErrorGetConnection(*this), 0);
695 }
696 
697 inline unsigned int Exception::GetRow() const
698 {
699  return OCI_ErrorGetRow(*this);
700 }
701 
702 /* --------------------------------------------------------------------------------------------- *
703  * Environment
704  * --------------------------------------------------------------------------------------------- */
705 
706 inline void Environment::Initialize(EnvironmentFlags mode, const ostring& libpath)
707 {
708  unsigned int ociMode = mode.GetValues();
709 
710  OCI_Initialize(0, libpath.c_str(), ociMode | OCI_ENV_CONTEXT);
711 
712  Check();
713 
714  GetEnvironmentHandle().Initialize(const_cast<AnyPointer>(OCI_HandleGetEnvironment()), ociMode);
715 }
716 
717 inline void Environment::Cleanup()
718 {
719  GetEnvironmentHandle().Finalize();
720 
721  OCI_Cleanup();
722 
723  Check();
724 }
725 
727 {
728  return EnvironmentFlags(static_cast<EnvironmentFlags::type>(GetEnvironmentHandle().Mode));
729 }
730 
732 {
733  return ImportMode(static_cast<ImportMode::type>(Check(OCI_GetImportMode())));
734 }
735 
737 {
738  return CharsetMode(static_cast<CharsetMode::type>(Check(OCI_GetCharset())));
739 }
740 
741 inline unsigned int Environment::GetCompileVersion()
742 {
744 }
745 
746 inline unsigned int Environment::GetRuntimeVersion()
747 {
749 }
750 
751 inline void Environment::EnableWarnings(bool value)
752 {
753  OCI_EnableWarnings((boolean) value);
754 
755  Check();
756 }
757 
758 inline void Environment::StartDatabase(const ostring& db, const ostring& user, const ostring &pwd, Environment::StartFlags startFlags,
759  Environment::StartMode startMode, Environment::SessionFlags sessionFlags, const ostring& spfile)
760 {
761  Check(OCI_DatabaseStartup(db.c_str(), user.c_str(), pwd.c_str(), sessionFlags.GetValues(),
762  startMode, startFlags.GetValues(), spfile.c_str() ));
763 }
764 
765 inline void Environment::ShutdownDatabase(const ostring& db, const ostring& user, const ostring &pwd, Environment::ShutdownFlags shutdownFlags,
766  Environment::ShutdownMode shutdownMode, Environment::SessionFlags sessionFlags)
767 {
768  Check(OCI_DatabaseShutdown(db.c_str(), user.c_str(), pwd.c_str(), sessionFlags.GetValues(),
769  shutdownMode, shutdownFlags.GetValues() ));
770 }
771 
772 inline void Environment::ChangeUserPassword(const ostring& db, const ostring& user, const ostring& pwd, const ostring& newPwd)
773 {
774  Check(OCI_SetUserPassword(db.c_str(), user.c_str(), pwd.c_str(), newPwd.c_str()));
775 }
776 
777 inline void Environment::SetHAHandler(HAHandlerProc handler)
778 {
779  Environment::CallbackPool & pool = GetEnvironmentHandle().Callbacks;
780 
781  Check(OCI_SetHAHandler(static_cast<POCI_HA_HANDLER>(handler != 0 ? Environment::HAHandler : 0)));
782 
783  pool.Set(GetEnvironmentHandle(), reinterpret_cast<CallbackPointer>(handler));
784 }
785 
786 inline void Environment::HAHandler(OCI_Connection *pConnection, unsigned int source, unsigned int event, OCI_Timestamp *pTimestamp)
787 {
788  HAHandlerProc handler = reinterpret_cast<HAHandlerProc>(GetEnvironmentHandle().Callbacks.Get(GetEnvironmentHandle()));
789 
790  if (handler)
791  {
792  Connection connection(pConnection, 0);
793  Timestamp timestamp(pTimestamp, connection.GetHandle());
794 
795  handler(connection,
796  HAEventSource(static_cast<HAEventSource::type>(source)),
797  HAEventType (static_cast<HAEventType::type> (event)),
798  timestamp);
799  }
800 }
801 
802 inline unsigned int Environment::TAFHandler(OCI_Connection *pConnection, unsigned int type, unsigned int event)
803 {
804  unsigned int res = OCI_FOC_OK;
805 
806  Connection::TAFHandlerProc handler = reinterpret_cast<Connection::TAFHandlerProc>(GetEnvironmentHandle().Callbacks.Get(pConnection));
807 
808  if (handler)
809  {
810  Connection connection(pConnection, 0);
811 
812  res = handler(connection,
813  Connection::FailoverRequest( static_cast<Connection::FailoverRequest::type> (type)),
814  Connection::FailoverEvent ( static_cast<Connection::FailoverEvent::type> (event)));
815  }
816 
817  return res;
818 }
819 
820 inline void Environment::NotifyHandler(OCI_Event *pEvent)
821 {
822  Subscription::NotifyHandlerProc handler = reinterpret_cast<Subscription::NotifyHandlerProc>(GetEnvironmentHandle().Callbacks.Get(Check(OCI_EventGetSubscription(pEvent))));
823 
824  if (handler)
825  {
826  Event evt(pEvent);
827  handler(evt);
828  }
829 }
830 
831 inline void Environment::NotifyHandlerAQ(OCI_Dequeue *pDequeue)
832 {
833  Dequeue::NotifyAQHandlerProc handler = reinterpret_cast<Dequeue::NotifyAQHandlerProc>(GetEnvironmentHandle().Callbacks.Get(Check(pDequeue)));
834 
835  if (handler)
836  {
837  Dequeue dequeue(pDequeue);
838  handler(dequeue);
839  }
840 }
841 
842 inline Environment::EnvironmentHandle & Environment::GetEnvironmentHandle()
843 {
844  static EnvironmentHandle envHandle;
845 
846  return envHandle;
847 }
848 
849 inline Environment::EnvironmentHandle::EnvironmentHandle() : Handles(), Callbacks(), Mode(0)
850 {
851 
852 }
853 
854 inline void Environment::EnvironmentHandle::Initialize(AnyPointer handle, unsigned int envMode)
855 {
856  Mode = envMode;
857  Callbacks.Initialize(envMode);
858  Handles.Initialize(envMode);
859 
860  Acquire(handle, 0, 0);
861 }
862 
863 inline void Environment::EnvironmentHandle::Finalize()
864 {
865  Callbacks.Release();
866  Handles.Release();
867 
868  Release();
869 }
870 
871 /* --------------------------------------------------------------------------------------------- *
872  * Mutex
873  * --------------------------------------------------------------------------------------------- */
874 
876 {
877  return Check(OCI_MutexCreate());
878 }
879 
880 inline void Mutex::Destroy(MutexHandle mutex)
881 {
882  Check(OCI_MutexFree(mutex));
883 }
884 
885 inline void Mutex::Acquire(MutexHandle mutex)
886 {
887  Check(OCI_MutexAcquire(mutex));
888 }
889 
890 inline void Mutex::Release(MutexHandle mutex)
891 {
892  Check(OCI_MutexRelease(mutex));
893 }
894 
895 /* --------------------------------------------------------------------------------------------- *
896  * Thread
897  * --------------------------------------------------------------------------------------------- */
898 
900 {
901  return Check(OCI_ThreadCreate());
902 }
903 
904 inline void Thread::Destroy(ThreadHandle handle)
905 {
906  Check(OCI_ThreadFree(handle));
907 }
908 
909 inline void Thread::Run(ThreadHandle handle, ThreadProc func, AnyPointer args)
910 {
911  Check(OCI_ThreadRun(handle, func, args));
912 }
913 
914 inline void Thread::Join(ThreadHandle handle)
915 {
916  Check(OCI_ThreadJoin(handle));
917 }
918 
920 {
921  return Check(OCI_HandleGetThreadID(handle));
922 }
923 
924 /* --------------------------------------------------------------------------------------------- *
925  * ThreadKey
926  * --------------------------------------------------------------------------------------------- */
927 
928 inline void ThreadKey::Create(const ostring& name, ThreadKeyFreeProc freeProc)
929 {
930  Check(OCI_ThreadKeyCreate(name.c_str(), freeProc));
931 }
932 
933 inline void ThreadKey::SetValue(const ostring& name, AnyPointer value)
934 {
935  Check(OCI_ThreadKeySetValue(name.c_str(), value));
936 }
937 
939 {
940  return Check(OCI_ThreadKeyGetValue(name.c_str()));
941 }
942 
943 /* --------------------------------------------------------------------------------------------- *
944  * Pool
945  * --------------------------------------------------------------------------------------------- */
946 
947 inline Pool::Pool()
948 {
949 
950 }
951 
952 inline Pool::Pool(const ostring& db, const ostring& user, const ostring& pwd, Pool::PoolType poolType,
953  unsigned int minSize, unsigned int maxSize, unsigned int increment, Environment::SessionFlags sessionFlags)
954 {
955  Open(db, user, pwd, poolType, minSize, maxSize, increment, sessionFlags);
956 }
957 
958 inline void Pool::Open(const ostring& db, const ostring& user, const ostring& pwd, Pool::PoolType poolType,
959  unsigned int minSize, unsigned int maxSize, unsigned int increment, Environment::SessionFlags sessionFlags)
960 {
961  Release();
962 
963  Acquire(Check(OCI_PoolCreate(db.c_str(), user.c_str(), pwd.c_str(), poolType, sessionFlags.GetValues(),
964  minSize, maxSize, increment)), reinterpret_cast<HandleFreeFunc>(OCI_PoolFree), 0);
965 }
966 
967 inline void Pool::Close()
968 {
969  Release();
970 }
971 
972 inline Connection Pool::GetConnection(const ostring& sessionTag)
973 {
974  return Connection(Check( OCI_PoolGetConnection(*this, sessionTag.c_str())), GetHandle());
975 }
976 
977 inline unsigned int Pool::GetTimeout() const
978 {
979  return Check( OCI_PoolGetTimeout(*this));
980 }
981 
982 inline void Pool::SetTimeout(unsigned int value)
983 {
984  Check( OCI_PoolSetTimeout(*this, value));
985 }
986 
987 inline bool Pool::GetNoWait() const
988 {
989  return (Check( OCI_PoolGetNoWait(*this)) == TRUE);
990 }
991 
992 inline void Pool::SetNoWait(bool value)
993 {
994  Check( OCI_PoolSetNoWait(*this, value));
995 }
996 
997 inline unsigned int Pool::GetBusyConnectionsCount() const
998 {
999  return Check( OCI_PoolGetBusyCount(*this));
1000 }
1001 
1002 inline unsigned int Pool::GetOpenedConnectionsCount() const
1003 {
1004  return Check( OCI_PoolGetOpenedCount(*this));
1005 }
1006 
1007 inline unsigned int Pool::GetMinSize() const
1008 {
1009  return Check( OCI_PoolGetMin(*this));
1010 }
1011 
1012 inline unsigned int Pool::GetMaxSize() const
1013 {
1014  return Check( OCI_PoolGetMax(*this));
1015 }
1016 
1017 inline unsigned int Pool::GetIncrement() const
1018 {
1019  return Check( OCI_PoolGetIncrement(*this));
1020 }
1021 
1022 inline unsigned int Pool::GetStatementCacheSize() const
1023 {
1024  return Check( OCI_PoolGetStatementCacheSize(*this));
1025 }
1026 
1027 inline void Pool::SetStatementCacheSize(unsigned int value)
1028 {
1029  Check( OCI_PoolSetStatementCacheSize(*this, value));
1030 }
1031 
1032 /* --------------------------------------------------------------------------------------------- *
1033  * Connection
1034  * --------------------------------------------------------------------------------------------- */
1035 
1037 {
1038 
1039 }
1040 
1041 inline Connection::Connection(const ostring& db, const ostring& user, const ostring& pwd, Environment::SessionFlags sessionFlags)
1042 {
1043  Open(db, user, pwd, sessionFlags);
1044 }
1045 
1046 inline Connection::Connection(OCI_Connection *con, Handle *parent)
1047 {
1048  Acquire(con, reinterpret_cast<HandleFreeFunc>(parent ? OCI_ConnectionFree : 0), parent);
1049 }
1050 
1051 inline void Connection::Open(const ostring& db, const ostring& user, const ostring& pwd, Environment::SessionFlags sessionFlags)
1052 {
1053  Acquire(Check(OCI_ConnectionCreate(db.c_str(), user.c_str(), pwd.c_str(), sessionFlags.GetValues())),
1054  reinterpret_cast<HandleFreeFunc>(OCI_ConnectionFree), Environment::GetEnvironmentHandle().GetHandle());
1055 }
1056 
1057 inline void Connection::Close()
1058 {
1059  Release();
1060 }
1061 
1062 inline void Connection::Commit()
1063 {
1064  Check(OCI_Commit(*this));
1065 }
1066 
1068 {
1069  Check(OCI_Rollback(*this));
1070 }
1071 
1072 inline void Connection::Break()
1073 {
1074  Check(OCI_Break(*this));
1075 }
1076 
1077 inline void Connection::SetAutoCommit(bool enabled)
1078 {
1079  Check(OCI_SetAutoCommit(*this, enabled));
1080 }
1081 
1082 inline bool Connection::GetAutoCommit() const
1083 {
1084  return (Check(OCI_GetAutoCommit(*this)) == TRUE);
1085 }
1086 
1087 inline bool Connection::IsServerAlive() const
1088 {
1089  return (Check(OCI_IsConnected(*this)) == TRUE);
1090 }
1091 
1092 inline bool Connection::PingServer() const
1093 {
1094  return( Check(OCI_Ping(*this)) == TRUE);
1095 }
1096 
1098 {
1099  return MakeString(Check(OCI_GetDatabase(*this)));
1100 }
1101 
1103 {
1104  return MakeString(Check(OCI_GetUserName(*this)));
1105 }
1106 
1108 {
1109  return MakeString(Check(OCI_GetPassword(*this)));
1110 }
1111 
1112 inline unsigned int Connection::GetVersion() const
1113 {
1114  return Check(OCI_GetVersionConnection(*this));
1115 }
1116 
1118 {
1119  return MakeString(Check( OCI_GetVersionServer(*this)));
1120 }
1121 
1122 inline unsigned int Connection::GetServerMajorVersion() const
1123 {
1124  return Check(OCI_GetServerMajorVersion(*this));
1125 }
1126 
1127 inline unsigned int Connection::GetServerMinorVersion() const
1128 {
1129  return Check(OCI_GetServerMinorVersion(*this));
1130 }
1131 
1132 inline unsigned int Connection::GetServerRevisionVersion() const
1133 {
1134  return Check(OCI_GetServerRevisionVersion(*this));
1135 }
1136 
1137 inline void Connection::ChangePassword(const ostring& newPwd)
1138 {
1139  Check(OCI_SetPassword(*this, newPwd.c_str()));
1140 }
1141 
1143 {
1144  return MakeString(Check(OCI_GetSessionTag(*this)));
1145 }
1146 
1147 inline void Connection::SetSessionTag(const ostring& tag)
1148 {
1149  Check(OCI_SetSessionTag(*this, tag.c_str()));
1150 }
1151 
1153 {
1154  return Transaction(Check(OCI_GetTransaction(*this)));
1155 }
1156 
1157 inline void Connection::SetTransaction(const Transaction &transaction)
1158 {
1159  Check(OCI_SetTransaction(*this, transaction));
1160 }
1161 
1162 inline void Connection::SetDefaultDateFormat(const ostring& format)
1163 {
1164  Check(OCI_SetDefaultFormatDate(*this, format.c_str()));
1165 }
1166 
1168 {
1169  Check(OCI_SetDefaultFormatNumeric(*this, format.c_str()));
1170 }
1171 
1173 {
1174  return MakeString(Check(OCI_GetDefaultFormatDate(*this)));
1175 }
1176 
1178 {
1180 }
1181 
1182 inline void Connection::EnableServerOutput(unsigned int bufsize, unsigned int arrsize, unsigned int lnsize)
1183 {
1184  Check(OCI_ServerEnableOutput(*this, bufsize, arrsize, lnsize));
1185 }
1186 
1188 {
1190 }
1191 
1192 inline bool Connection::GetServerOutput(ostring &line) const
1193 {
1194  const otext * str = Check(OCI_ServerGetOutput(*this));
1195 
1196  line = MakeString(str);
1197 
1198  return (str != 0);
1199 }
1200 
1201 inline void Connection::GetServerOutput(std::vector<ostring> &lines) const
1202 {
1203  const otext * str = Check(OCI_ServerGetOutput(*this));
1204 
1205  while (str)
1206  {
1207  lines.push_back(str);
1208  str = Check(OCI_ServerGetOutput(*this));
1209  }
1210 }
1211 
1212 inline void Connection::SetTrace(SessionTrace trace, const ostring& value)
1213 {
1214  Check(OCI_SetTrace(*this, trace, value.c_str()));
1215 }
1216 
1218 {
1219  return MakeString(Check(OCI_GetTrace(*this, trace)));
1220 }
1221 
1223 {
1224  return MakeString(Check(OCI_GetDBName(*this)));
1225 }
1226 
1228 {
1229  return Check(OCI_GetInstanceName(*this));
1230 }
1231 
1233 {
1234  return MakeString(Check(OCI_GetServiceName(*this)));
1235 }
1236 
1238 {
1239  return Check(OCI_GetServerName(*this));
1240 }
1241 
1243 {
1244  return MakeString(Check(OCI_GetDomainName(*this)));
1245 }
1246 
1248 {
1249  return Timestamp(Check(OCI_GetInstanceStartTime(*this)), GetHandle());
1250 }
1251 
1252 inline unsigned int Connection::GetStatementCacheSize() const
1253 {
1254  return Check(OCI_GetStatementCacheSize(*this));
1255 }
1256 
1257 inline void Connection::SetStatementCacheSize(unsigned int value)
1258 {
1259  Check(OCI_SetStatementCacheSize(*this, value));
1260 }
1261 
1262 inline unsigned int Connection::GetDefaultLobPrefetchSize() const
1263 {
1264  return Check(OCI_GetDefaultLobPrefetchSize(*this));
1265 }
1266 
1267 inline void Connection::SetDefaultLobPrefetchSize(unsigned int value)
1268 {
1269  Check(OCI_SetDefaultLobPrefetchSize(*this, value));
1270 }
1271 
1272 inline bool Connection::IsTAFCapable() const
1273 {
1274  return (Check(OCI_IsTAFCapable(*this)) == TRUE);
1275 }
1276 
1277 inline void Connection::SetTAFHandler(TAFHandlerProc handler)
1278 {
1279  Environment::CallbackPool & pool = Environment::GetEnvironmentHandle().Callbacks;
1280 
1281  Check(OCI_SetTAFHandler(*this, static_cast<POCI_TAF_HANDLER>(handler != 0 ? Environment::TAFHandler : 0 )));
1282 
1283  pool.Set((OCI_Connection*)*this, reinterpret_cast<CallbackPointer>(handler));
1284 }
1285 
1287 {
1288  return Check(OCI_GetUserData(*this));
1289 }
1290 
1292 {
1293  Check(OCI_SetUserData(*this, value));
1294 }
1295 
1296 /* --------------------------------------------------------------------------------------------- *
1297  * Transaction
1298  * --------------------------------------------------------------------------------------------- */
1299 
1300 inline Transaction::Transaction(const Connection &connection, unsigned int timeout, TransactionFlags flags, OCI_XID *pxid)
1301 {
1302  Acquire(Check(OCI_TransactionCreate(connection, timeout, flags.GetValues(), pxid)), reinterpret_cast<HandleFreeFunc>(OCI_TransactionFree), 0);
1303 }
1304 
1306 {
1307  Acquire(trans, 0, 0);
1308 }
1309 
1311 {
1312  Check(OCI_TransactionPrepare(*this));
1313 }
1314 
1315 inline void Transaction::Start()
1316 {
1317  Check(OCI_TransactionStart(*this));
1318 }
1319 
1320 inline void Transaction::Stop()
1321 {
1322  Check(OCI_TransactionStop(*this));
1323 }
1324 
1325 inline void Transaction::Resume()
1326 {
1327  Check(OCI_TransactionResume(*this));
1328 }
1329 
1330 inline void Transaction::Forget()
1331 {
1332  Check(OCI_TransactionForget(*this));
1333 }
1334 
1336 {
1337  return TransactionFlags(static_cast<TransactionFlags::type>(Check(OCI_TransactionGetMode(*this))));
1338 }
1339 
1340 inline unsigned int Transaction::GetTimeout() const
1341 {
1342  return Check(OCI_TransactionGetTimeout(*this));
1343 }
1344 
1345 /* --------------------------------------------------------------------------------------------- *
1346  * Date
1347  * --------------------------------------------------------------------------------------------- */
1348 
1349 inline Date::Date()
1350 {
1351  Acquire(Check(OCI_DateCreate(NULL)), reinterpret_cast<HandleFreeFunc>(OCI_DateFree), 0);
1352 }
1353 
1354 inline Date::Date(OCI_Date *pDate, Handle *parent)
1355 {
1356  Acquire(pDate, 0, parent);
1357 }
1358 
1359 inline Date Date::Clone() const
1360 {
1361  Date result;
1362 
1363  Check(OCI_DateAssign(result, *this));
1364 
1365  return result;
1366 }
1367 
1368 inline int Date::Compare(const Date& other) const
1369 {
1370  return Check(OCI_DateCompare(*this, other));
1371 }
1372 
1373 inline bool Date::IsValid() const
1374 {
1375  return (Check(OCI_DateCheck(*this)) == 0);
1376 }
1377 
1378 inline int Date::GetYear() const
1379 {
1380  int year, month, day;
1381 
1382  GetDate(year, month, day);
1383 
1384  return year;
1385 }
1386 
1387 inline void Date::SetYear(int value)
1388 {
1389  int year, month, day;
1390 
1391  GetDate(year, month, day);
1392  SetDate(value, month, day);
1393 }
1394 
1395 inline int Date::GetMonth() const
1396 {
1397  int year, month, day;
1398 
1399  GetDate(year, month, day);
1400 
1401  return month;
1402 }
1403 
1404 inline void Date::SetMonth(int value)
1405 {
1406  int year, month, day;
1407 
1408  GetDate(year, month, day);
1409  SetDate(year, value, day);
1410 }
1411 
1412 inline int Date::GetDay() const
1413 {
1414  int year, month, day;
1415 
1416  GetDate(year, month, day);
1417 
1418  return day;
1419 }
1420 
1421 inline void Date::SetDay(int value)
1422 {
1423  int year, month, day;
1424 
1425  GetDate(year, month, day);
1426  SetDate(year, month, value);
1427 }
1428 
1429 inline int Date::GetHours() const
1430 {
1431  int hour, minutes, seconds;
1432 
1433  GetTime(hour, minutes, seconds);
1434 
1435  return hour;
1436 }
1437 
1438 inline void Date::SetHours(int value)
1439 {
1440  int hour, minutes, seconds;
1441 
1442  GetTime(hour, minutes, seconds);
1443  SetTime(value, minutes, seconds);
1444 }
1445 
1446 inline int Date::GetMinutes() const
1447 {
1448  int hour, minutes, seconds;
1449 
1450  GetTime(hour, minutes, seconds);
1451 
1452  return minutes;
1453 }
1454 
1455 inline void Date::SetMinutes(int value)
1456 {
1457  int hour, minutes, seconds;
1458 
1459  GetTime(hour, minutes, seconds);
1460  SetTime(hour, value, seconds);
1461 }
1462 
1463 inline int Date::GetSeconds() const
1464 {
1465  int hour, minutes, seconds;
1466 
1467  GetTime(hour, minutes, seconds);
1468 
1469  return seconds;
1470 }
1471 
1472 inline void Date::SetSeconds(int value)
1473 {
1474  int hour, minutes, seconds;
1475 
1476  GetTime(hour, minutes, seconds);
1477  SetTime(hour, minutes, value);
1478 }
1479 
1480 inline int Date::DaysBetween(const Date& other) const
1481 {
1482  return Check(OCI_DateDaysBetween(*this, other));
1483 }
1484 
1485 inline void Date::SetDate(int year, int month, int day)
1486 {
1487  Check(OCI_DateSetDate(*this, year, month, day));
1488 }
1489 
1490 inline void Date::SetTime(int hour, int min, int sec)
1491 {
1492  Check(OCI_DateSetTime(*this, hour, min , sec));
1493 }
1494 
1495 inline void Date::SetDateTime(int year, int month, int day, int hour, int min, int sec)
1496 {
1497  Check(OCI_DateSetDateTime(*this, year, month, day, hour, min , sec));
1498 }
1499 
1500 inline void Date::GetDate(int &year, int &month, int &day) const
1501 {
1502  Check(OCI_DateGetDate(*this, &year, &month, &day));
1503 }
1504 
1505 inline void Date::GetTime(int &hour, int &min, int &sec) const
1506 {
1507  Check(OCI_DateGetTime(*this, &hour, &min , &sec));
1508 }
1509 
1510 inline void Date::GetDateTime(int &year, int &month, int &day, int &hour, int &min, int &sec) const
1511 {
1512  Check(OCI_DateGetDateTime(*this, &year, &month, &day, &hour, &min , &sec));
1513 }
1514 
1515 inline void Date::AddDays(int days)
1516 {
1517  Check(OCI_DateAddDays(*this, days));
1518 }
1519 
1520 inline void Date::AddMonths(int months)
1521 {
1522  OCI_DateAddMonths(*this, months);
1523 }
1524 
1525 inline void Date::SysDate()
1526 {
1527  Check(OCI_DateSysDate(*this));
1528 }
1529 
1530 inline Date Date::NextDay(const ostring& day) const
1531 {
1532  Date result = Clone();
1533 
1534  Check(OCI_DateNextDay(result, day.c_str()));
1535 
1536  return result;
1537 }
1538 
1539 inline Date Date::LastDay() const
1540 {
1541  Date result = Clone();
1542 
1543  Check(OCI_DateLastDay(result));
1544 
1545  return result;
1546 }
1547 
1548 inline void Date::ChangeTimeZone(const ostring& tzSrc, const ostring& tzDst)
1549 {
1550  Check(OCI_DateZoneToZone(*this, tzSrc.c_str(), tzDst.c_str()));
1551 }
1552 
1553 inline void Date::FromString(const ostring& str, const ostring& format)
1554 {
1555  Check(OCI_DateFromText(*this, str.c_str(), format.c_str()));
1556 }
1557 
1558 inline ostring Date::ToString(const ostring& format) const
1559 {
1560  size_t size = OCI_SIZE_BUFFER;
1561 
1562  ManagedBuffer<otext> buffer(size + 1);
1563 
1564  Check(OCI_DateToText(*this, format.c_str(), (int) size, buffer));
1565 
1566  return MakeString(static_cast<const otext *>(buffer));
1567 }
1568 
1569 inline Date::operator ostring() const
1570 {
1571  return ToString();
1572 }
1573 
1575 {
1576  return *this += 1;
1577 }
1578 
1580 {
1581  Date result = Clone();
1582 
1583  *this += 1;
1584 
1585  return result;
1586 }
1587 
1589 {
1590  return *this -= 1;
1591 }
1592 
1594 {
1595  Date result = Clone();
1596 
1597  *this -= 1;
1598 
1599  return result;
1600 }
1601 
1602 inline Date Date::operator + (int value)
1603 {
1604  Date result = Clone();
1605  return result += value;
1606 }
1607 
1608 inline Date Date::operator - (int value)
1609 {
1610  Date result = Clone();
1611  return result -= value;
1612 }
1613 
1614 inline Date& Date::operator += (int value)
1615 {
1616  AddDays(value);
1617  return *this;
1618 }
1619 
1620 inline Date& Date::operator -= (int value)
1621 {
1622  AddDays(-value);
1623  return *this;
1624 }
1625 
1626 inline bool Date::operator == (const Date& other) const
1627 {
1628  return Compare(other) == 0;
1629 }
1630 
1631 inline bool Date::operator != (const Date& other) const
1632 {
1633  return (!(*this == other));
1634 }
1635 
1636 inline bool Date::operator > (const Date& other) const
1637 {
1638  return (Compare(other) > 0);
1639 }
1640 
1641 inline bool Date::operator < (const Date& other) const
1642 {
1643  return (Compare(other) < 0);
1644 }
1645 
1646 inline bool Date::operator >= (const Date& other) const
1647 {
1648  int res = Compare(other);
1649 
1650  return (res == 0 || res < 0);
1651 }
1652 
1653 inline bool Date::operator <= (const Date& other) const
1654 {
1655  int res = Compare(other);
1656 
1657  return (res == 0 || res > 0);
1658 }
1659 
1660 /* --------------------------------------------------------------------------------------------- *
1661  * Interval
1662  * --------------------------------------------------------------------------------------------- */
1663 
1665 {
1666  Acquire(Check(OCI_IntervalCreate(NULL, type)), reinterpret_cast<HandleFreeFunc>(OCI_IntervalFree), 0);
1667 }
1668 
1669 inline Interval::Interval(OCI_Interval *pInterval, Handle *parent)
1670 {
1671  Acquire(pInterval, 0, parent);
1672 }
1673 
1675 {
1676  Interval result(GetType());
1677 
1678  Check(OCI_IntervalAssign(result, *this));
1679 
1680  return result;
1681 }
1682 
1683 inline int Interval::Compare(const Interval& other) const
1684 {
1685  return Check(OCI_IntervalCompare(*this, other));
1686 }
1687 
1689 {
1690  return IntervalType(static_cast<IntervalType::type>(Check(OCI_IntervalGetType(*this))));
1691 }
1692 
1693 inline bool Interval::IsValid() const
1694 {
1695  return (Check(OCI_IntervalCheck(*this)) == 0);
1696 }
1697 
1698 inline int Interval::GetYear() const
1699 {
1700  int year, month;
1701 
1702  GetYearMonth(year, month);
1703 
1704  return year;
1705 }
1706 
1707 inline void Interval::SetYear(int value)
1708 {
1709  int year, month;
1710 
1711  GetYearMonth(year, month);
1712  SetYearMonth(value, month);
1713 }
1714 
1715 inline int Interval::GetMonth() const
1716 {
1717  int year, month;
1718 
1719  GetYearMonth(year, month);
1720 
1721  return month;
1722 }
1723 
1724 inline void Interval::SetMonth(int value)
1725 {
1726  int year, month;
1727 
1728  GetYearMonth(year, month);
1729  SetYearMonth(year, value);
1730 }
1731 
1732 inline int Interval::GetDay() const
1733 {
1734  int day, hour, minutes, seconds, milliseconds;
1735 
1736  GetDaySecond(day, hour, minutes, seconds, milliseconds);
1737 
1738  return day;
1739 }
1740 
1741 inline void Interval::SetDay(int value)
1742 {
1743  int day, hour, minutes, seconds, milliseconds;
1744 
1745  GetDaySecond(day, hour, minutes, seconds, milliseconds);
1746  SetDaySecond(value, hour, minutes, seconds, milliseconds);
1747 }
1748 
1749 inline int Interval::GetHours() const
1750 {
1751  int day, hour, minutes, seconds, milliseconds;
1752 
1753  GetDaySecond(day, hour, minutes, seconds, milliseconds);
1754 
1755  return hour;
1756 }
1757 
1758 inline void Interval::SetHours(int value)
1759 {
1760  int day, hour, minutes, seconds, milliseconds;
1761 
1762  GetDaySecond(day, hour, minutes, seconds, milliseconds);
1763  SetDaySecond(day, value, minutes, seconds, milliseconds);
1764 }
1765 
1766 inline int Interval::GetMinutes() const
1767 {
1768  int day, hour, minutes, seconds, milliseconds;
1769 
1770  GetDaySecond(day, hour, minutes, seconds, milliseconds);
1771 
1772  return minutes;
1773 }
1774 
1775 inline void Interval::SetMinutes(int value)
1776 {
1777  int day, hour, minutes, seconds, milliseconds;
1778 
1779  GetDaySecond(day, hour, minutes, seconds, milliseconds);
1780  SetDaySecond(day, hour, value, seconds, milliseconds);
1781 }
1782 
1783 inline int Interval::GetSeconds() const
1784 {
1785  int day, hour, minutes, seconds, milliseconds;
1786 
1787  GetDaySecond(day, hour, minutes, seconds, milliseconds);
1788 
1789  return seconds;
1790 }
1791 
1792 inline void Interval::SetSeconds(int value)
1793 {
1794  int day, hour, minutes, seconds, milliseconds;
1795 
1796  GetDaySecond(day, hour, minutes, seconds, milliseconds);
1797  SetDaySecond(day, hour, minutes, value, milliseconds);
1798 }
1799 
1800 inline int Interval::GetMilliSeconds() const
1801 {
1802  int day, hour, minutes, seconds, milliseconds;
1803 
1804  GetDaySecond(day, hour, minutes, seconds, milliseconds);
1805 
1806  return milliseconds;
1807 }
1808 
1809 inline void Interval::SetMilliSeconds(int value)
1810 {
1811  int day, hour, minutes, seconds, milliseconds;
1812 
1813  GetDaySecond(day, hour, minutes, seconds, milliseconds);
1814  SetDaySecond(day, hour, minutes, seconds, value);
1815 }
1816 
1817 inline void Interval::GetDaySecond(int &day, int &hour, int &min, int &sec, int &fsec) const
1818 {
1819  Check(OCI_IntervalGetDaySecond(*this, &day, &hour, &min, &sec, &fsec));
1820 }
1821 
1822 inline void Interval::SetDaySecond(int day, int hour, int min, int sec, int fsec)
1823 {
1824  Check(OCI_IntervalSetDaySecond(*this, day, hour, min, sec, fsec));
1825 }
1826 
1827 inline void Interval::GetYearMonth(int &year, int &month) const
1828 {
1829  Check(OCI_IntervalGetYearMonth(*this, &year, &month));
1830 }
1831 inline void Interval::SetYearMonth(int year, int month)
1832 {
1833  Check(OCI_IntervalSetYearMonth(*this, year, month));
1834 }
1835 
1836 inline void Interval::UpdateTimeZone(const ostring& timeZone)
1837 {
1838  Check(OCI_IntervalFromTimeZone(*this, timeZone.c_str()));
1839 }
1840 
1841 inline void Interval::FromString(const ostring& data)
1842 {
1843  Check(OCI_IntervalFromText(*this, data.c_str()));
1844 }
1845 
1846 inline ostring Interval::ToString(int leadingPrecision, int fractionPrecision) const
1847 {
1848  size_t size = OCI_SIZE_BUFFER;
1849 
1850  ManagedBuffer<otext> buffer(size + 1);
1851 
1852  Check(OCI_IntervalToText(*this, leadingPrecision, fractionPrecision, (int) size, buffer));
1853 
1854  return MakeString(static_cast<const otext *>(buffer));
1855 }
1856 
1857 inline Interval::operator ostring() const
1858 {
1859  return ToString();
1860 }
1861 
1863 {
1864  Interval result = Clone();
1865  return result += other;
1866 }
1867 
1869 {
1870  Interval result = Clone();
1871  return result -= other;
1872 }
1873 
1875 {
1876  Check(OCI_IntervalAdd(*this, other));
1877  return *this;
1878 }
1879 
1881 {
1882  Check(OCI_IntervalSubtract(*this, other));
1883  return *this;
1884 }
1885 
1886 inline bool Interval::operator == (const Interval& other) const
1887 {
1888  return Compare(other) == 0;
1889 }
1890 
1891 inline bool Interval::operator != (const Interval& other) const
1892 {
1893  return (!(*this == other));
1894 }
1895 
1896 inline bool Interval::operator > (const Interval& other) const
1897 {
1898  return (Compare(other) > 0);
1899 }
1900 
1901 inline bool Interval::operator < (const Interval& other) const
1902 {
1903  return (Compare(other) < 0);
1904 }
1905 
1906 inline bool Interval::operator >= (const Interval& other) const
1907 {
1908  int res = Compare(other);
1909 
1910  return (res == 0 || res < 0);
1911 }
1912 
1913 inline bool Interval::operator <= (const Interval& other) const
1914 {
1915  int res = Compare(other);
1916 
1917  return (res == 0 || res > 0);
1918 }
1919 
1920 /* --------------------------------------------------------------------------------------------- *
1921  * Timestamp
1922  * --------------------------------------------------------------------------------------------- */
1923 
1924 inline Timestamp::Timestamp(TimestampType type)
1925 {
1926  Acquire(Check(OCI_TimestampCreate(NULL, type)), reinterpret_cast<HandleFreeFunc>(OCI_TimestampFree), 0);
1927 }
1928 
1929 inline Timestamp::Timestamp(OCI_Timestamp *pTimestamp, Handle *parent)
1930 {
1931  Acquire(pTimestamp, 0, parent);
1932 }
1933 
1935 {
1936  Timestamp result(GetType());
1937 
1938  Check(OCI_TimestampAssign(result, *this));
1939 
1940  return result;
1941 }
1942 
1943 inline int Timestamp::Compare(const Timestamp& other) const
1944 {
1945  return Check(OCI_TimestampCompare(*this, other));
1946 }
1947 
1949 {
1950  return TimestampType(static_cast<TimestampType::type>(Check(OCI_TimestampGetType(*this))));
1951 }
1952 
1953 inline void Timestamp::SetDateTime(int year, int month, int day, int hour, int min, int sec, int fsec, const ostring& timeZone)
1954 {
1955  Check(OCI_TimestampConstruct(*this, year, month, day, hour, min,sec, fsec, timeZone.c_str()));
1956 }
1957 
1958 inline void Timestamp::Convert(const Timestamp& other)
1959 {
1960  Check(OCI_TimestampConvert(*this, other));
1961 }
1962 
1963 inline bool Timestamp::IsValid() const
1964 {
1965  return (Check(OCI_TimestampCheck(*this)) == 0);
1966 }
1967 
1968 inline int Timestamp::GetYear() const
1969 {
1970  int year, month, day;
1971 
1972  GetDate(year, month, day);
1973 
1974  return year;
1975 }
1976 
1977 inline void Timestamp::SetYear(int value)
1978 {
1979  int year, month, day;
1980 
1981  GetDate(year, month, day);
1982  SetDate(value, month, day);
1983 }
1984 
1985 inline int Timestamp::GetMonth() const
1986 {
1987  int year, month, day;
1988 
1989  GetDate(year, month, day);
1990 
1991  return month;
1992 }
1993 
1994 inline void Timestamp::SetMonth(int value)
1995 {
1996  int year, month, day;
1997 
1998  GetDate(year, month, day);
1999  SetDate(year, value, day);
2000 }
2001 
2002 inline int Timestamp::GetDay() const
2003 {
2004  int year, month, day;
2005 
2006  GetDate(year, month, day);
2007 
2008  return day;
2009 }
2010 
2011 inline void Timestamp::SetDay(int value)
2012 {
2013  int year, month, day;
2014 
2015  GetDate(year, month, day);
2016  SetDate(year, month, value);
2017 }
2018 
2019 inline int Timestamp::GetHours() const
2020 {
2021  int hour, minutes, seconds, milliseconds;
2022 
2023  GetTime(hour, minutes, seconds, milliseconds);
2024 
2025  return hour;
2026 }
2027 
2028 inline void Timestamp::SetHours(int value)
2029 {
2030  int hour, minutes, seconds, milliseconds;
2031 
2032  GetTime(hour, minutes, seconds, milliseconds);
2033  SetTime(value, minutes, seconds, milliseconds);
2034 }
2035 
2036 inline int Timestamp::GetMinutes() const
2037 {
2038  int hour, minutes, seconds, milliseconds;
2039 
2040  GetTime(hour, minutes, seconds, milliseconds);
2041 
2042  return minutes;
2043 }
2044 
2045 inline void Timestamp::SetMinutes(int value)
2046 {
2047  int hour, minutes, seconds, milliseconds;
2048 
2049  GetTime(hour, minutes, seconds, milliseconds);
2050  SetTime(hour, value, seconds, milliseconds);
2051 }
2052 
2053 inline int Timestamp::GetSeconds() const
2054 {
2055  int hour, minutes, seconds, milliseconds;
2056 
2057  GetTime(hour, minutes, seconds, milliseconds);
2058 
2059  return seconds;
2060 }
2061 
2062 inline void Timestamp::SetSeconds(int value)
2063 {
2064  int hour, minutes, seconds, milliseconds;
2065 
2066  GetTime(hour, minutes, seconds, milliseconds);
2067  SetTime(hour, minutes, value, milliseconds);
2068 }
2069 
2070 inline int Timestamp::GetMilliSeconds() const
2071 {
2072  int hour, minutes, seconds, milliseconds;
2073 
2074  GetTime(hour, minutes, seconds, milliseconds);
2075 
2076  return milliseconds;
2077 }
2078 
2079 inline void Timestamp::SetMilliSeconds(int value)
2080 {
2081  int hour, minutes, seconds, milliseconds;
2082 
2083  GetTime(hour, minutes, seconds, milliseconds);
2084  SetTime(hour, minutes, seconds, value);
2085 }
2086 
2087 inline void Timestamp::GetDate(int &year, int &month, int &day) const
2088 {
2089  Check(OCI_TimestampGetDate(*this, &year, &month, &day));
2090 }
2091 
2092 inline void Timestamp::GetTime(int &hour, int &min, int &sec, int &fsec) const
2093 {
2094  Check(OCI_TimestampGetTime(*this, &hour, &min, &sec, &fsec));
2095 }
2096 
2097 inline void Timestamp::GetDateTime(int &year, int &month, int &day, int &hour, int &min, int &sec, int &fsec) const
2098 {
2099  Check(OCI_TimestampGetDateTime(*this, &year, &month, &day, &hour, &min, &sec, &fsec));
2100 }
2101 
2102 inline void Timestamp::SetDate(int year, int month, int day)
2103 {
2104  int tmpYear, tmpMonth, tempDay, hour, minutes, seconds, milliseconds;
2105 
2106  GetDateTime(year, month, day, hour, tmpYear, tmpMonth, tempDay);
2107  SetDateTime(year, month, day, hour, minutes, seconds, milliseconds);
2108 }
2109 
2110 inline void Timestamp::SetTime(int hour, int min, int sec, int fsec)
2111 {
2112  int year, month, day, tmpHour, tmpMinutes, tmpSeconds, tmpMilliseconds;
2113 
2114  GetDateTime(year, month, day, tmpHour, tmpMinutes, tmpSeconds, tmpMilliseconds);
2115  SetDateTime(year, month, day, hour, min, sec, fsec);
2116 }
2117 
2118 inline void Timestamp::SetTimeZone(const ostring& timeZone)
2119 {
2121  {
2122  int year, month, day, hour, minutes, seconds, milliseconds;
2123 
2124  GetDateTime(year, month, day, hour, minutes, seconds, milliseconds);
2125  SetDateTime(year, month, day, hour, minutes, seconds, milliseconds, timeZone);
2126  }
2127 }
2128 
2130 {
2131  if (GetType() != Timestamp::NoTimeZone)
2132  {
2133  size_t size = OCI_SIZE_BUFFER;
2134 
2135  ManagedBuffer<otext> buffer(size + 1);
2136 
2137  Check(OCI_TimestampGetTimeZoneName(*this, (int)size, buffer));
2138 
2139  return MakeString(static_cast<const otext *>(buffer));
2140  }
2141  else
2142  {
2143  return "";
2144  }
2145 }
2146 
2147 inline void Timestamp::GetTimeZoneOffset(int &hour, int &min) const
2148 {
2149  Check(OCI_TimestampGetTimeZoneOffset(*this, &hour, &min));
2150 }
2151 
2152 inline void Timestamp::Substract(const Timestamp &lsh, const Timestamp &rsh, Interval& result)
2153 {
2154  Check(OCI_TimestampSubtract(lsh, rsh, result));
2155 }
2156 
2158 {
2160 }
2161 
2162 inline void Timestamp::FromString(const ostring& data, const ostring& format)
2163 {
2164  Check(OCI_TimestampFromText(*this, data.c_str(), format.c_str()));
2165 }
2166 
2167 inline ostring Timestamp::ToString(const ostring& format, int precision) const
2168 {
2169  size_t size = OCI_SIZE_BUFFER;
2170 
2171  ManagedBuffer<otext> buffer(size + 1);
2172 
2173  Check(OCI_TimestampToText(*this, format.c_str(), static_cast<int>(size), buffer, precision));
2174 
2175  return MakeString(static_cast<const otext *>(buffer));
2176 }
2177 
2178 inline Timestamp::operator ostring() const
2179 {
2180  return ToString();
2181 }
2182 
2184 {
2185  return *this += 1;
2186 }
2187 
2189 {
2190  Timestamp result = Clone();
2191 
2192  *this += 1;
2193 
2194  return result;
2195 }
2196 
2198 {
2199  return *this -= 1;
2200 }
2201 
2203 {
2204  Timestamp result = Clone();
2205 
2206  *this -= 1;
2207 
2208  return result;
2209 }
2210 
2212 {
2213  Timestamp result = Clone();
2214  Interval interval(Interval::DaySecond);
2215  interval.SetDay(1);
2216  return result += value;
2217 }
2218 
2220 {
2221  Timestamp result = Clone();
2222  Interval interval(Interval::DaySecond);
2223  interval.SetDay(1);
2224  return result -= value;
2225 }
2226 
2228 {
2229  Interval interval(Interval::DaySecond);
2230  Check(OCI_TimestampSubtract(*this, other, interval));
2231  return interval;
2232 }
2233 
2235 {
2236  Timestamp result = Clone();
2237  return result += other;
2238 }
2239 
2241 {
2242  Timestamp result = Clone();
2243  return result -= other;
2244 }
2245 
2247 {
2248  Check(OCI_TimestampIntervalAdd(*this, other));
2249  return *this;
2250 }
2251 
2253 {
2254  Check(OCI_TimestampIntervalSub(*this, other));
2255  return *this;
2256 }
2257 
2259 {
2260  Interval interval(Interval::DaySecond);
2261  interval.SetDay(value);
2262  return *this += interval;
2263 }
2264 
2266 {
2267  Interval interval(Interval::DaySecond);
2268  interval.SetDay(value);
2269  return *this -= interval;
2270 }
2271 
2272 inline bool Timestamp::operator == (const Timestamp& other) const
2273 {
2274  return Compare(other) == 0;
2275 }
2276 
2277 inline bool Timestamp::operator != (const Timestamp& other) const
2278 {
2279  return (!(*this == other));
2280 }
2281 
2282 inline bool Timestamp::operator > (const Timestamp& other) const
2283 {
2284  return (Compare(other) > 0);
2285 }
2286 
2287 inline bool Timestamp::operator < (const Timestamp& other) const
2288 {
2289  return (Compare(other) < 0);
2290 }
2291 
2292 inline bool Timestamp::operator >= (const Timestamp& other) const
2293 {
2294  int res = Compare(other);
2295 
2296  return (res == 0 || res < 0);
2297 }
2298 
2299 inline bool Timestamp::operator <= (const Timestamp& other) const
2300 {
2301  int res = Compare(other);
2302 
2303  return (res == 0 || res > 0);
2304 }
2305 
2306 /* --------------------------------------------------------------------------------------------- *
2307  * Lob
2308  * --------------------------------------------------------------------------------------------- */
2309 
2310 template<class TLobObjectType, int TLobOracleType>
2312 {
2313  Acquire(Check(OCI_LobCreate(connection, TLobOracleType)), reinterpret_cast<HandleFreeFunc>(OCI_LobFree), connection.GetHandle());
2314 }
2315 
2316 template<class TLobObjectType, int TLobOracleType>
2317 inline Lob<TLobObjectType, TLobOracleType>::Lob(OCI_Lob *pLob, Handle *parent)
2318 {
2319  Acquire(pLob, 0, parent);
2320 }
2321 
2322 template<>
2323 inline ostring Lob<ostring, LobCharacter>::Read(unsigned int length)
2324 {
2325  ManagedBuffer<otext> buffer(length + 1);
2326 
2327  Check(OCI_LobRead(*this, static_cast<AnyPointer>(buffer), length));
2328 
2329  return MakeString(static_cast<const otext *>(buffer));
2330 }
2331 
2332 template<>
2333 inline ostring Lob<ostring, LobNationalCharacter>::Read(unsigned int length)
2334 {
2335  ManagedBuffer<otext> buffer(length + 1);
2336 
2337  Check(OCI_LobRead(*this, static_cast<AnyPointer>(buffer), length));
2338 
2339  return MakeString(static_cast<const otext *>(buffer));
2340 }
2341 
2342 template<>
2343 inline Raw Lob<Raw, LobBinary>::Read(unsigned int length)
2344 {
2345  ManagedBuffer<unsigned char> buffer(length + 1);
2346 
2347  length = Check(OCI_LobRead(*this, static_cast<AnyPointer>(buffer), length));
2348 
2349  return MakeRaw(buffer, length);
2350 }
2351 
2352 template<class TLobObjectType, int TLobOracleType>
2353 inline unsigned int Lob<TLobObjectType, TLobOracleType>::Write(const TLobObjectType& content)
2354 {
2355  return Check(OCI_LobWrite(*this, static_cast<AnyPointer>(const_cast<typename TLobObjectType::value_type *>(content.data())), static_cast<unsigned int>(content.size())));
2356 }
2357 
2358 template<class TLobObjectType, int TLobOracleType>
2360 {
2361  Check(OCI_LobAppendLob(*this, other));
2362 }
2363 
2364 template<class TLobObjectType, int TLobOracleType>
2365 inline unsigned int Lob<TLobObjectType, TLobOracleType>::Append(const TLobObjectType& content)
2366 {
2367  return Check(OCI_LobAppend(*this, static_cast<AnyPointer>(const_cast<typename TLobObjectType::value_type *>(content.data())), static_cast<unsigned int>(content.size())));
2368 }
2369 
2370 template<class TLobObjectType, int TLobOracleType>
2371 inline bool Lob<TLobObjectType, TLobOracleType>::Seek(SeekMode seekMode, big_uint offset)
2372 {
2373  return (Check(OCI_LobSeek(*this, offset, seekMode)) == TRUE);
2374 }
2375 
2376 template<class TLobObjectType, int TLobOracleType>
2378 {
2379  Lob result(GetConnection());
2380 
2381  Check(OCI_LobAssign(result, *this));
2382 
2383  return result;
2384 }
2385 
2386 template<class TLobObjectType, int TLobOracleType>
2387 inline bool Lob<TLobObjectType, TLobOracleType>::Equals(const Lob &other) const
2388 {
2389  return (Check(OCI_LobIsEqual(*this, other)) == TRUE);
2390 }
2391 
2392 template<class TLobObjectType, int TLobOracleType>
2394 {
2395  return LobType(static_cast<LobType::type>(Check(OCI_LobGetType(*this))));
2396 }
2397 
2398 template<class TLobObjectType, int TLobOracleType>
2400 {
2401  return Check(OCI_LobGetOffset(*this));
2402 }
2403 
2404 template<class TLobObjectType, int TLobOracleType>
2406 {
2407  return Check(OCI_LobGetLength(*this));
2408 }
2409 
2410 template<class TLobObjectType, int TLobOracleType>
2412 {
2413  return Check(OCI_LobGetMaxSize(*this));
2414 }
2415 
2416 template<class TLobObjectType, int TLobOracleType>
2418 {
2419  return Check(OCI_LobGetChunkSize(*this));
2420 }
2421 
2422 template<class TLobObjectType, int TLobOracleType>
2424 {
2425  return Connection(Check(OCI_LobGetConnection(*this)), 0);
2426 }
2427 
2428 template<class TLobObjectType, int TLobOracleType>
2430 {
2431  Check(OCI_LobTruncate(*this, length));
2432 }
2433 
2434 template<class TLobObjectType, int TLobOracleType>
2435 inline big_uint Lob<TLobObjectType, TLobOracleType>::Erase(big_uint offset, big_uint length)
2436 {
2437  return Check(OCI_LobErase(*this, offset, length));
2438 }
2439 
2440 template<class TLobObjectType, int TLobOracleType>
2441 inline void Lob<TLobObjectType, TLobOracleType>::Copy(Lob &dest, big_uint offset, big_uint offsetDest, big_uint size) const
2442 {
2443  Check(OCI_LobCopy(dest, *this, offsetDest, offset, size));
2444 }
2445 
2446 template<class TLobObjectType, int TLobOracleType>
2448 {
2449  return (Check(OCI_LobIsTemporary(*this)) == TRUE);
2450 }
2451 
2452 template<class TLobObjectType, int TLobOracleType>
2454 {
2455  Check(OCI_LobOpen(*this, mode));
2456 }
2457 
2458 template<class TLobObjectType, int TLobOracleType>
2460 {
2461  Check(OCI_LobFlush(*this));
2462 }
2463 
2464 template<class TLobObjectType, int TLobOracleType>
2466 {
2467  Check(OCI_LobClose(*this));
2468 }
2469 
2470 template<class TLobObjectType, int TLobOracleType>
2472 {
2473  Check(OCI_LobEnableBuffering(*this, value));
2474 }
2475 
2476 template<class TLobObjectType, int TLobOracleType>
2478 {
2480 }
2481 
2482 template<class TLobObjectType, int TLobOracleType>
2484 {
2485  Append(other);
2486  return *this;
2487 }
2488 
2489 template<class TLobObjectType, int TLobOracleType>
2491 {
2492  return Equals(other);
2493 }
2494 
2495 template<class TLobObjectType, int TLobOracleType>
2497 {
2498  return (!(*this == other));
2499 }
2500 
2501 /* --------------------------------------------------------------------------------------------- *
2502  * File
2503  * --------------------------------------------------------------------------------------------- */
2504 
2505 inline File::File(const Connection &connection)
2506 {
2507  Acquire(Check(OCI_FileCreate(connection, OCI_BFILE)), reinterpret_cast<HandleFreeFunc>(OCI_FileFree), connection.GetHandle());
2508 }
2509 
2510 inline File::File(const Connection &connection, const ostring& directory, const ostring& name)
2511 {
2512  Acquire(Check(OCI_FileCreate(connection, OCI_BFILE)), reinterpret_cast<HandleFreeFunc>(OCI_FileFree), connection.GetHandle());
2513 
2514  SetInfos(directory, name);
2515 }
2516 
2517 inline File::File(OCI_File *pFile, Handle *parent)
2518 {
2519  Acquire(pFile, 0, parent);
2520 }
2521 
2522 inline Raw File::Read(unsigned int size)
2523 {
2524  ManagedBuffer<unsigned char> buffer(size + 1);
2525 
2526  size = Check(OCI_FileRead(*this, static_cast<AnyPointer>(buffer), size));
2527 
2528  return MakeRaw(buffer, size);
2529 }
2530 
2531 inline bool File::Seek(SeekMode seekMode, big_uint offset)
2532 {
2533  return (Check(OCI_FileSeek(*this, offset, seekMode)) == TRUE);
2534 }
2535 
2536 inline File File::Clone() const
2537 {
2538  File result(GetConnection());
2539 
2540  Check(OCI_FileAssign(result, *this));
2541 
2542  return result;
2543 }
2544 
2545 inline bool File::Equals(const File &other) const
2546 {
2547  return (Check(OCI_FileIsEqual(*this, other)) == TRUE);
2548 }
2549 
2550 inline big_uint File::GetOffset() const
2551 {
2552  return Check(OCI_FileGetOffset(*this));
2553 }
2554 
2555 inline big_uint File::GetLength() const
2556 {
2557  return Check(OCI_FileGetSize(*this));
2558 }
2559 
2561 {
2562  return Connection(Check(OCI_FileGetConnection(*this)), 0);
2563 }
2564 
2565 inline bool File::Exists() const
2566 {
2567  return (Check(OCI_FileExists(*this)) == TRUE);
2568 }
2569 
2570 inline void File::SetInfos(const ostring& directory, const ostring& name)
2571 {
2572  Check(OCI_FileSetName(*this, directory.c_str(), name.c_str()));
2573 }
2574 
2575 inline ostring File::GetName() const
2576 {
2577  return MakeString(Check(OCI_FileGetName(*this)));
2578 }
2579 
2581 {
2582  return MakeString(Check(OCI_FileGetDirectory(*this)));
2583 }
2584 
2585 inline void File::Open()
2586 {
2587  Check(OCI_FileOpen(*this));
2588 }
2589 
2590 inline bool File::IsOpened() const
2591 {
2592  return (Check(OCI_FileIsOpen(*this)) == TRUE);
2593 }
2594 
2595 inline void File::Close()
2596 {
2597  Check(OCI_FileClose(*this));
2598 }
2599 
2600 inline bool File::operator == (const File& other) const
2601 {
2602  return Equals(other);
2603 }
2604 
2605 inline bool File::operator != (const File& other) const
2606 {
2607  return (!(*this == other));
2608 }
2609 
2610 /* --------------------------------------------------------------------------------------------- *
2611  * TypeInfo
2612  * --------------------------------------------------------------------------------------------- */
2613 
2614 inline TypeInfo::TypeInfo(const Connection &connection, const ostring& name, TypeInfoType type)
2615 {
2616  Acquire(Check(OCI_TypeInfoGet(connection, name.c_str(), type)), reinterpret_cast<HandleFreeFunc>(0), connection.GetHandle());
2617 }
2618 
2619 inline TypeInfo::TypeInfo(OCI_TypeInfo *pTypeInfo)
2620 {
2621  Acquire(pTypeInfo, 0, 0);
2622 }
2623 
2625 {
2626  return TypeInfoType(static_cast<TypeInfoType::type>(Check(OCI_TypeInfoGetType(*this))));
2627 }
2628 
2629 inline ostring TypeInfo::GetName() const
2630 {
2631  return Check(OCI_TypeInfoGetName(*this));
2632 }
2633 
2635 {
2636  return Connection(Check(OCI_TypeInfoGetConnection(*this)), 0);
2637 }
2638 
2639 inline unsigned int TypeInfo::GetColumnCount() const
2640 {
2641  return Check(OCI_TypeInfoGetColumnCount(*this));
2642 }
2643 
2644 inline Column TypeInfo::GetColumn(unsigned int index) const
2645 {
2646  return Column(Check(OCI_TypeInfoGetColumn(*this, index)), GetHandle());
2647 }
2648 
2649 /* --------------------------------------------------------------------------------------------- *
2650  * Object
2651  * --------------------------------------------------------------------------------------------- */
2652 
2653 inline Object::Object(const TypeInfo &typeInfo)
2654 {
2655  Connection connection = typeInfo.GetConnection();
2656  Acquire(Check(OCI_ObjectCreate(connection, typeInfo)), reinterpret_cast<HandleFreeFunc>(OCI_ObjectFree), connection.GetHandle());
2657 }
2658 
2659 inline Object::Object(OCI_Object *pObject, Handle *parent)
2660 {
2661  Acquire(pObject, 0, parent);
2662 }
2663 
2664 inline Object Object::Clone() const
2665 {
2666  Object result(GetTypeInfo());
2667 
2668  Check(OCI_ObjectAssign(result, *this));
2669 
2670  return result;
2671 }
2672 
2673 inline bool Object::IsAttributeNull(const ostring& name) const
2674 {
2675  return (Check(OCI_ObjectIsNull(*this, name.c_str())) == TRUE);
2676 }
2677 
2678 inline void Object::SetAttributeNull(const ostring& name)
2679 {
2680  Check(OCI_ObjectSetNull(*this, name.c_str()));
2681 }
2682 
2684 {
2685  return TypeInfo(Check(OCI_ObjectGetTypeInfo(*this)));
2686 }
2687 
2689 {
2690  TypeInfo typeInfo = GetTypeInfo();
2691  Connection connection = typeInfo.GetConnection();
2692 
2693  OCI_Ref *pRef = OCI_RefCreate(connection, typeInfo);
2694 
2695  Check(OCI_ObjectGetSelfRef(*this, pRef));
2696 
2697  return Reference(pRef, GetHandle());
2698 }
2699 
2701 {
2702  return ObjectType(static_cast<ObjectType::type>(Check(OCI_ObjectGetType(*this))));
2703 }
2704 
2705 template<>
2706 inline short Object::Get<short>(const ostring& name) const
2707 {
2708  return Check(OCI_ObjectGetShort(*this, name.c_str()));
2709 }
2710 
2711 template<>
2712 inline unsigned short Object::Get<unsigned short>(const ostring& name) const
2713 {
2714  return Check(OCI_ObjectGetUnsignedShort(*this, name.c_str()));
2715 }
2716 
2717 template<>
2718 inline int Object::Get<int>(const ostring& name) const
2719 {
2720  return Check(OCI_ObjectGetInt(*this, name.c_str()));
2721 }
2722 
2723 template<>
2724 inline unsigned int Object::Get<unsigned int>(const ostring& name) const
2725 {
2726  return Check(OCI_ObjectGetUnsignedInt(*this, name.c_str()));
2727 }
2728 
2729 template<>
2730 inline big_int Object::Get<big_int>(const ostring& name) const
2731 {
2732  return Check(OCI_ObjectGetBigInt(*this, name.c_str()));
2733 }
2734 
2735 template<>
2736 inline big_uint Object::Get<big_uint>(const ostring& name) const
2737 {
2738  return Check(OCI_ObjectGetUnsignedBigInt(*this, name.c_str()));
2739 }
2740 
2741 template<>
2742 inline float Object::Get<float>(const ostring& name) const
2743 {
2744  return Check(OCI_ObjectGetFloat(*this, name.c_str()));
2745 }
2746 
2747 template<>
2748 inline double Object::Get<double>(const ostring& name) const
2749 {
2750  return Check(OCI_ObjectGetDouble(*this, name.c_str()));
2751 }
2752 
2753 template<>
2754 inline ostring Object::Get<ostring>(const ostring& name) const
2755 {
2756  return MakeString(Check(OCI_ObjectGetString(*this,name.c_str())));
2757 }
2758 
2759 template<>
2760 inline Date Object::Get<Date>(const ostring& name) const
2761 {
2762  return Date(Check(OCI_ObjectGetDate(*this,name.c_str())), GetHandle());
2763 }
2764 
2765 template<>
2766 inline Timestamp Object::Get<Timestamp>(const ostring& name) const
2767 {
2768  return Timestamp(Check(OCI_ObjectGetTimestamp(*this,name.c_str())), GetHandle());
2769 }
2770 
2771 template<>
2772 inline Interval Object::Get<Interval>(const ostring& name) const
2773 {
2774  return Interval(Check(OCI_ObjectGetInterval(*this,name.c_str())), GetHandle());
2775 }
2776 
2777 template<>
2778 inline Object Object::Get<Object>(const ostring& name) const
2779 {
2780  return Object(Check(OCI_ObjectGetObject(*this,name.c_str())), GetHandle());
2781 }
2782 
2783 template<>
2784 inline Reference Object::Get<Reference>(const ostring& name) const
2785 {
2786  return Reference(Check(OCI_ObjectGetRef(*this,name.c_str())), GetHandle());
2787 }
2788 
2789 template<>
2790 inline Clob Object::Get<Clob>(const ostring& name) const
2791 {
2792  return Clob(Check(OCI_ObjectGetLob(*this,name.c_str())), GetHandle());
2793 }
2794 
2795 template<>
2796 inline NClob Object::Get<NClob>(const ostring& name) const
2797 {
2798  return NClob(Check(OCI_ObjectGetLob(*this, name.c_str())), GetHandle());
2799 }
2800 
2801 
2802 template<>
2803 inline Blob Object::Get<Blob>(const ostring& name) const
2804 {
2805  return Blob(Check(OCI_ObjectGetLob(*this,name.c_str())), GetHandle());
2806 }
2807 
2808 template<>
2809 inline File Object::Get<File>(const ostring& name) const
2810 {
2811  return File(Check(OCI_ObjectGetFile(*this,name.c_str())), GetHandle());
2812 }
2813 
2814 template<>
2815 inline Raw Object::Get<Raw>(const ostring& name) const
2816 {
2817  unsigned int size = Check(OCI_ObjectGetRawSize(*this, name.c_str()));
2818 
2819  ManagedBuffer<unsigned char> buffer(size + 1);
2820 
2821  size = Check(OCI_ObjectGetRaw(*this, name.c_str(), static_cast<AnyPointer>(buffer), size));
2822 
2823  return MakeRaw(buffer, size);
2824 }
2825 
2826 template<class TDataType>
2827 inline TDataType Object::Get(const ostring& name) const
2828 {
2829  return TDataType(Check(OCI_ObjectGetColl(*this, name.c_str())), GetHandle());
2830 }
2831 
2832 template<>
2833 inline void Object::Set<short>(const ostring& name, const short &value)
2834 {
2835  Check(OCI_ObjectSetShort(*this, name.c_str(), value));
2836 }
2837 
2838 template<>
2839 inline void Object::Set<unsigned short>(const ostring& name, const unsigned short &value)
2840 {
2841  Check(OCI_ObjectSetUnsignedShort(*this, name.c_str(), value));
2842 }
2843 
2844 template<>
2845 inline void Object::Set<int>(const ostring& name, const int &value)
2846 {
2847  Check(OCI_ObjectSetInt(*this, name.c_str(), value));
2848 }
2849 
2850 template<>
2851 inline void Object::Set<unsigned int>(const ostring& name, const unsigned int &value)
2852 {
2853  Check(OCI_ObjectSetUnsignedInt(*this, name.c_str(), value));
2854 }
2855 
2856 template<>
2857 inline void Object::Set<big_int>(const ostring& name, const big_int &value)
2858 {
2859  Check(OCI_ObjectSetBigInt(*this, name.c_str(), value));
2860 }
2861 
2862 template<>
2863 inline void Object::Set<big_uint>(const ostring& name, const big_uint &value)
2864 {
2865  Check(OCI_ObjectSetUnsignedBigInt(*this, name.c_str(), value));
2866 }
2867 
2868 template<>
2869 inline void Object::Set<float>(const ostring& name, const float &value)
2870 {
2871  Check(OCI_ObjectSetFloat(*this, name.c_str(), value));
2872 }
2873 
2874 template<>
2875 inline void Object::Set<double>(const ostring& name, const double &value)
2876 {
2877  Check(OCI_ObjectSetDouble(*this, name.c_str(), value));
2878 }
2879 
2880 template<>
2881 inline void Object::Set<ostring>(const ostring& name, const ostring &value)
2882 {
2883  Check(OCI_ObjectSetString(*this, name.c_str(), value.c_str()));
2884 }
2885 
2886 template<>
2887 inline void Object::Set<Date>(const ostring& name, const Date &value)
2888 {
2889  Check(OCI_ObjectSetDate(*this, name.c_str(), value));
2890 }
2891 
2892 template<>
2893 inline void Object::Set<Timestamp>(const ostring& name, const Timestamp &value)
2894 {
2895  Check(OCI_ObjectSetTimestamp(*this, name.c_str(), value));
2896 }
2897 
2898 template<>
2899 inline void Object::Set<Interval>(const ostring& name, const Interval &value)
2900 {
2901  Check(OCI_ObjectSetInterval(*this, name.c_str(), value));
2902 }
2903 
2904 template<>
2905 inline void Object::Set<Object>(const ostring& name, const Object &value)
2906 {
2907  Check(OCI_ObjectSetObject(*this, name.c_str(), value));
2908 }
2909 
2910 template<>
2911 inline void Object::Set<Reference>(const ostring& name, const Reference &value)
2912 {
2913  Check(OCI_ObjectSetRef(*this, name.c_str(), value));
2914 }
2915 
2916 template<>
2917 inline void Object::Set<Clob>(const ostring& name, const Clob &value)
2918 {
2919  Check(OCI_ObjectSetLob(*this, name.c_str(), value));
2920 }
2921 
2922 template<>
2923 inline void Object::Set<NClob>(const ostring& name, const NClob &value)
2924 {
2925  Check(OCI_ObjectSetLob(*this, name.c_str(), value));
2926 }
2927 
2928 template<>
2929 inline void Object::Set<Blob>(const ostring& name, const Blob &value)
2930 {
2931  Check(OCI_ObjectSetLob(*this, name.c_str(), value));
2932 }
2933 
2934 template<>
2935 inline void Object::Set<File>(const ostring& name, const File &value)
2936 {
2937  Check(OCI_ObjectSetFile(*this, name.c_str(), value));
2938 }
2939 
2940 template<>
2941 inline void Object::Set<Raw>(const ostring& name, const Raw &value)
2942 {
2943  Check(OCI_ObjectSetRaw(*this, name.c_str(), static_cast<AnyPointer>(const_cast<Raw::value_type *>(value.data())), static_cast<unsigned int>(value.size())));
2944 }
2945 
2946 template<class TDataType>
2947 inline void Object::Set(const ostring& name, const TDataType &value)
2948 {
2949  Check(OCI_ObjectSetColl(*this, name.c_str(), value));
2950 }
2951 
2953 {
2954  unsigned int len = 0;
2955 
2956  Check(OCI_ObjectToText(*this, &len, 0));
2957 
2958  ManagedBuffer<otext> buffer(len + 1);
2959 
2960  Check(OCI_ObjectToText(*this, &len, buffer));
2961 
2962  return MakeString(static_cast<const otext *>(buffer));
2963 }
2964 
2965 inline Object::operator ostring() const
2966 {
2967  return ToString();
2968 }
2969 
2970 /* --------------------------------------------------------------------------------------------- *
2971  * Reference
2972  * --------------------------------------------------------------------------------------------- */
2973 
2974 inline Reference::Reference(const TypeInfo &typeInfo)
2975 {
2976  Connection connection = typeInfo.GetConnection();
2977  Acquire(Check(OCI_RefCreate(connection, typeInfo)), reinterpret_cast<HandleFreeFunc>(OCI_RefFree), connection.GetHandle());
2978 }
2979 
2980 inline Reference::Reference(OCI_Ref *pRef, Handle *parent)
2981 {
2982  Acquire(pRef, 0, parent);
2983 }
2984 
2986 {
2987  return TypeInfo(Check(OCI_RefGetTypeInfo(*this)));
2988 }
2989 
2991 {
2992  return Object(Check(OCI_RefGetObject(*this)), GetHandle());
2993 }
2994 
2996 {
2997  Reference result(GetTypeInfo());
2998 
2999  Check(OCI_RefAssign(result, *this));
3000 
3001  return result;
3002 }
3003 
3004 inline bool Reference::IsReferenceNull() const
3005 {
3006  return (Check(OCI_RefIsNull(*this)) == TRUE);
3007 }
3008 
3010 {
3011  Check(OCI_RefSetNull(*this));
3012 }
3013 
3015 {
3016  unsigned int size = Check(OCI_RefGetHexSize(*this));
3017 
3018  ManagedBuffer<otext> buffer(size + 1);
3019 
3020  Check(OCI_RefToText(*this, size, buffer));
3021 
3022  return MakeString(static_cast<const otext *>(buffer));
3023 }
3024 
3025 inline Reference::operator ostring() const
3026 {
3027  return ToString();
3028 }
3029 
3030 /* --------------------------------------------------------------------------------------------- *
3031  * Collection
3032  * --------------------------------------------------------------------------------------------- */
3033 
3034 template<class TDataType>
3036 {
3037  Acquire(Check(OCI_CollCreate(typeInfo)), reinterpret_cast<HandleFreeFunc>(OCI_CollFree), typeInfo.GetConnection().GetHandle());
3038 }
3039 
3040 template<class TDataType>
3041 inline Collection<TDataType>::Collection(OCI_Coll *pColl, Handle *parent)
3042 {
3043  Acquire(pColl, 0, parent);
3044 }
3045 
3046 template<class TDataType>
3048 {
3049  Collection<TDataType> result(GetTypeInfo());
3050 
3051  Check(OCI_CollAssign(result, *this));
3052 
3053  return result;
3054 }
3055 
3056 template<class TDataType>
3058 {
3059  return TypeInfo(Check(OCI_CollGetTypeInfo(*this)));
3060 }
3061 
3062 template<class TDataType>
3064 {
3065  return Collection<TDataType>::CollectionType(static_cast<typename Collection<TDataType>::CollectionType::type>(Check(OCI_CollGetType(*this))));
3066 }
3067 
3068 template<class TDataType>
3069 inline unsigned int Collection<TDataType>::GetMax() const
3070 {
3071  return Check(OCI_CollGetMax(*this));
3072 }
3073 
3074 template<class TDataType>
3075 inline unsigned int Collection<TDataType>::GetSize() const
3076 
3077 {
3078  return Check(OCI_CollGetSize(*this));
3079 }
3080 
3081 template<class TDataType>
3082 inline unsigned int Collection<TDataType>::GetCount() const
3083 
3084 {
3085  return Check(OCI_CollGetCount(*this));
3086 }
3087 
3088 template<class TDataType>
3089 inline void Collection<TDataType>::Truncate(unsigned int size)
3090 {
3091  Check(OCI_CollTrim(*this, size));
3092 }
3093 
3094 template<class TDataType>
3096 {
3097  Check(OCI_CollClear(*this));
3098 }
3099 
3100 template<class TDataType>
3101 inline bool Collection<TDataType>::IsElementNull(unsigned int index) const
3102 {
3103  return (Check(OCI_ElemIsNull(Check(OCI_CollGetElem(*this, index)))) == TRUE);
3104 }
3105 
3106 template<class TDataType>
3107 inline void Collection<TDataType>::SetElementNull(unsigned int index)
3108 {
3109  Check(OCI_ElemSetNull(Check(OCI_CollGetElem(*this, index))));
3110 }
3111 
3112 template<class TDataType>
3113 inline bool Collection<TDataType>::Delete(unsigned int index) const
3114 {
3115  return (Check(OCI_CollDeleteElem(*this, index)) == TRUE);
3116 }
3117 
3118 
3119 template <class TDataType>
3121 {
3122  return Iterator(*this, 1);
3123 }
3124 
3125 template <class TDataType>
3127 {
3128  return Iterator(*this, GetCount() + 1);
3129 }
3130 
3131 template <class TDataType>
3132 inline TDataType Collection<TDataType>::Get(unsigned int index) const
3133 {
3134  return GetElem(Check(OCI_CollGetElem(*this, index)), GetHandle());
3135 }
3136 
3137 template <class TDataType>
3138 inline void Collection<TDataType>::Set(unsigned int index, const TDataType &data)
3139 {
3140  OCI_Elem * elem = Check(OCI_CollGetElem(*this, index));
3141 
3142  SetElem(elem, data);
3143 
3144  Check(OCI_CollSetElem(*this, index, elem));
3145 }
3146 
3147 template <class TDataType>
3148 inline void Collection<TDataType>::Append(const TDataType &value)
3149 {
3151 
3152  SetElem(elem, value);
3153 
3154  Check(OCI_CollAppend(*this, elem));
3155  Check(OCI_ElemFree(elem));
3156 }
3157 
3158 template <>
3159 inline short Collection<short>::GetElem(OCI_Elem *elem, Handle *parent) const
3160 {
3161  ARG_NOT_USED(parent);
3162 
3163  return Check(OCI_ElemGetShort(elem));
3164 }
3165 
3166 template<>
3167 inline unsigned short Collection<unsigned short>::GetElem(OCI_Elem *elem, Handle *parent) const
3168 {
3169  ARG_NOT_USED(parent);
3170 
3171  return Check(OCI_ElemGetUnsignedShort(elem));
3172 }
3173 
3174 template<>
3175 inline int Collection<int>::GetElem(OCI_Elem *elem, Handle *parent) const
3176 {
3177  ARG_NOT_USED(parent);
3178 
3179  return Check(OCI_ElemGetInt(elem));
3180 }
3181 
3182 template<>
3183 inline unsigned int Collection<unsigned int>::GetElem(OCI_Elem *elem, Handle *parent) const
3184 {
3185  ARG_NOT_USED(parent);
3186 
3187  return Check(OCI_ElemGetUnsignedInt(elem));
3188 }
3189 
3190 template<>
3191 inline big_int Collection<big_int>::GetElem(OCI_Elem *elem, Handle *parent) const
3192 {
3193  ARG_NOT_USED(parent);
3194 
3195  return Check(OCI_ElemGetBigInt(elem));
3196 }
3197 
3198 template<>
3199 inline big_uint Collection<big_uint>::GetElem(OCI_Elem *elem, Handle *parent) const
3200 {
3201  ARG_NOT_USED(parent);
3202 
3203  return Check(OCI_ElemGetUnsignedBigInt(elem));
3204 }
3205 
3206 template<>
3207 inline float Collection<float>::GetElem(OCI_Elem *elem, Handle *parent) const
3208 {
3209  ARG_NOT_USED(parent);
3210 
3211  return Check(OCI_ElemGetFloat(elem));
3212 }
3213 
3214 template<>
3215 inline double Collection<double>::GetElem(OCI_Elem *elem, Handle *parent) const
3216 {
3217  ARG_NOT_USED(parent);
3218 
3219  return Check(OCI_ElemGetDouble(elem));
3220 }
3221 
3222 template<>
3223 inline ostring Collection<ostring>::GetElem(OCI_Elem *elem, Handle *parent) const
3224 {
3225  ARG_NOT_USED(parent);
3226 
3227  return MakeString(Check(OCI_ElemGetString(elem)));
3228 }
3229 
3230 template<>
3231 inline Raw Collection<Raw>::GetElem(OCI_Elem *elem, Handle *parent) const
3232 {
3233  ARG_NOT_USED(parent);
3234 
3235  unsigned int size = Check(OCI_ElemGetRawSize(elem));
3236 
3237  ManagedBuffer<unsigned char> buffer(size + 1);
3238 
3239  size = Check(OCI_ElemGetRaw(elem, static_cast<AnyPointer>(buffer), size));
3240 
3241  return MakeRaw(buffer, size);
3242 }
3243 
3244 template<>
3245 inline Date Collection<Date>::GetElem(OCI_Elem *elem, Handle *parent) const
3246 {
3247  return Date(Check(OCI_ElemGetDate(elem)), parent);
3248 }
3249 
3250 template<>
3251 inline Timestamp Collection<Timestamp>::GetElem(OCI_Elem *elem, Handle *parent) const
3252 {
3253  return Timestamp(Check(OCI_ElemGetTimestamp(elem)), parent);
3254 }
3255 
3256 template<>
3257 inline Interval Collection<Interval>::GetElem(OCI_Elem *elem, Handle *parent) const
3258 {
3259  return Interval(Check(OCI_ElemGetInterval(elem)), parent);
3260 }
3261 
3262 template<>
3263 inline Object Collection<Object>::GetElem(OCI_Elem *elem, Handle *parent) const
3264 {
3265  return Object(Check(OCI_ElemGetObject(elem)), parent);
3266 }
3267 
3268 template<>
3269 inline Reference Collection<Reference>::GetElem(OCI_Elem *elem, Handle *parent) const
3270 {
3271  return Reference(Check(OCI_ElemGetRef(elem)), parent);
3272 }
3273 
3274 template<>
3275 inline Clob Collection<Clob>::GetElem(OCI_Elem *elem, Handle *parent) const
3276 {
3277  return Clob(Check(OCI_ElemGetLob(elem)), parent);
3278 }
3279 
3280 template<>
3281 inline NClob Collection<NClob>::GetElem(OCI_Elem *elem, Handle *parent) const
3282 {
3283  return NClob(Check(OCI_ElemGetLob(elem)), parent);
3284 }
3285 template<>
3286 inline Blob Collection<Blob>::GetElem(OCI_Elem *elem, Handle *parent) const
3287 {
3288  return Blob(Check(OCI_ElemGetLob(elem)), parent);
3289 }
3290 
3291 template<>
3292 inline File Collection<File>::GetElem(OCI_Elem *elem, Handle *parent) const
3293 {
3294  return File(Check(OCI_ElemGetFile(elem)), parent);
3295 }
3296 
3297 template<class TDataType>
3298 inline TDataType Collection<TDataType>::GetElem(OCI_Elem *elem, Handle *parent) const
3299 {
3300  return TDataType(Check(OCI_ElemGetColl(elem)), parent);
3301 }
3302 
3303 template<>
3304 inline void Collection<short>::SetElem(OCI_Elem *elem, const short &value)
3305 {
3306  Check(OCI_ElemSetShort(elem, value));
3307 }
3308 
3309 template<>
3310 inline void Collection<unsigned short>::SetElem(OCI_Elem *elem, const unsigned short &value)
3311 {
3312  Check(OCI_ElemSetUnsignedShort(elem, value));
3313 }
3314 
3315 template<>
3316 inline void Collection<int>::SetElem(OCI_Elem *elem, const int &value)
3317 {
3318  Check(OCI_ElemSetInt(elem, value));
3319 }
3320 
3321 template<>
3322 inline void Collection<unsigned int>::SetElem(OCI_Elem *elem, const unsigned int &value)
3323 {
3324  Check(OCI_ElemSetUnsignedInt(elem, value));
3325 }
3326 
3327 template<>
3328 inline void Collection<big_int>::SetElem(OCI_Elem *elem, const big_int &value)
3329 {
3330  Check(OCI_ElemSetBigInt(elem, value));
3331 }
3332 
3333 template<>
3334 inline void Collection<big_uint>::SetElem(OCI_Elem *elem, const big_uint &value)
3335 {
3336  Check(OCI_ElemSetUnsignedBigInt(elem, value));
3337 }
3338 
3339 template<>
3340 inline void Collection<float>::SetElem(OCI_Elem *elem, const float &value)
3341 {
3342  Check(OCI_ElemSetFloat(elem, value));
3343 }
3344 
3345 template<>
3346 inline void Collection<double>::SetElem(OCI_Elem *elem, const double &value)
3347 {
3348  Check(OCI_ElemSetDouble(elem, value));
3349 }
3350 
3351 template <>
3352 inline void Collection<ostring>::SetElem(OCI_Elem *elem, const ostring& value)
3353 {
3354  Check(OCI_ElemSetString(elem, value.c_str()));
3355 }
3356 
3357 template<>
3358 inline void Collection<Raw>::SetElem(OCI_Elem *elem, const Raw &value)
3359 {
3360  Check(OCI_ElemSetRaw(elem, static_cast<AnyPointer>(const_cast<Raw::value_type *>(value.data())), static_cast<unsigned int>(value.size())));
3361 }
3362 
3363 template<>
3364 inline void Collection<Date>::SetElem(OCI_Elem *elem, const Date &value)
3365 {
3366  Check(OCI_ElemSetDate(elem, value));
3367 }
3368 
3369 template<>
3370 inline void Collection<Timestamp>::SetElem(OCI_Elem *elem, const Timestamp &value)
3371 {
3372  Check(OCI_ElemSetTimestamp(elem, value));
3373 }
3374 
3375 template<>
3376 inline void Collection<Interval>::SetElem(OCI_Elem *elem, const Interval &value)
3377 {
3378  Check(OCI_ElemSetInterval(elem, value));
3379 }
3380 
3381 template<>
3382 inline void Collection<Object>::SetElem(OCI_Elem *elem, const Object &value)
3383 {
3384  Check(OCI_ElemSetObject(elem, value));
3385 }
3386 
3387 template<>
3388 inline void Collection<Reference>::SetElem(OCI_Elem *elem, const Reference &value)
3389 {
3390  Check(OCI_ElemSetRef(elem, value));
3391 }
3392 
3393 template<>
3394 inline void Collection<Clob>::SetElem(OCI_Elem *elem, const Clob &value)
3395 {
3396  Check(OCI_ElemSetLob(elem, value));
3397 }
3398 
3399 template<>
3400 inline void Collection<NClob>::SetElem(OCI_Elem *elem, const NClob &value)
3401 {
3402  Check(OCI_ElemSetLob(elem, value));
3403 }
3404 
3405 template<>
3406 inline void Collection<Blob>::SetElem(OCI_Elem *elem, const Blob &value)
3407 {
3408  Check(OCI_ElemSetLob(elem, value));
3409 }
3410 
3411 template<>
3412 inline void Collection<File>::SetElem(OCI_Elem *elem, const File &value)
3413 {
3414  Check(OCI_ElemSetFile(elem, value));
3415 }
3416 
3417 template <class TDataType>
3418 inline void Collection<TDataType>::SetElem(OCI_Elem *elem, const TDataType &value)
3419 {
3420  Check(OCI_ElemSetColl(elem, value));
3421 }
3422 
3423 template<class TDataType>
3425 {
3426  unsigned int len = 0;
3427 
3428  Check(OCI_CollToText(*this, &len, 0));
3429 
3430  ManagedBuffer<otext> buffer(len + 1);
3431 
3432  Check(OCI_CollToText(*this, &len, buffer));
3433 
3434  return MakeString(static_cast<const otext *>(buffer));
3435 }
3436 
3437 template<class TDataType>
3439 {
3440  return ToString();
3441 }
3442 
3443 template<class TDataType>
3445 {
3446  return Element(*this, index);
3447 }
3448 
3449 template<class TDataType>
3450 inline Collection<TDataType>::Iterator::Iterator(Collection &coll, unsigned int pos) : _elem(coll, pos)
3451 {
3452 }
3453 
3454 template<class TDataType>
3455 inline Collection<TDataType>::Iterator::Iterator(const Iterator& other) : _elem(other._elem)
3456 {
3457 }
3458 
3459 template<class TDataType>
3460 inline bool Collection<TDataType>::Iterator::operator== (const Iterator& other)
3461 {
3462  return _elem._pos == other._elem._pos && ((OCI_Coll *)(_elem._coll)) == ((OCI_Coll *)(other._elem._coll));
3463 
3464 }
3465 
3466 template<class TDataType>
3467 inline bool Collection<TDataType>::Iterator::operator!= (const Iterator& other)
3468 {
3469  return !(*this == other);
3470 }
3471 
3472 template<class TDataType>
3473 inline typename Collection<TDataType>::Element& Collection<TDataType>::Iterator::operator*()
3474 {
3475  return _elem;
3476 }
3477 
3478 template<class TDataType>
3479 inline typename Collection<TDataType>::Iterator & Collection<TDataType>::Iterator::operator--()
3480 {
3481  _elem._pos--;
3482  return (*this);
3483 }
3484 
3485 template<class TDataType>
3486 inline typename Collection<TDataType>::Iterator Collection<TDataType>::Iterator::operator--(int)
3487 {
3488  Iterator old(*this);
3489  --(*this);
3490  return old;
3491 }
3492 
3493 template<class TDataType>
3494 inline typename Collection<TDataType>::Iterator & Collection<TDataType>::Iterator::operator++()
3495 {
3496  _elem._pos++;
3497  return (*this);
3498 }
3499 
3500 template<class TDataType>
3501 inline typename Collection<TDataType>::Iterator Collection<TDataType>::Iterator::operator++(int)
3502 {
3503  Iterator old(*this);
3504  ++(*this);
3505  return old;
3506 }
3507 
3508 template<class TDataType>
3509 inline Collection<TDataType>::Element::Element(Collection &coll, unsigned int pos) : _coll(coll), _pos(pos)
3510 {
3511 
3512 }
3513 
3514 template<class TDataType>
3515 inline Collection<TDataType>::Element::operator TDataType() const
3516 {
3517  return _coll.Get(_pos);
3518 }
3519 
3520 template<class TDataType>
3521 inline typename Collection<TDataType>::Element& Collection<TDataType>::Element::operator = (TDataType value)
3522 {
3523  _coll.Set(_pos, value);
3524  return *this;
3525 }
3526 
3527 template<class TDataType>
3528 inline bool Collection<TDataType>::Element::IsNull() const
3529 {
3530  return _coll->IsElementNull(_pos);
3531 }
3532 
3533 template<class TDataType>
3534 inline void Collection<TDataType>::Element::SetNull()
3535 {
3536  _coll->SetElementNull(_pos);
3537 }
3538 
3539 /* --------------------------------------------------------------------------------------------- *
3540  * Long
3541  * --------------------------------------------------------------------------------------------- */
3542 
3543 template<class TLongObjectType, int TLongOracleType>
3545 {
3546  Acquire(Check(OCI_LongCreate(statement, TLongOracleType)), reinterpret_cast<HandleFreeFunc>(OCI_LongFree), statement.GetHandle());
3547 }
3548 
3549 template<class TLongObjectType, int TLongOracleType>
3550 inline Long<TLongObjectType, TLongOracleType>::Long(OCI_Long *pLong, Handle* parent)
3551 {
3552  Acquire(pLong, 0, parent);
3553 }
3554 
3555 template<class TLongObjectType, int TLongOracleType>
3556 inline unsigned int Long<TLongObjectType, TLongOracleType>::Write(const TLongObjectType& content)
3557 {
3558  return Check(OCI_LongWrite(*this, static_cast<AnyPointer>(const_cast<typename TLongObjectType::value_type *>(content.data())), static_cast<unsigned int>(content.size())));
3559 }
3560 
3561 template<class TLongObjectType, int TLongOracleType>
3563 {
3564  return Check(OCI_LongGetSize(*this));
3565 }
3566 
3567 template<>
3569 {
3570  return MakeString(static_cast<const otext *>(Check(OCI_LongGetBuffer(*this))));
3571 }
3572 
3573 template<>
3575 {
3576  return MakeRaw(Check(OCI_LongGetBuffer(*this)), GetLength());
3577 }
3578 
3579 
3590 
3601 
3602 
3603 /* --------------------------------------------------------------------------------------------- *
3604  * BindValue
3605  * --------------------------------------------------------------------------------------------- */
3606 
3607 template<class TValueType>
3608 inline BindValue<TValueType>::BindValue() : _value(0)
3609 {
3610 
3611 }
3612 
3613 template<class TValueType>
3614 inline BindValue<TValueType>::BindValue(TValueType value) : _value(value)
3615 {
3616 
3617 }
3618 
3619 template<class TValueType>
3620 inline BindValue<TValueType>::operator TValueType() const
3621 {
3622  return _value;
3623 }
3624 
3625 /* --------------------------------------------------------------------------------------------- *
3626 * BindObject
3627 * --------------------------------------------------------------------------------------------- */
3628 
3629 inline BindObject::BindObject(const Statement &statement, const ostring& name) : _name(name), _pStatement(statement)
3630 {
3631 }
3632 
3633 inline BindObject::~BindObject()
3634 {
3635 }
3636 
3637 inline ostring BindObject::GetName() const
3638 {
3639  return _name;
3640 }
3641 
3642 inline Statement BindObject::GetStatement() const
3643 {
3644  return Statement(_pStatement);
3645 }
3646 
3647 /* --------------------------------------------------------------------------------------------- *
3648  * BindArray
3649  * --------------------------------------------------------------------------------------------- */
3650 
3651 inline BindArray::BindArray(const Statement &statement, const ostring& name) : BindObject(statement, name), _object(0)
3652 {
3653 
3654 }
3655 
3656 template <class TObjectType, class TDataType>
3657 inline void BindArray::SetVector(std::vector<TObjectType> & vector, unsigned int mode, unsigned int elemSize)
3658 {
3659  _object = new BindArrayObject<TObjectType, TDataType>(GetStatement(), GetName(), vector, mode, elemSize);
3660 }
3661 
3662 inline BindArray::~BindArray()
3663 {
3664  delete _object;
3665 }
3666 
3667 template <class TObjectType, class TDataType>
3668 inline TDataType * BindArray::GetData () const
3669 {
3670  return static_cast<TDataType *>(*(dynamic_cast< BindArrayObject<TObjectType, TDataType> * > (_object)));
3671 }
3672 
3673 inline void BindArray::SetInData()
3674 {
3675  _object->SetInData();
3676 }
3677 
3678 inline void BindArray::SetOutData()
3679 {
3680  _object->SetOutData();
3681 }
3682 
3683 template <class TObjectType, class TDataType>
3684 inline BindArray::BindArrayObject<TObjectType, TDataType>::BindArrayObject(const Statement &statement, const ostring& name, std::vector<TObjectType> &vector, unsigned int mode, unsigned int elemSize)
3685  : _pStatement(statement), _name(name), _vector(vector), _data(0), _mode(mode), _elemCount(statement.GetBindArraySize()), _elemSize(elemSize)
3686 {
3687  AllocData();
3688 }
3689 
3690 template <class TObjectType, class TDataType>
3691 inline BindArray::BindArrayObject<TObjectType, TDataType>::~BindArrayObject()
3692 {
3693  FreeData();
3694 }
3695 
3696 template <class TObjectType, class TDataType>
3697 inline void BindArray::BindArrayObject<TObjectType, TDataType>::AllocData()
3698 {
3699  _data = new TDataType[_elemCount];
3700 }
3701 
3702 template<>
3703 inline void BindArray::BindArrayObject<ostring, otext>::AllocData()
3704 {
3705  _data = new otext[_elemSize * _elemCount];
3706 
3707  memset(_data, 0, _elemSize * _elemCount * sizeof(otext));
3708 }
3709 
3710 template <class TObjectType, class TDataType>
3711 inline void BindArray::BindArrayObject<TObjectType, TDataType>::FreeData()
3712 {
3713  delete [] _data ;
3714 }
3715 
3716 template <class TObjectType, class TDataType>
3717 inline void BindArray::BindArrayObject<TObjectType, TDataType>::SetInData()
3718 {
3719  if (_mode & OCI_BDM_IN)
3720  {
3721  typename std::vector<TObjectType>::iterator it, it_end;
3722 
3723  unsigned int index = 0;
3724  unsigned int currElemCount = Check(OCI_BindArrayGetSize(_pStatement));
3725 
3726  for (it = _vector.begin(), it_end = _vector.end(); it != it_end && index < _elemCount && index < currElemCount; it++, index++)
3727  {
3728  _data[index] = BindValue<TDataType>( *it);
3729  }
3730  }
3731 }
3732 
3733 template<>
3734 inline void BindArray::BindArrayObject<ostring, otext>::SetInData()
3735 {
3736  if (_mode & OCI_BDM_IN)
3737  {
3738  std::vector<ostring>::iterator it, it_end;
3739 
3740  unsigned int index = 0;
3741  unsigned int currElemCount = Check(OCI_BindArrayGetSize(_pStatement));
3742 
3743  for (it = _vector.begin(), it_end = _vector.end(); it != it_end && index < _elemCount && index < currElemCount; it++, index++)
3744  {
3745  const ostring & value = *it;
3746 
3747  memcpy( _data + (_elemSize * index), value.c_str(), (value.size() + 1) * sizeof(otext));
3748  }
3749  }
3750 }
3751 
3752 
3753 template<>
3754 inline void BindArray::BindArrayObject<Raw, unsigned char>::SetInData()
3755 {
3756  if (_mode & OCI_BDM_IN)
3757  {
3758  std::vector<Raw>::iterator it, it_end;
3759 
3760  unsigned int index = 0;
3761  unsigned int currElemCount = Check(OCI_BindArrayGetSize(_pStatement));
3762 
3763  for (it = _vector.begin(), it_end = _vector.end(); it != it_end && index < _elemCount && index < currElemCount; it++, index++)
3764  {
3765  Raw & value = *it;
3766 
3767  memcpy(_data + (_elemSize * index), value.data(), (value.size() + 1) * sizeof(otext));
3768  }
3769  }
3770 }
3771 
3772 template <class TObjectType, class TDataType>
3773 inline void BindArray::BindArrayObject<TObjectType, TDataType>::SetOutData()
3774 {
3775  if (_mode & OCI_BDM_OUT)
3776  {
3777  typename std::vector<TObjectType>::iterator it, it_end;
3778 
3779  unsigned int index = 0;
3780  unsigned int currElemCount = Check(OCI_BindArrayGetSize(_pStatement));
3781 
3782  for (it = _vector.begin(), it_end = _vector.end(); it != it_end && index < _elemCount && index < currElemCount; it++, index++)
3783  {
3784  TObjectType& object = *it;
3785 
3786  object = static_cast<TDataType>(_data[index]);
3787  }
3788  }
3789 }
3790 
3791 template<>
3792 inline void BindArray::BindArrayObject<Raw, unsigned char>::SetOutData()
3793 {
3794  if (_mode & OCI_BDM_OUT)
3795  {
3796  std::vector<Raw>::iterator it, it_end;
3797 
3798  OCI_Bind *pBind = Check(OCI_GetBind2(_pStatement, GetName().c_str()));
3799 
3800  unsigned int index = 0;
3801  unsigned int currElemCount = Check(OCI_BindArrayGetSize(_pStatement));
3802 
3803  for (it = _vector.begin(), it_end = _vector.end(); it != it_end && index < _elemCount && index < currElemCount; it++, index++)
3804  {
3805  unsigned char *currData = _data + (_elemSize * index);
3806 
3807  (*it).assign(currData, currData + Check(OCI_BindGetDataSizeAtPos(pBind, index + 1)));
3808  }
3809  }
3810 }
3811 
3812 
3813 template <class TObjectType, class TDataType>
3814 inline ostring BindArray::BindArrayObject<TObjectType, TDataType>::GetName()
3815 {
3816  return _name;
3817 }
3818 
3819 template <class TObjectType, class TDataType>
3820 inline BindArray::BindArrayObject<TObjectType, TDataType>:: operator std::vector<TObjectType> & () const
3821 {
3822  return _vector;
3823 }
3824 
3825 template <class TObjectType, class TDataType>
3826 inline BindArray::BindArrayObject<TObjectType, TDataType>:: operator TDataType * () const
3827 {
3828  return _data;
3829 }
3830 
3831 /* --------------------------------------------------------------------------------------------- *
3832  * BindAdaptor
3833  * --------------------------------------------------------------------------------------------- */
3834 
3835 template <class TNativeType, class TObjectType>
3836 inline void BindAdaptor<TNativeType, TObjectType>::SetInData()
3837 {
3838  size_t size = _object.size();
3839 
3840  if (size > _size)
3841  {
3842  size = _size;
3843  }
3844 
3845  memcpy(_data, _object.data(), size * sizeof(TNativeType));
3846 
3847  _data[size] = 0;
3848 }
3849 
3850 template <class TNativeType, class TObjectType>
3851 inline void BindAdaptor<TNativeType, TObjectType>::SetOutData()
3852 {
3853  _object.assign(_data, _data + _size);
3854 }
3855 
3856 template <class TNativeType, class TObjectType>
3857 inline BindAdaptor<TNativeType, TObjectType>::BindAdaptor(const Statement &statement, const ostring& name, TObjectType &object, unsigned int size) :
3858  BindObject(statement, name),
3859  _object(object),
3860  _data(new TNativeType[_size]),
3861  _size(size)
3862 {
3863  memset(_data, 0, _size * sizeof(TNativeType));
3864 }
3865 
3866 template <class TNativeType, class TObjectType>
3867 inline BindAdaptor<TNativeType, TObjectType>::~BindAdaptor()
3868 {
3869  delete [] _data;
3870 }
3871 
3872 template <class TNativeType, class TObjectType>
3873 inline BindAdaptor<TNativeType, TObjectType>::operator TNativeType *() const
3874 {
3875  return _data;
3876 }
3877 
3878 /* --------------------------------------------------------------------------------------------- *
3879  * BindsHolder
3880  * --------------------------------------------------------------------------------------------- */
3881 
3882 inline BindsHolder::BindsHolder(const Statement &statement) : _bindObjects(), _pStatement(statement)
3883 {
3884 
3885 }
3886 
3887 inline BindsHolder::~BindsHolder()
3888 {
3889  Clear();
3890 }
3891 
3892 inline void BindsHolder::Clear()
3893 {
3894  std::vector<BindObject *>::iterator it, it_end;
3895 
3896  for(it = _bindObjects.begin(), it_end = _bindObjects.end(); it != it_end; it++)
3897  {
3898  delete (*it);
3899  }
3900 }
3901 
3902 inline void BindsHolder::AddBindObject(BindObject *bindObject)
3903 {
3904  if (Check(OCI_IsRebindingAllowed(_pStatement)))
3905  {
3906  std::vector<BindObject *>::iterator it, it_end;
3907 
3908  for(it = _bindObjects.begin(), it_end = _bindObjects.end(); it != it_end; it++)
3909  {
3910  if ((*it)->GetName() == bindObject->GetName())
3911  {
3912  _bindObjects.erase(it);
3913  break;
3914  }
3915  }
3916  }
3917 
3918  _bindObjects.push_back(bindObject);
3919 }
3920 
3921 inline void BindsHolder::SetOutData()
3922 {
3923  std::vector<BindObject *>::iterator it, it_end;
3924 
3925  for(it = _bindObjects.begin(), it_end = _bindObjects.end(); it != it_end; it++)
3926  {
3927  (*it)->SetOutData();
3928  }
3929 }
3930 
3931 inline void BindsHolder::SetInData()
3932 {
3933  std::vector<BindObject *>::iterator it, it_end;
3934 
3935  for(it = _bindObjects.begin(), it_end = _bindObjects.end(); it != it_end; it++)
3936  {
3937  (*it)->SetInData();
3938  }
3939 }
3940 
3941 /* --------------------------------------------------------------------------------------------- *
3942  * Bind
3943  * --------------------------------------------------------------------------------------------- */
3944 
3945 inline BindInfo::BindInfo(OCI_Bind *pBind, Handle *parent)
3946 {
3947  Acquire(pBind, 0, parent);
3948 }
3949 
3950 inline ostring BindInfo::GetName() const
3951 {
3952  return MakeString(Check(OCI_BindGetName(*this)));
3953 }
3954 
3955 inline DataType BindInfo::GetType() const
3956 {
3957  return DataType((DataType::type)Check(OCI_BindGetType(*this)));
3958 }
3959 
3960 inline unsigned int BindInfo::GetSubType() const
3961 {
3962  return Check(OCI_BindGetSubtype(*this));
3963 }
3964 
3965 inline unsigned int BindInfo::GetDataCount() const
3966 {
3967  return Check(OCI_BindGetDataCount(*this));
3968 }
3969 
3970 inline Statement BindInfo::GetStatement() const
3971 {
3972  return Statement(Check(OCI_BindGetStatement(*this)));
3973 }
3974 
3975 inline void BindInfo::SetDataNull(bool value, unsigned int index)
3976 {
3977  if (value)
3978  {
3979  Check(OCI_BindSetNullAtPos(*this, index));
3980  }
3981  else
3982  {
3983  Check(OCI_BindSetNotNullAtPos(*this, index));
3984  }
3985 }
3986 
3987 inline bool BindInfo::IsDataNull(unsigned int index) const
3988 {
3989  return (Check(OCI_BindIsNullAtPos(*this, index)) == TRUE);
3990 }
3991 
3992 inline void BindInfo::SetCharsetForm(CharsetForm value)
3993 {
3994  Check(OCI_BindSetCharsetForm(*this, value));
3995 }
3996 
3997 inline BindInfo::BindDirection BindInfo::GetDirection() const
3998 {
3999  return BindDirection(static_cast<BindDirection::type>(Check(OCI_BindGetDirection(*this))));
4000 }
4001 
4002 /* --------------------------------------------------------------------------------------------- *
4003  * Statement
4004  * --------------------------------------------------------------------------------------------- */
4005 
4006 inline Statement::Statement(const Connection &connection)
4007 {
4008  Acquire(Check(OCI_StatementCreate(connection)), reinterpret_cast<HandleFreeFunc>(OCI_StatementFree), connection.GetHandle());
4009 }
4010 
4011 inline Statement::Statement(OCI_Statement *stmt, Handle *parent)
4012 {
4013  Acquire(stmt, reinterpret_cast<HandleFreeFunc>(parent ? OCI_StatementFree : 0), parent);
4014 }
4015 
4016 inline Statement::~Statement()
4017 {
4018  if (_smartHandle && _smartHandle->IsLastHolder(this))
4019  {
4020  BindsHolder *bindsHolder = GetBindsHolder(false);
4021 
4022  delete bindsHolder;
4023  }
4024 }
4025 
4026 inline Connection Statement::GetConnection() const
4027 {
4028  return Connection(Check(OCI_StatementGetConnection(*this)), 0);
4029 }
4030 
4031 inline void Statement::Describe(const ostring& sql)
4032 {
4033  ClearBinds();
4034  ReleaseResultsets();
4035  Check(OCI_Describe(*this, sql.c_str()));
4036 }
4037 
4038 inline void Statement::Parse(const ostring& sql)
4039 {
4040  ClearBinds();
4041  ReleaseResultsets();
4042  Check(OCI_Parse(*this, sql.c_str()));
4043 }
4044 
4045 inline void Statement::Prepare(const ostring& sql)
4046 {
4047  ClearBinds();
4048  ReleaseResultsets();
4049  Check(OCI_Prepare(*this, sql.c_str()));
4050 }
4051 
4052 inline void Statement::Execute()
4053 {
4054  ReleaseResultsets();
4055  SetInData();
4056  Check(OCI_Execute(*this));
4057  SetOutData();
4058 }
4059 
4060 inline void Statement::Execute(const ostring& sql)
4061 {
4062  ClearBinds();
4063  ReleaseResultsets();
4064  Check(OCI_ExecuteStmt(*this, sql.c_str()));
4065 }
4066 
4067 inline unsigned int Statement::GetAffectedRows() const
4068 {
4069  return Check(OCI_GetAffectedRows(*this));
4070 }
4071 
4072 inline ostring Statement::GetSql() const
4073 {
4074  return MakeString(Check(OCI_GetSql(*this)));
4075 }
4076 
4077 inline Resultset Statement::GetResultset()
4078 {
4079  return Resultset(Check(OCI_GetResultset(*this)), GetHandle());
4080 }
4081 
4082 inline Resultset Statement::GetNextResultset()
4083 {
4084  return Resultset(Check(OCI_GetNextResultset(*this)), GetHandle());
4085 }
4086 
4087 inline void Statement::SetBindArraySize(unsigned int size)
4088 {
4089  Check(OCI_BindArraySetSize(*this, size));
4090 }
4091 
4092 inline unsigned int Statement::GetBindArraySize() const
4093 {
4094  return Check(OCI_BindArrayGetSize(*this));
4095 }
4096 
4097 inline void Statement::AllowRebinding(bool value)
4098 {
4099  Check(OCI_AllowRebinding(*this, value));
4100 }
4101 
4102 inline bool Statement::IsRebindingAllowed() const
4103 {
4104  return (Check(OCI_IsRebindingAllowed(*this)) == TRUE);
4105 }
4106 
4107 inline unsigned int Statement::GetBindIndex(const ostring& name) const
4108 {
4109  return Check(OCI_GetBindIndex(*this, name.c_str()));
4110 }
4111 
4112 inline unsigned int Statement::GetBindCount() const
4113 {
4114  return Check(OCI_GetBindCount(*this));
4115 }
4116 
4117 inline BindInfo Statement::GetBind(unsigned int index) const
4118 {
4119  return BindInfo(Check(OCI_GetBind(*this, index)), GetHandle());
4120 }
4121 
4122 inline BindInfo Statement::GetBind(const ostring& name) const
4123 {
4124  return BindInfo(Check(OCI_GetBind2(*this, name.c_str())), GetHandle());
4125 }
4126 
4127 template <typename TBindMethod, class TDataType>
4128 inline void Statement::Bind (TBindMethod &method, const ostring& name, TDataType& value, BindInfo::BindDirection mode)
4129 {
4130  Check(method(*this, name.c_str(), &value));
4131  SetLastBindMode(mode);
4132 }
4133 
4134 template <typename TBindMethod, class TObjectType, class TDataType>
4135 inline void Statement::Bind (TBindMethod &method, const ostring& name, TObjectType& value, BindValue<TDataType> datatype, BindInfo::BindDirection mode)
4136 {
4137  ARG_NOT_USED(datatype);
4138 
4139  Check(method(*this, name.c_str(), (TDataType) value));
4140  SetLastBindMode(mode);
4141 }
4142 
4143 template <typename TBindMethod, class TObjectType, class TDataType>
4144 inline void Statement::Bind (TBindMethod &method, const ostring& name, std::vector<TObjectType> &values, BindValue<TDataType> datatype, BindInfo::BindDirection mode)
4145 {
4146  ARG_NOT_USED(datatype);
4147 
4148  BindArray * bnd = new BindArray(*this, name);
4149  bnd->SetVector<TObjectType, TDataType>(values, mode, sizeof(TDataType));
4150 
4151  if (method(*this, name.c_str(), static_cast<TDataType *>(bnd->GetData<TObjectType, TDataType>()), 0))
4152  {
4153  BindsHolder *bindsHolder = GetBindsHolder(true);
4154  bindsHolder->AddBindObject(bnd);
4155  SetLastBindMode(mode);
4156  }
4157  else
4158  {
4159  delete bnd;
4160  }
4161 
4162  Check();
4163 }
4164 
4165 template <typename TBindMethod, class TObjectType, class TDataType, class TElemType>
4166 inline void Statement::Bind (TBindMethod &method, const ostring& name, std::vector<TObjectType> &values, BindValue<TDataType> datatype, BindInfo::BindDirection mode, TElemType type)
4167 {
4168  ARG_NOT_USED(datatype);
4169 
4170  BindArray * bnd = new BindArray(*this, name);
4171  bnd->SetVector<TObjectType, TDataType>(values, mode, sizeof(TDataType));
4172 
4173  if (method(*this, name.c_str(), static_cast<TDataType *>(bnd->GetData<TObjectType, TDataType>()), type, 0))
4174  {
4175  BindsHolder *bindsHolder = GetBindsHolder(true);
4176  bindsHolder->AddBindObject(bnd);
4177  SetLastBindMode(mode);
4178  }
4179  else
4180  {
4181  delete bnd;
4182  }
4183 
4184  Check();
4185 }
4186 
4187 template <>
4188 inline void Statement::Bind<short>(const ostring& name, short &value, BindInfo::BindDirection mode)
4189 {
4190  Bind(OCI_BindShort, name, value, mode);
4191 }
4192 
4193 template <>
4194 inline void Statement::Bind<unsigned short>(const ostring& name, unsigned short &value, BindInfo::BindDirection mode)
4195 {
4196  Bind(OCI_BindUnsignedShort, name, value, mode);
4197 }
4198 
4199 template <>
4200 inline void Statement::Bind<int>(const ostring& name, int &value, BindInfo::BindDirection mode)
4201 {
4202  Bind(OCI_BindInt, name, value, mode);
4203 }
4204 
4205 template <>
4206 inline void Statement::Bind<unsigned int>(const ostring& name, unsigned int &value, BindInfo::BindDirection mode)
4207 {
4208  Bind(OCI_BindUnsignedInt, name, value, mode);
4209 }
4210 
4211 template <>
4212 inline void Statement::Bind<big_int>(const ostring& name, big_int &value, BindInfo::BindDirection mode)
4213 {
4214  Bind(OCI_BindBigInt, name, value, mode);
4215 }
4216 
4217 template <>
4218 inline void Statement::Bind<big_uint>(const ostring& name, big_uint &value, BindInfo::BindDirection mode)
4219 {
4220  Bind(OCI_BindUnsignedBigInt, name, value, mode);
4221 }
4222 
4223 template <>
4224 inline void Statement::Bind<float>(const ostring& name, float &value, BindInfo::BindDirection mode)
4225 {
4226  Bind(OCI_BindFloat, name, value, mode);
4227 }
4228 
4229 template <>
4230 inline void Statement::Bind<double>(const ostring& name, double &value, BindInfo::BindDirection mode)
4231 {
4232  Bind(OCI_BindDouble, name, value, mode);
4233 }
4234 
4235 template <>
4236 inline void Statement::Bind<Date>(const ostring& name, Date &value, BindInfo::BindDirection mode)
4237 {
4238  Bind(OCI_BindDate, name, value, BindValue<OCI_Date *>(), mode);
4239 }
4240 
4241 template <>
4242 inline void Statement::Bind<Timestamp>(const ostring& name, Timestamp &value, BindInfo::BindDirection mode)
4243 {
4244  Bind(OCI_BindTimestamp, name, value, BindValue<OCI_Timestamp *>(), mode);
4245 }
4246 
4247 template <>
4248 inline void Statement::Bind<Interval>(const ostring& name, Interval &value, BindInfo::BindDirection mode)
4249 {
4250  Bind(OCI_BindInterval, name, value, BindValue<OCI_Interval *>(), mode);
4251 }
4252 
4253 template <>
4254 inline void Statement::Bind<Clob>(const ostring& name, Clob &value, BindInfo::BindDirection mode)
4255 {
4256  Bind(OCI_BindLob, name, value, BindValue<OCI_Lob *>(), mode);
4257 }
4258 
4259 template <>
4260 inline void Statement::Bind<NClob>(const ostring& name, NClob &value, BindInfo::BindDirection mode)
4261 {
4262  Bind(OCI_BindLob, name, value, BindValue<OCI_Lob *>(), mode);
4263 }
4264 
4265 template <>
4266 inline void Statement::Bind<Blob>(const ostring& name, Blob &value, BindInfo::BindDirection mode)
4267 {
4268  Bind(OCI_BindLob, name, value, BindValue<OCI_Lob *>(), mode);
4269 }
4270 
4271 template <>
4272 inline void Statement::Bind<File>(const ostring& name, File &value, BindInfo::BindDirection mode)
4273 {
4274  Bind(OCI_BindFile, name, value, BindValue<OCI_File *>(), mode);
4275 }
4276 
4277 template <>
4278 inline void Statement::Bind<Object>(const ostring& name, Object &value, BindInfo::BindDirection mode)
4279 {
4280  Bind(OCI_BindObject, name, value, BindValue<OCI_Object *>(), mode);
4281 }
4282 
4283 template <>
4284 inline void Statement::Bind<Reference>(const ostring& name, Reference &value, BindInfo::BindDirection mode)
4285 {
4286  Bind(OCI_BindRef, name, value, BindValue<OCI_Ref *>(), mode);
4287 }
4288 
4289 template <>
4290 inline void Statement::Bind<Statement>(const ostring& name, Statement &value, BindInfo::BindDirection mode)
4291 {
4292  Bind(OCI_BindStatement, name, value, BindValue<OCI_Statement *>(), mode);
4293 }
4294 
4295 template <>
4296 inline void Statement::Bind<Clong, unsigned int>(const ostring& name, Clong &value, unsigned int maxSize, BindInfo::BindDirection mode)
4297 {
4298  Check(OCI_BindLong(*this, name.c_str(), value, maxSize));
4299  SetLastBindMode(mode);
4300 }
4301 
4302 template <>
4303 inline void Statement::Bind<Clong, int>(const ostring& name, Clong &value, int maxSize, BindInfo::BindDirection mode)
4304 {
4305  Bind<Clong, unsigned int>(name, value, static_cast<unsigned int>(maxSize), mode);
4306 }
4307 
4308 template <>
4309 inline void Statement::Bind<Blong, unsigned int>(const ostring& name, Blong &value, unsigned int maxSize, BindInfo::BindDirection mode)
4310 {
4311  Check(OCI_BindLong(*this, name.c_str(), value, maxSize));
4312  SetLastBindMode(mode);
4313 }
4314 
4315 template <>
4316 inline void Statement::Bind<Blong, int>(const ostring& name, Blong &value, int maxSize, BindInfo::BindDirection mode)
4317 {
4318  Bind<Blong, unsigned int>(name, value, static_cast<unsigned int>(maxSize), mode);
4319 }
4320 
4321 template <>
4322 inline void Statement::Bind<ostring, unsigned int>(const ostring& name, ostring &value, unsigned int maxSize, BindInfo::BindDirection mode)
4323 {
4324  if (maxSize == 0)
4325  {
4326  maxSize = static_cast<unsigned int>(value.size());
4327  }
4328 
4329  value.reserve(maxSize);
4330 
4331  BindAdaptor<otext, ostring> * bnd = new BindAdaptor<otext, ostring>(*this, name, value, maxSize + 1);
4332 
4333  if (OCI_BindString(*this, name.c_str(), static_cast<otext *>(*bnd), maxSize))
4334  {
4335  BindsHolder *bindsHolder = GetBindsHolder(true);
4336  bindsHolder->AddBindObject(bnd);
4337  SetLastBindMode(mode);
4338  }
4339  else
4340  {
4341  delete bnd;
4342  }
4343 
4344  Check();
4345 }
4346 
4347 template <>
4348 inline void Statement::Bind<ostring, int>(const ostring& name, ostring &value, int maxSize, BindInfo::BindDirection mode)
4349 {
4350  Bind<ostring, unsigned int>(name, value, static_cast<unsigned int>(maxSize), mode);
4351 }
4352 
4353 template <>
4354 inline void Statement::Bind<Raw, unsigned int>(const ostring& name, Raw &value, unsigned int maxSize, BindInfo::BindDirection mode)
4355 {
4356  if (maxSize == 0)
4357  {
4358  maxSize = static_cast<unsigned int>(value.size());
4359  }
4360 
4361  value.reserve(maxSize);
4362 
4363  BindAdaptor<unsigned char, Raw> * bnd = new BindAdaptor<unsigned char, Raw>(*this, name, value, maxSize + 1);
4364 
4365  if (OCI_BindRaw(*this, name.c_str(), static_cast<unsigned char *>(*bnd), maxSize))
4366  {
4367  BindsHolder *bindsHolder = GetBindsHolder(true);
4368  bindsHolder->AddBindObject(bnd);
4369  SetLastBindMode(mode);
4370  }
4371  else
4372  {
4373  delete bnd;
4374  }
4375 
4376  Check();
4377 }
4378 
4379 template <>
4380 inline void Statement::Bind<Raw, int>(const ostring& name, Raw &value, int maxSize, BindInfo::BindDirection mode)
4381 {
4382  Bind<Raw, unsigned int>(name, value, static_cast<unsigned int>(maxSize), mode);
4383 }
4384 
4385 template <>
4386 inline void Statement::Bind<short>(const ostring& name, std::vector<short> &values, BindInfo::BindDirection mode)
4387 {
4388  Bind(OCI_BindArrayOfShorts, name, values, BindValue<short>(), mode);
4389 }
4390 
4391 template <>
4392 inline void Statement::Bind<unsigned short>(const ostring& name, std::vector<unsigned short> &values, BindInfo::BindDirection mode)
4393 {
4394  Bind(OCI_BindArrayOfUnsignedShorts, name, values, BindValue<unsigned short>(), mode);
4395 }
4396 
4397 template <>
4398 inline void Statement::Bind<int>(const ostring& name, std::vector<int> &values, BindInfo::BindDirection mode)
4399 {
4400  Bind(OCI_BindArrayOfInts, name, values, BindValue<int>(), mode);
4401 }
4402 
4403 template <>
4404 inline void Statement::Bind<unsigned int>(const ostring& name, std::vector<unsigned int> &values, BindInfo::BindDirection mode)
4405 {
4406  Bind(OCI_BindArrayOfUnsignedInts, name, values, BindValue<unsigned int>(), mode);
4407 }
4408 
4409 template <>
4410 inline void Statement::Bind<big_int>(const ostring& name, std::vector<big_int> &values, BindInfo::BindDirection mode)
4411 {
4412  Bind(OCI_BindArrayOfBigInts, name, values, BindValue<big_int>(), mode);
4413 }
4414 
4415 template <>
4416 inline void Statement::Bind<big_uint>(const ostring& name, std::vector<big_uint> &values, BindInfo::BindDirection mode)
4417 {
4418  Bind(OCI_BindArrayOfUnsignedBigInts, name, values, BindValue<big_uint>(), mode);
4419 }
4420 
4421 template <>
4422 inline void Statement::Bind<float>(const ostring& name, std::vector<float> &values, BindInfo::BindDirection mode)
4423 {
4424  Bind(OCI_BindArrayOfFloats, name, values, BindValue<float>(), mode);
4425 }
4426 
4427 template <>
4428 inline void Statement::Bind<double>(const ostring& name, std::vector<double> &values, BindInfo::BindDirection mode)
4429 {
4430  Bind(OCI_BindArrayOfDoubles, name, values, BindValue<double>(), mode);
4431 }
4432 
4433 template <>
4434 inline void Statement::Bind<Date>(const ostring& name, std::vector<Date> &values, BindInfo::BindDirection mode)
4435 {
4436  Bind(OCI_BindArrayOfDates, name, values, BindValue<OCI_Date *>(), mode);
4437 }
4438 
4439 template<class TDataType>
4440 inline void Statement::Bind(const ostring& name, TDataType &value, BindInfo::BindDirection mode)
4441 {
4442  Bind(OCI_BindColl, name, value, BindValue<OCI_Coll *>(), mode);
4443 }
4444 
4445 template <>
4446 inline void Statement::Bind<Timestamp, Timestamp::TimestampTypeValues>(const ostring& name, std::vector<Timestamp> &values, Timestamp::TimestampTypeValues type, BindInfo::BindDirection mode)
4447 {
4448  Bind(OCI_BindArrayOfTimestamps, name, values, BindValue<OCI_Timestamp *>(), mode, type);
4449 }
4450 
4451 template <>
4452 inline void Statement::Bind<Timestamp, Timestamp::TimestampType>(const ostring& name, std::vector<Timestamp> &values, Timestamp::TimestampType type, BindInfo::BindDirection mode)
4453 {
4454  Bind<Timestamp, Timestamp::TimestampTypeValues>(name, values, type.GetValue(), mode);
4455 }
4456 
4457 template <>
4458 inline void Statement::Bind<Interval, Interval::IntervalTypeValues>(const ostring& name, std::vector<Interval> &values, Interval::IntervalTypeValues type, BindInfo::BindDirection mode)
4459 {
4460  Bind(OCI_BindArrayOfIntervals, name, values, BindValue<OCI_Interval *>(), mode, type);
4461 }
4462 
4463 template <>
4464 inline void Statement::Bind<Interval, Interval::IntervalType>(const ostring& name, std::vector<Interval> &values, Interval::IntervalType type, BindInfo::BindDirection mode)
4465 {
4466  Bind<Interval, Interval::IntervalTypeValues>(name, values, type.GetValue(), mode);
4467 }
4468 
4469 template <>
4470 inline void Statement::Bind<Clob>(const ostring& name, std::vector<Clob> &values, BindInfo::BindDirection mode)
4471 {
4472  Bind(OCI_BindArrayOfLobs, name, values, BindValue<OCI_Lob *>(), mode, OCI_CLOB);
4473 }
4474 
4475 template <>
4476 inline void Statement::Bind<NClob>(const ostring& name, std::vector<NClob> &values, BindInfo::BindDirection mode)
4477 {
4478  Bind(OCI_BindArrayOfLobs, name, values, BindValue<OCI_Lob *>(), mode, OCI_NCLOB);
4479 }
4480 
4481 template <>
4482 inline void Statement::Bind<Blob>(const ostring& name, std::vector<Blob> &values, BindInfo::BindDirection mode)
4483 {
4484  Bind(OCI_BindArrayOfLobs, name, values, BindValue<OCI_Lob *>(), mode, OCI_BLOB);
4485 }
4486 
4487 template <>
4488 inline void Statement::Bind<File>(const ostring& name, std::vector<File> &values, BindInfo::BindDirection mode)
4489 {
4490  Bind(OCI_BindArrayOfFiles, name, values, BindValue<OCI_File *>(), mode, OCI_BFILE);
4491 }
4492 
4493 template <>
4494 inline void Statement::Bind<Object>(const ostring& name, std::vector<Object> &values, TypeInfo &typeInfo, BindInfo::BindDirection mode)
4495 {
4496  Bind(OCI_BindArrayOfObjects, name, values, BindValue<OCI_Object *>(), mode, static_cast<OCI_TypeInfo *>(typeInfo));
4497 }
4498 
4499 template <>
4500 inline void Statement::Bind<Reference>(const ostring& name, std::vector<Reference> &values, TypeInfo &typeInfo, BindInfo::BindDirection mode)
4501 {
4502  Bind(OCI_BindArrayOfRefs, name, values, BindValue<OCI_Ref *>(), mode, static_cast<OCI_TypeInfo *>(typeInfo));
4503 }
4504 
4505 template <>
4506 inline void Statement::Bind<ostring, unsigned int>(const ostring& name, std::vector<ostring> &values, unsigned int maxSize, BindInfo::BindDirection mode)
4507 {
4508  BindArray * bnd = new BindArray(*this, name);
4509  bnd->SetVector<ostring, otext>(values, mode, maxSize+1);
4510 
4511  if (OCI_BindArrayOfStrings(*this, name.c_str(), bnd->GetData<ostring, otext>(), maxSize, 0))
4512  {
4513  BindsHolder *bindsHolder = GetBindsHolder(true);
4514  bindsHolder->AddBindObject(bnd);
4515  SetLastBindMode(mode);
4516  }
4517  else
4518  {
4519  delete bnd;
4520  }
4521 
4522  Check();
4523 }
4524 
4525 template <>
4526 inline void Statement::Bind<ostring, int>(const ostring& name, std::vector<ostring> &values, int maxSize, BindInfo::BindDirection mode)
4527 {
4528  Bind<ostring, unsigned int>(name, values, ( unsigned int) maxSize, mode);
4529 }
4530 
4531 template <>
4532 inline void Statement::Bind<Raw, unsigned int>(const ostring& name, std::vector<Raw> &values, unsigned int maxSize, BindInfo::BindDirection mode)
4533 {
4534  BindArray * bnd = new BindArray(*this, name);
4535  bnd->SetVector<Raw, unsigned char>(values, mode, maxSize + 1);
4536 
4537  if (OCI_BindArrayOfRaws(*this, name.c_str(), bnd->GetData<Raw, unsigned char>(), maxSize, 0))
4538  {
4539  BindsHolder *bindsHolder = GetBindsHolder(true);
4540  bindsHolder->AddBindObject(bnd);
4541  SetLastBindMode(mode);
4542  }
4543  else
4544  {
4545  delete bnd;
4546  }
4547 
4548  Check();
4549 }
4550 
4551 template<class TDataType>
4552 void Statement::Bind(const ostring& name, std::vector<TDataType> &values, TypeInfo &typeInfo, BindInfo::BindDirection mode)
4553 {
4554  Bind(OCI_BindArrayOfColls, name, values, BindValue<OCI_Coll *>(), mode, static_cast<OCI_TypeInfo *>(typeInfo));
4555 }
4556 
4557 template <>
4558 inline void Statement::Register<unsigned short>(const ostring& name)
4559 {
4560  Check(OCI_RegisterUnsignedShort(*this, name.c_str()));
4561 }
4562 
4563 template <>
4564 inline void Statement::Register<short>(const ostring& name)
4565 {
4566  Check(OCI_RegisterShort(*this, name.c_str()));
4567 }
4568 
4569 template <>
4570 inline void Statement::Register<unsigned int>(const ostring& name)
4571 {
4572  Check(OCI_RegisterUnsignedInt(*this, name.c_str()));
4573 }
4574 
4575 template <>
4576 inline void Statement::Register<int>(const ostring& name)
4577 {
4578  Check(OCI_RegisterInt(*this, name.c_str()));
4579 }
4580 
4581 template <>
4582 inline void Statement::Register<big_uint>(const ostring& name)
4583 {
4584  Check(OCI_RegisterUnsignedBigInt(*this, name.c_str()));
4585 }
4586 
4587 template <>
4588 inline void Statement::Register<big_int>(const ostring& name)
4589 {
4590  Check(OCI_RegisterBigInt(*this, name.c_str()));
4591 }
4592 
4593 template <>
4594 inline void Statement::Register<float>(const ostring& name)
4595 {
4596  Check(OCI_RegisterFloat(*this, name.c_str()));
4597 }
4598 
4599 template <>
4600 inline void Statement::Register<double>(const ostring& name)
4601 {
4602  Check(OCI_RegisterDouble(*this, name.c_str()));
4603 }
4604 
4605 template <>
4606 inline void Statement::Register<Date>(const ostring& name)
4607 {
4608  Check(OCI_RegisterDate(*this, name.c_str()));
4609 }
4610 
4611 template <>
4612 inline void Statement::Register<Timestamp, Timestamp::TimestampTypeValues>(const ostring& name, Timestamp::TimestampTypeValues type)
4613 {
4614  Check(OCI_RegisterTimestamp(*this, name.c_str(), type));
4615 }
4616 
4617 template <>
4618 inline void Statement::Register<Timestamp, Timestamp::TimestampType>(const ostring& name, Timestamp::TimestampType type)
4619 {
4620  Register<Timestamp, Timestamp::TimestampTypeValues>(name, type.GetValue());
4621 }
4622 
4623 template <>
4624 inline void Statement::Register<Interval, Interval::IntervalTypeValues>(const ostring& name, Interval::IntervalTypeValues type)
4625 {
4626  Check(OCI_RegisterInterval(*this, name.c_str(), type));
4627 }
4628 
4629 template <>
4630 inline void Statement::Register<Interval, Interval::IntervalType>(const ostring& name, Interval::IntervalType type)
4631 {
4632  Register<Interval, Interval::IntervalTypeValues>(name, type.GetValue());
4633 }
4634 
4635 template <>
4636 inline void Statement::Register<Clob>(const ostring& name)
4637 {
4638  Check(OCI_RegisterLob(*this, name.c_str(), OCI_CLOB));
4639 }
4640 
4641 template <>
4642 inline void Statement::Register<NClob>(const ostring& name)
4643 {
4644  Check(OCI_RegisterLob(*this, name.c_str(), OCI_NCLOB));
4645 }
4646 
4647 template <>
4648 inline void Statement::Register<Blob>(const ostring& name)
4649 {
4650  Check(OCI_RegisterLob(*this, name.c_str(), OCI_BLOB));
4651 }
4652 
4653 template <>
4654 inline void Statement::Register<File>(const ostring& name)
4655 {
4656  Check(OCI_RegisterFile(*this, name.c_str(), OCI_BFILE));
4657 }
4658 
4659 template <>
4660 inline void Statement::Register<Object, TypeInfo>(const ostring& name, TypeInfo& typeInfo)
4661 {
4662  Check(OCI_RegisterObject(*this, name.c_str(), typeInfo));
4663 }
4664 
4665 template <>
4666 inline void Statement::Register<Reference, TypeInfo>(const ostring& name, TypeInfo& typeInfo)
4667 {
4668  Check(OCI_RegisterRef(*this, name.c_str(), typeInfo));
4669 }
4670 
4671 template <>
4672 inline void Statement::Register<ostring, unsigned int>(const ostring& name, unsigned int len)
4673 {
4674  Check(OCI_RegisterString(*this, name.c_str(), len));
4675 }
4676 
4677 template <>
4678 inline void Statement::Register<ostring, int>(const ostring& name, int len)
4679 {
4680  Register<ostring, unsigned int>(name, static_cast<unsigned int>(len));
4681 }
4682 
4683 template <>
4684 inline void Statement::Register<Raw, unsigned int>(const ostring& name, unsigned int len)
4685 {
4686  Check(OCI_RegisterRaw(*this, name.c_str(), len));
4687 }
4688 
4689 template <>
4690 inline void Statement::Register<Raw, int>(const ostring& name, int len)
4691 {
4692  Register<Raw, unsigned int>(name, static_cast<unsigned int>(len));
4693 }
4694 
4695 
4696 inline Statement::StatementType Statement::GetStatementType() const
4697 {
4698  return StatementType(static_cast<StatementType::type>(Check(OCI_GetStatementType(*this))));
4699 }
4700 
4701 inline unsigned int Statement::GetSqlErrorPos() const
4702 {
4703  return Check(OCI_GetSqlErrorPos(*this));
4704 }
4705 
4706 inline void Statement::SetFetchMode(FetchMode value)
4707 {
4708  Check(OCI_SetFetchMode(*this, value));
4709 }
4710 
4711 inline Statement::FetchMode Statement::GetFetchMode() const
4712 {
4713  return FetchMode(static_cast<FetchMode::type>(Check(OCI_GetFetchMode(*this))));
4714 }
4715 
4716 inline void Statement::SetBindMode(BindMode value)
4717 {
4718  Check(OCI_SetBindMode(*this, value));
4719 }
4720 
4721 inline Statement::BindMode Statement::GetBindMode() const
4722 {
4723  return BindMode(static_cast<BindMode::type>(Check(OCI_GetBindMode(*this))));
4724 }
4725 
4726 inline void Statement::SetFetchSize(unsigned int value)
4727 {
4728  Check(OCI_SetFetchSize(*this, value));
4729 }
4730 
4731 inline unsigned int Statement::GetFetchSize() const
4732 {
4733  return Check(OCI_GetFetchSize(*this));
4734 }
4735 
4736 inline void Statement::SetPrefetchSize(unsigned int value)
4737 {
4738  Check(OCI_SetPrefetchSize(*this, value));
4739 }
4740 
4741 inline unsigned int Statement::GetPrefetchSize() const
4742 {
4743  return Check(OCI_GetPrefetchSize(*this));
4744 }
4745 
4746 inline void Statement::SetPrefetchMemory(unsigned int value)
4747 {
4748  Check(OCI_SetPrefetchMemory(*this, value));
4749 }
4750 
4751 inline unsigned int Statement::GetPrefetchMemory() const
4752 {
4753  return Check(OCI_GetPrefetchMemory(*this));
4754 }
4755 
4756 inline void Statement::SetLongMaxSize(unsigned int value)
4757 {
4758  Check(OCI_SetLongMaxSize(*this, value));
4759 }
4760 
4761 inline unsigned int Statement::GetLongMaxSize() const
4762 {
4763  return Check(OCI_GetLongMaxSize(*this));
4764 }
4765 
4766 inline void Statement::SetLongMode(LongMode value)
4767 {
4768  Check(OCI_SetLongMode(*this, value));
4769 }
4770 
4771 inline Statement::LongMode Statement::GetLongMode() const
4772 {
4773  return LongMode(static_cast<LongMode::type>(Check(OCI_GetLongMode(*this))));
4774 }
4775 
4776 inline unsigned int Statement::GetSQLCommand() const
4777 {
4778  return Check(OCI_GetSQLCommand(*this));
4779 }
4780 
4781 inline ostring Statement::GetSQLVerb() const
4782 {
4783  return MakeString(Check(OCI_GetSQLVerb(*this)));
4784 }
4785 
4786 inline void Statement::GetBatchErrors(std::vector<Exception> &exceptions)
4787 {
4788  exceptions.clear();
4789 
4790  OCI_Error *err = Check(OCI_GetBatchError(*this));
4791 
4792  while (err)
4793  {
4794  exceptions.push_back(Exception(err));
4795 
4796  err = Check(OCI_GetBatchError(*this));
4797  }
4798 }
4799 
4800 inline void Statement::ClearBinds()
4801 {
4802  BindsHolder *bindsHolder = GetBindsHolder(false);
4803 
4804  if (bindsHolder)
4805  {
4806  bindsHolder->Clear();
4807  }
4808 }
4809 
4810 inline void Statement::SetOutData()
4811 {
4812  BindsHolder *bindsHolder = GetBindsHolder(false);
4813 
4814  if (bindsHolder)
4815  {
4816  bindsHolder->SetOutData();
4817  }
4818 }
4819 
4820 inline void Statement::SetInData()
4821 {
4822  BindsHolder *bindsHolder = GetBindsHolder(false);
4823 
4824  if (bindsHolder)
4825  {
4826  bindsHolder->SetInData();
4827  }
4828 }
4829 
4830 inline void Statement::ReleaseResultsets()
4831 {
4832  if (_smartHandle)
4833  {
4834  std::list<Handle *> &children = _smartHandle->GetChildren();
4835 
4836  size_t nbHandles = children.size();
4837 
4838  while (nbHandles-- > 0)
4839  {
4840  Resultset::SmartHandle *smartHandle = dynamic_cast<Resultset::SmartHandle *>(*children.begin());
4841 
4842  if (smartHandle)
4843  {
4844  smartHandle->DetachFromHolders();
4845 
4846  delete smartHandle;
4847  }
4848  }
4849  }
4850 }
4851 
4852 inline void Statement::SetLastBindMode(BindInfo::BindDirection mode)
4853 {
4855 }
4856 
4857 inline BindsHolder * Statement::GetBindsHolder(bool create)
4858 {
4859  BindsHolder * bindsHolder = static_cast<BindsHolder *>(_smartHandle->GetExtraInfos());
4860 
4861  if (bindsHolder == 0 && create)
4862  {
4863  bindsHolder = new BindsHolder(*this);
4864  _smartHandle->SetExtraInfos(bindsHolder);
4865  }
4866 
4867  return bindsHolder;
4868 }
4869 
4870 /* --------------------------------------------------------------------------------------------- *
4871  * Resultset
4872  * --------------------------------------------------------------------------------------------- */
4873 
4874 inline Resultset::Resultset(OCI_Resultset *resultset, Handle *parent)
4875 {
4876  Acquire(resultset, 0, parent);
4877 }
4878 
4879 inline bool Resultset::Next()
4880 {
4881  return (Check(OCI_FetchNext(*this)) == TRUE);
4882 }
4883 
4884 inline bool Resultset::Prev()
4885 {
4886  return (Check(OCI_FetchPrev(*this)) == TRUE);
4887 }
4888 
4889 inline bool Resultset::First()
4890 {
4891  return (Check(OCI_FetchFirst(*this)) == TRUE);
4892 }
4893 
4894 inline bool Resultset::Last()
4895 {
4896  return (Check(OCI_FetchLast(*this)) == TRUE);
4897 }
4898 
4899 inline bool Resultset::Seek(SeekMode mode, int offset)
4900 {
4901  return (Check(OCI_FetchSeek(*this, mode, offset)) == TRUE);
4902 }
4903 
4904 inline unsigned int Resultset::GetCount() const
4905 {
4906  return Check(OCI_GetRowCount(*this));
4907 }
4908 
4909 inline unsigned int Resultset::GetCurrentRow() const
4910 {
4911  return Check(OCI_GetCurrentRow(*this));
4912 }
4913 
4914 inline unsigned int Resultset::GetColumnIndex(const ostring& name) const
4915 {
4916  return Check(OCI_GetColumnIndex(*this, name.c_str()));
4917 }
4918 
4919 inline unsigned int Resultset::GetColumnCount() const
4920 {
4921  return Check(OCI_GetColumnCount(*this));
4922 }
4923 
4924 inline Column Resultset::GetColumn(unsigned int index) const
4925 {
4926  return Column(Check(OCI_GetColumn(*this, index)), GetHandle());
4927 }
4928 
4929 inline Column Resultset::GetColumn(const ostring& name) const
4930 {
4931  return Column(Check(OCI_GetColumn2(*this, name.c_str())), GetHandle());
4932 }
4933 
4934 inline bool Resultset::IsColumnNull(unsigned int index) const
4935 {
4936  return (Check(OCI_IsNull(*this, index)) == TRUE);
4937 }
4938 
4939 inline bool Resultset::IsColumnNull(const ostring& name) const
4940 {
4941  return (Check(OCI_IsNull2(*this, name.c_str())) == TRUE);
4942 }
4943 
4944 inline Statement Resultset::GetStatement() const
4945 {
4946  return Statement( Check(OCI_ResultsetGetStatement(*this)), 0);
4947 }
4948 
4949 inline bool Resultset::operator ++ (int)
4950 {
4951  return Next();
4952 }
4953 
4954 inline bool Resultset::operator -- (int)
4955 {
4956  return Prev();
4957 }
4958 
4959 inline bool Resultset::operator += (int offset)
4960 {
4961  return Seek(Resultset::SeekRelative, offset);
4962 }
4963 
4964 inline bool Resultset::operator -= (int offset)
4965 {
4966  return Seek(Resultset::SeekRelative, -offset);
4967 }
4968 
4969 template<>
4970 inline short Resultset::Get<short>(unsigned int index) const
4971 {
4972  return Check(OCI_GetShort(*this, index));
4973 }
4974 
4975 template<>
4976 inline short Resultset::Get<short>(const ostring& name) const
4977 {
4978  return Check(OCI_GetShort2(*this, name.c_str()));
4979 }
4980 
4981 template<>
4982 inline unsigned short Resultset::Get<unsigned short>(unsigned int index) const
4983 {
4984  return Check(OCI_GetUnsignedShort(*this, index));
4985 }
4986 
4987 template<>
4988 inline unsigned short Resultset::Get<unsigned short>(const ostring& name) const
4989 {
4990  return Check(OCI_GetUnsignedShort2(*this, name.c_str()));
4991 }
4992 
4993 template<>
4994 inline int Resultset::Get<int>(unsigned int index) const
4995 {
4996  return Check(OCI_GetInt(*this, index));
4997 }
4998 
4999 template<>
5000 inline int Resultset::Get<int>(const ostring& name) const
5001 {
5002  return Check(OCI_GetInt2(*this, name.c_str()));
5003 }
5004 
5005 template<>
5006 inline unsigned int Resultset::Get<unsigned int>(unsigned int index) const
5007 {
5008  return Check(OCI_GetUnsignedInt(*this, index));
5009 }
5010 
5011 template<>
5012 inline unsigned int Resultset::Get<unsigned int>(const ostring& name) const
5013 {
5014  return Check(OCI_GetUnsignedInt2(*this, name.c_str()));
5015 }
5016 
5017 template<>
5018 inline big_int Resultset::Get<big_int>(unsigned int index) const
5019 {
5020  return Check(OCI_GetBigInt(*this, index));
5021 }
5022 
5023 template<>
5024 inline big_int Resultset::Get<big_int>(const ostring& name) const
5025 {
5026  return Check(OCI_GetBigInt2(*this, name.c_str()));
5027 }
5028 
5029 template<>
5030 inline big_uint Resultset::Get<big_uint>(unsigned int index) const
5031 {
5032  return Check(OCI_GetUnsignedBigInt(*this, index));
5033 }
5034 
5035 template<>
5036 inline big_uint Resultset::Get<big_uint>(const ostring& name) const
5037 {
5038  return Check(OCI_GetUnsignedBigInt2(*this, name.c_str()));
5039 }
5040 
5041 template<>
5042 inline float Resultset::Get<float>(unsigned int index) const
5043 {
5044  return Check(OCI_GetFloat(*this, index));
5045 }
5046 
5047 template<>
5048 inline float Resultset::Get<float>(const ostring& name) const
5049 {
5050  return Check(OCI_GetFloat2(*this, name.c_str()));
5051 }
5052 
5053 template<>
5054 inline double Resultset::Get<double>(unsigned int index) const
5055 {
5056  return Check(OCI_GetDouble(*this, index));
5057 }
5058 
5059 template<>
5060 inline double Resultset::Get<double>(const ostring& name) const
5061 {
5062  return Check(OCI_GetDouble2(*this, name.c_str()));
5063 }
5064 
5065 template<>
5066 inline ostring Resultset::Get<ostring>(unsigned int index) const
5067 {
5068  return MakeString(Check(OCI_GetString(*this, index)));
5069 }
5070 
5071 template<>
5072 inline ostring Resultset::Get<ostring>(const ostring& name) const
5073 {
5074  return MakeString(Check(OCI_GetString2(*this,name.c_str())));
5075 }
5076 
5077 template<>
5078 inline Raw Resultset::Get<Raw>(unsigned int index) const
5079 {
5080  unsigned int size = Check(OCI_GetDataLength(*this,index));
5081 
5082  ManagedBuffer<unsigned char> buffer(size + 1);
5083 
5084  size = Check(OCI_GetRaw(*this, index, static_cast<AnyPointer>(buffer), size));
5085 
5086  return MakeRaw(buffer, size);
5087 }
5088 
5089 template<>
5090 inline Raw Resultset::Get<Raw>(const ostring& name) const
5091 {
5092  unsigned int size = Check(OCI_GetDataLength(*this, Check(OCI_GetColumnIndex(*this, name.c_str()))));
5093 
5094  ManagedBuffer<unsigned char> buffer(size + 1);
5095 
5096  size = Check(OCI_GetRaw2(*this, name.c_str(), static_cast<AnyPointer>(buffer), size));
5097 
5098  return MakeRaw(buffer, size);
5099 }
5100 
5101 template<>
5102 inline Date Resultset::Get<Date>(unsigned int index) const
5103 {
5104  return Date(Check(OCI_GetDate(*this, index)), GetHandle());
5105 }
5106 
5107 template<>
5108 inline Date Resultset::Get<Date>(const ostring& name) const
5109 {
5110  return Date(Check(OCI_GetDate2(*this,name.c_str())), GetHandle());
5111 }
5112 
5113 template<>
5114 inline Timestamp Resultset::Get<Timestamp>(unsigned int index) const
5115 {
5116  return Timestamp(Check(OCI_GetTimestamp(*this, index)), GetHandle());
5117 }
5118 
5119 template<>
5120 inline Timestamp Resultset::Get<Timestamp>(const ostring& name) const
5121 {
5122  return Timestamp(Check(OCI_GetTimestamp2(*this,name.c_str())), GetHandle());
5123 }
5124 
5125 template<>
5126 inline Interval Resultset::Get<Interval>(unsigned int index) const
5127 {
5128  return Interval(Check(OCI_GetInterval(*this, index)), GetHandle());
5129 }
5130 
5131 template<>
5132 inline Interval Resultset::Get<Interval>(const ostring& name) const
5133 {
5134  return Interval(Check(OCI_GetInterval2(*this,name.c_str())), GetHandle());
5135 }
5136 
5137 template<>
5138 inline Object Resultset::Get<Object>(unsigned int index) const
5139 {
5140  return Object(Check(OCI_GetObject(*this, index)), GetHandle());
5141 }
5142 
5143 template<>
5144 inline Object Resultset::Get<Object>(const ostring& name) const
5145 {
5146  return Object(Check(OCI_GetObject2(*this,name.c_str())), GetHandle());
5147 }
5148 
5149 template<>
5150 inline Reference Resultset::Get<Reference>(unsigned int index) const
5151 {
5152  return Reference(Check(OCI_GetRef(*this, index)), GetHandle());
5153 }
5154 
5155 template<>
5156 inline Reference Resultset::Get<Reference>(const ostring& name) const
5157 {
5158  return Reference(Check(OCI_GetRef2(*this,name.c_str())), GetHandle());
5159 }
5160 
5161 template<>
5162 inline Statement Resultset::Get<Statement>(unsigned int index) const
5163 {
5164  return Statement(Check(OCI_GetStatement(*this, index)), GetHandle());
5165 }
5166 
5167 template<>
5168 inline Statement Resultset::Get<Statement>(const ostring& name) const
5169 {
5170  return Statement(Check(OCI_GetStatement2(*this,name.c_str())), GetHandle());
5171 }
5172 
5173 template<>
5174 inline Clob Resultset::Get<Clob>(unsigned int index) const
5175 {
5176  return Clob(Check(OCI_GetLob(*this, index)), GetHandle());
5177 }
5178 
5179 template<>
5180 inline Clob Resultset::Get<Clob>(const ostring& name) const
5181 {
5182  return Clob(Check(OCI_GetLob2(*this,name.c_str())), GetHandle());
5183 }
5184 
5185 template<>
5186 inline NClob Resultset::Get<NClob>(unsigned int index) const
5187 {
5188  return NClob(Check(OCI_GetLob(*this, index)), GetHandle());
5189 }
5190 
5191 template<>
5192 inline NClob Resultset::Get<NClob>(const ostring& name) const
5193 {
5194  return NClob(Check(OCI_GetLob2(*this, name.c_str())), GetHandle());
5195 }
5196 
5197 template<>
5198 inline Blob Resultset::Get<Blob>(unsigned int index) const
5199 {
5200  return Blob(Check(OCI_GetLob(*this, index)), GetHandle());
5201 }
5202 
5203 template<>
5204 inline Blob Resultset::Get<Blob>(const ostring& name) const
5205 {
5206  return Blob(Check(OCI_GetLob2(*this,name.c_str())), GetHandle());
5207 }
5208 
5209 template<>
5210 inline File Resultset::Get<File>(unsigned int index) const
5211 {
5212  return File(Check(OCI_GetFile(*this, index)), GetHandle());
5213 }
5214 
5215 template<>
5216 inline File Resultset::Get<File>(const ostring& name) const
5217 {
5218  return File(Check(OCI_GetFile2(*this,name.c_str())), GetHandle());
5219 }
5220 
5221 template<>
5222 inline Clong Resultset::Get<Clong>(unsigned int index) const
5223 {
5224  return Clong(Check(OCI_GetLong(*this, index)), GetHandle());
5225 }
5226 
5227 template<>
5228 inline Clong Resultset::Get<Clong>(const ostring& name) const
5229 {
5230  return Clong(Check(OCI_GetLong2(*this,name.c_str())), GetHandle());
5231 }
5232 
5233 template<>
5234 inline Blong Resultset::Get<Blong>(unsigned int index) const
5235 {
5236  return Blong(Check(OCI_GetLong(*this, index)), GetHandle());
5237 }
5238 
5239 template<>
5240 inline Blong Resultset::Get<Blong>(const ostring& name) const
5241 {
5242  return Blong(Check(OCI_GetLong2(*this,name.c_str())), GetHandle());
5243 }
5244 
5245 template<class TDataType>
5246 inline TDataType Resultset::Get(unsigned int index) const
5247 {
5248  return TDataType(Check(OCI_GetColl(*this, index)), GetHandle());
5249 }
5250 
5251 template<class TDataType>
5252 inline TDataType Resultset::Get(const ostring& name) const
5253 {
5254  return TDataType(Check(OCI_GetColl2(*this, name.c_str())), GetHandle());
5255 }
5256 
5257 /* --------------------------------------------------------------------------------------------- *
5258  * Column
5259  * --------------------------------------------------------------------------------------------- */
5260 
5261 inline Column::Column(OCI_Column *pColumn, Handle *parent)
5262 {
5263  Acquire(pColumn, 0, parent);
5264 }
5265 
5266 inline ostring Column::GetName() const
5267 {
5268  return MakeString(Check(OCI_ColumnGetName(*this)));
5269 }
5270 
5271 inline ostring Column::GetSQLType() const
5272 {
5273  return MakeString(Check(OCI_ColumnGetSQLType(*this)));
5274 }
5275 
5276 inline ostring Column::GetFullSQLType() const
5277 {
5278  unsigned int size = OCI_SIZE_BUFFER;
5279 
5280  ManagedBuffer<otext> buffer(size + 1);
5281 
5282  Check(OCI_ColumnGetFullSQLType(*this, buffer, size));
5283 
5284  return MakeString(static_cast<const otext *>(buffer));
5285 }
5286 
5287 inline DataType Column::GetType() const
5288 {
5289  return DataType(static_cast<DataType::type>(Check(OCI_ColumnGetType(*this))));
5290 }
5291 
5292 inline unsigned int Column::GetSubType() const
5293 {
5294  return Check(OCI_ColumnGetSubType(*this));
5295 }
5296 
5297 inline CharsetForm Column::GetCharsetForm() const
5298 {
5299  return CharsetForm(static_cast<CharsetForm::type>(Check(OCI_ColumnGetCharsetForm(*this))));
5300 }
5301 
5302 inline unsigned int Column::GetSize() const
5303 {
5304  return Check(OCI_ColumnGetSize(*this));
5305 }
5306 
5307 inline int Column::GetScale() const
5308 {
5309  return Check(OCI_ColumnGetScale(*this));
5310 }
5311 
5312 inline int Column::GetPrecision() const
5313 {
5314  return Check(OCI_ColumnGetPrecision(*this));
5315 }
5316 
5317 inline int Column::GetFractionalPrecision() const
5318 {
5319  return Check(OCI_ColumnGetFractionalPrecision(*this));
5320 }
5321 
5322 inline int Column::GetLeadingPrecision() const
5323 {
5324  return Check(OCI_ColumnGetLeadingPrecision(*this));
5325 }
5326 
5327 inline Column::PropertyFlags Column::GetPropertyFlags() const
5328 {
5329  return PropertyFlags(static_cast<PropertyFlags::type>(Check(OCI_ColumnGetPropertyFlags(*this))));
5330 }
5331 
5332 inline bool Column::IsNullable() const
5333 {
5334  return (Check(OCI_ColumnGetNullable(*this)) == TRUE);
5335 }
5336 
5337 inline bool Column::IsCharSemanticUsed() const
5338 {
5339  return (Check(OCI_ColumnGetCharUsed(*this)) == TRUE);
5340 }
5341 
5342 inline TypeInfo Column::GetTypeInfo() const
5343 {
5344  return TypeInfo(Check(OCI_ColumnGetTypeInfo(*this)));
5345 }
5346 
5347 /* --------------------------------------------------------------------------------------------- *
5348  * Subscription
5349  * --------------------------------------------------------------------------------------------- */
5350 
5351 inline Subscription::Subscription()
5352 {
5353 
5354 }
5355 
5356 inline Subscription::Subscription(OCI_Subscription *pSubcription)
5357 {
5358  Acquire(pSubcription, 0, 0);
5359 }
5360 
5361 inline void Subscription::Register(const Connection &connection, const ostring& name, ChangeTypes changeTypes, NotifyHandlerProc handler, unsigned int port, unsigned int timeout)
5362 {
5363  Acquire(Check(OCI_SubscriptionRegister(connection, name.c_str(), changeTypes.GetValues(),
5364  static_cast<POCI_NOTIFY> (handler != 0 ? Environment::NotifyHandler : 0 ), port, timeout)),
5365  reinterpret_cast<HandleFreeFunc>(OCI_SubscriptionUnregister), 0);
5366 
5367  Environment::GetEnvironmentHandle().Callbacks.Set(static_cast<OCI_Subscription*>(*this), reinterpret_cast<CallbackPointer>(handler));
5368 }
5369 
5370 inline void Subscription::Unregister()
5371 {
5372  Environment::GetEnvironmentHandle().Callbacks.Remove(*this);
5373  Release();
5374 }
5375 
5376 inline void Subscription::Watch(const ostring& sql)
5377 {
5378  Statement st(GetConnection());
5379 
5380  st.Execute(sql);
5381 
5382  Check(OCI_SubscriptionAddStatement(*this, st));
5383 }
5384 
5385 inline ostring Subscription::GetName() const
5386 {
5387  return MakeString(Check(OCI_SubscriptionGetName(*this)));
5388 }
5389 
5390 inline unsigned int Subscription::GetTimeout() const
5391 {
5392  return Check(OCI_SubscriptionGetTimeout(*this));
5393 }
5394 
5395 inline unsigned int Subscription::GetPort() const
5396 {
5397  return Check(OCI_SubscriptionGetPort(*this));
5398 }
5399 
5400 inline Connection Subscription::GetConnection() const
5401 {
5402  return Connection(Check(OCI_SubscriptionGetConnection(*this)), 0);
5403 }
5404 
5405 /* --------------------------------------------------------------------------------------------- *
5406  * Event
5407  * --------------------------------------------------------------------------------------------- */
5408 
5409 inline Event::Event(OCI_Event *pEvent)
5410 {
5411  Acquire(pEvent, 0, 0);
5412 }
5413 
5414 inline Event::EventType Event::GetType() const
5415 {
5416  return EventType(static_cast<EventType::type>(Check(OCI_EventGetType(*this))));
5417 }
5418 
5419 inline Event::ObjectEvent Event::GetObjectEvent() const
5420 {
5421  return ObjectEvent(static_cast<ObjectEvent::type>(Check(OCI_EventGetOperation(*this))));
5422 }
5423 
5424 inline ostring Event::GetDatabaseName() const
5425 {
5426  return MakeString(Check(OCI_EventGetDatabase(*this)));
5427 }
5428 
5429 inline ostring Event::GetObjectName() const
5430 {
5431  return MakeString(Check(OCI_EventGetObject(*this)));
5432 }
5433 
5434 inline ostring Event::GetRowID() const
5435 {
5436  return MakeString(Check(OCI_EventGetRowid(*this)));
5437 }
5438 
5439 inline Subscription Event::GetSubscription() const
5440 {
5442 }
5443 
5444 /* --------------------------------------------------------------------------------------------- *
5445  * Agent
5446  * --------------------------------------------------------------------------------------------- */
5447 
5448 inline Agent::Agent(const Connection &connection, const ostring& name, const ostring& address)
5449 {
5450  Acquire(Check(OCI_AgentCreate(connection, name.c_str(), address.c_str())), reinterpret_cast<HandleFreeFunc>(OCI_AgentFree), 0);
5451 }
5452 
5453 inline Agent::Agent(OCI_Agent *pAgent, Handle *parent)
5454 {
5455  Acquire(pAgent, 0, parent);
5456 }
5457 
5458 inline ostring Agent::GetName() const
5459 {
5460  return MakeString(Check(OCI_AgentGetName(*this)));
5461 }
5462 
5463 inline void Agent::SetName(const ostring& value)
5464 {
5465  Check(OCI_AgentSetName(*this, value.c_str()));
5466 }
5467 
5468 inline ostring Agent::GetAddress() const
5469 {
5470  return MakeString(Check(OCI_AgentGetAddress(*this)));
5471 }
5472 
5473 inline void Agent::SetAddress(const ostring& value)
5474 {
5475  Check(OCI_AgentSetAddress(*this, value.c_str()));
5476 }
5477 
5478 /* --------------------------------------------------------------------------------------------- *
5479  * Message
5480  * --------------------------------------------------------------------------------------------- */
5481 
5482 inline Message::Message(const TypeInfo &typeInfo)
5483 {
5484  Acquire(Check(OCI_MsgCreate(typeInfo)), reinterpret_cast<HandleFreeFunc>(OCI_MsgFree), 0);
5485 }
5486 
5487 inline Message::Message(OCI_Msg *pMessage, Handle *parent)
5488 {
5489  Acquire(pMessage, 0, parent);
5490 }
5491 
5492 inline void Message::Reset()
5493 {
5494  Check(OCI_MsgReset(*this));
5495 }
5496 
5497 template <>
5498 inline Object Message::GetPayload<Object>()
5499 {
5500  return Object(Check(OCI_MsgGetObject(*this)), 0);
5501 }
5502 
5503 template <>
5504 inline void Message::SetPayload<Object>(const Object &value)
5505 {
5506  Check(OCI_MsgSetObject(*this, value));
5507 }
5508 
5509 template <>
5510 inline Raw Message::GetPayload<Raw>()
5511 {
5512  unsigned int size = 0;
5513 
5514  ManagedBuffer<unsigned char> buffer(size + 1);
5515 
5516  Check(OCI_MsgGetRaw(*this, static_cast<AnyPointer>(buffer), &size));
5517 
5518  return MakeRaw(buffer, size);
5519 }
5520 
5521 template <>
5522 inline void Message::SetPayload<Raw>(const Raw &value)
5523 {
5524  Check(OCI_MsgSetRaw(*this, static_cast<AnyPointer>(const_cast<Raw::value_type *>(value.data())), static_cast<unsigned int>(value.size())));
5525 }
5526 
5527 inline Date Message::GetEnqueueTime() const
5528 {
5529  return Date(Check(OCI_MsgGetEnqueueTime(*this)), 0);
5530 }
5531 
5532 inline int Message::GetAttemptCount() const
5533 {
5534  return Check(OCI_MsgGetAttemptCount(*this));
5535 }
5536 
5537 inline Message::MessageState Message::GetState() const
5538 {
5539  return MessageState(static_cast<MessageState::type>(Check(OCI_MsgGetState(*this))));
5540 }
5541 
5542 inline Raw Message::GetID() const
5543 {
5544  unsigned int size = OCI_SIZE_BUFFER;
5545 
5546  ManagedBuffer<unsigned char> buffer(size + 1);
5547 
5548  Check(OCI_MsgGetID(*this, static_cast<AnyPointer>(buffer), &size));
5549 
5550  return MakeRaw(buffer, size);
5551 }
5552 
5553 inline int Message::GetExpiration() const
5554 {
5555  return Check(OCI_MsgGetExpiration(*this));
5556 }
5557 
5558 inline void Message::SetExpiration(int value)
5559 {
5560  Check(OCI_MsgSetExpiration(*this, value));
5561 }
5562 
5563 inline int Message::GetEnqueueDelay() const
5564 {
5565  return Check(OCI_MsgGetEnqueueDelay(*this));
5566 }
5567 
5568 inline void Message::SetEnqueueDelay(int value)
5569 {
5570  Check(OCI_MsgSetEnqueueDelay(*this, value));
5571 }
5572 
5573 inline int Message::GetPriority() const
5574 {
5575  return Check(OCI_MsgGetPriority(*this));
5576 }
5577 
5578 inline void Message::SetPriority(int value)
5579 {
5580  Check(OCI_MsgSetPriority(*this, value));
5581 }
5582 
5583 inline Raw Message::GetOriginalID() const
5584 {
5585  unsigned int size = OCI_SIZE_BUFFER;
5586 
5587  ManagedBuffer<unsigned char> buffer(size + 1);
5588 
5589  Check(OCI_MsgGetOriginalID(*this, static_cast<AnyPointer>(buffer), &size));
5590 
5591  return MakeRaw(buffer, size);
5592 }
5593 
5594 inline void Message::SetOriginalID(const Raw &value)
5595 {
5596  Check(OCI_MsgSetOriginalID(*this, static_cast<AnyPointer>(const_cast<Raw::value_type *>(value.data())), static_cast<unsigned int>(value.size())));
5597 }
5598 
5599 inline ostring Message::GetCorrelation() const
5600 {
5601  return MakeString(Check(OCI_MsgGetCorrelation(*this)));
5602 }
5603 
5604 inline void Message::SetCorrelation(const ostring& value)
5605 {
5606  Check(OCI_MsgSetCorrelation(*this, value.c_str()));
5607 }
5608 
5609 inline ostring Message::GetExceptionQueue() const
5610 {
5611  return MakeString(Check(OCI_MsgGetExceptionQueue(*this)));
5612 }
5613 
5614 inline void Message::SetExceptionQueue(const ostring& value)
5615 {
5616  Check(OCI_MsgSetExceptionQueue(*this, value.c_str()));
5617 }
5618 
5619 inline Agent Message::GetSender() const
5620 {
5621  return Agent(Check(OCI_MsgGetSender(*this)), 0);
5622 }
5623 
5624 inline void Message::SetSender(const Agent &agent)
5625 {
5626  Check(OCI_MsgSetSender(*this, agent));
5627 }
5628 
5629 inline void Message::SetConsumers(std::vector<Agent> &agents)
5630 {
5631  size_t size = agents.size();
5632  ManagedBuffer<OCI_Agent*> buffer(size);
5633 
5634  OCI_Agent ** pAgents = static_cast<OCI_Agent **>(buffer);
5635 
5636  for (size_t i = 0; i < size; i++)
5637  {
5638  pAgents[i] = static_cast<const Agent &>(agents[i]);
5639  }
5640 
5641  Check(OCI_MsgSetConsumers(*this, pAgents, static_cast<unsigned int>(size)));
5642 }
5643 
5644 /* --------------------------------------------------------------------------------------------- *
5645  * Enqueue
5646  * --------------------------------------------------------------------------------------------- */
5647 
5648 inline Enqueue::Enqueue(const TypeInfo &typeInfo, const ostring& queueName)
5649 {
5650  Acquire(Check(OCI_EnqueueCreate(typeInfo, queueName.c_str())), reinterpret_cast<HandleFreeFunc>(OCI_EnqueueFree), 0);
5651 }
5652 
5653 inline void Enqueue::Put(const Message &message)
5654 {
5655  Check(OCI_EnqueuePut(*this, message));
5656 }
5657 
5658 inline Enqueue::EnqueueVisibility Enqueue::GetVisibility() const
5659 {
5660  return EnqueueVisibility(static_cast<EnqueueVisibility::type>(Check(OCI_EnqueueGetVisibility(*this))));
5661 }
5662 
5663 inline void Enqueue::SetVisibility(EnqueueVisibility value)
5664 {
5665  Check(OCI_EnqueueSetVisibility(*this, value));
5666 }
5667 
5668 inline Enqueue::EnqueueMode Enqueue::GetMode() const
5669 {
5670  return EnqueueMode(static_cast<EnqueueMode::type>(Check(OCI_EnqueueGetSequenceDeviation(*this))));
5671 }
5672 
5673 inline void Enqueue::SetMode(EnqueueMode value)
5674 {
5675  Check(OCI_EnqueueSetSequenceDeviation(*this, value));
5676 }
5677 
5678 inline Raw Enqueue::GetRelativeMsgID() const
5679 {
5680  unsigned int size = OCI_SIZE_BUFFER;
5681 
5682  ManagedBuffer<unsigned char> buffer(size + 1);
5683 
5684  Check(OCI_EnqueueGetRelativeMsgID(*this, static_cast<AnyPointer>(buffer), &size));
5685 
5686  return MakeRaw(buffer, size);
5687 }
5688 
5689 inline void Enqueue::SetRelativeMsgID(const Raw &value)
5690 {
5691  Check(OCI_EnqueueSetRelativeMsgID(*this, static_cast<AnyPointer>(const_cast<Raw::value_type *>(value.data())), static_cast<unsigned int>(value.size())));
5692 }
5693 
5694 /* --------------------------------------------------------------------------------------------- *
5695  * Dequeue
5696  * --------------------------------------------------------------------------------------------- */
5697 
5698 inline Dequeue::Dequeue(const TypeInfo &typeInfo, const ostring& queueName)
5699 {
5700  Acquire(Check(OCI_DequeueCreate(typeInfo, queueName.c_str())), reinterpret_cast<HandleFreeFunc>(OCI_DequeueFree), 0);
5701 }
5702 
5703 inline Dequeue::Dequeue(OCI_Dequeue *pDequeue)
5704 {
5705  Acquire(pDequeue, 0, 0);
5706 }
5707 
5708 inline Message Dequeue::Get()
5709 {
5710  return Message(Check(OCI_DequeueGet(*this)), 0);
5711 }
5712 
5713 inline Agent Dequeue::Listen(int timeout)
5714 {
5715  return Agent(Check(OCI_DequeueListen(*this, timeout)), 0);
5716 }
5717 
5718 inline ostring Dequeue::GetConsumer() const
5719 {
5720  return MakeString(Check(OCI_DequeueGetConsumer(*this)));
5721 }
5722 
5723 inline void Dequeue::SetConsumer(const ostring& value)
5724 {
5725  Check(OCI_DequeueSetConsumer(*this, value.c_str()));
5726 }
5727 
5728 inline ostring Dequeue::GetCorrelation() const
5729 {
5730  return MakeString(Check(OCI_DequeueGetCorrelation(*this)));
5731 }
5732 
5733 inline void Dequeue::SetCorrelation(const ostring& value)
5734 {
5735  Check(OCI_DequeueSetCorrelation(*this, value.c_str()));
5736 }
5737 
5738 inline Raw Dequeue::GetRelativeMsgID() const
5739 {
5740  unsigned int size = OCI_SIZE_BUFFER;
5741 
5742  ManagedBuffer<unsigned char> buffer(size + 1);
5743 
5744  Check(OCI_DequeueGetRelativeMsgID(*this, static_cast<AnyPointer>(buffer), &size));
5745 
5746  return MakeRaw(buffer, size);
5747 }
5748 
5749 inline void Dequeue::SetRelativeMsgID(const Raw &value)
5750 {
5751  Check(OCI_DequeueSetRelativeMsgID(*this, static_cast<AnyPointer>(const_cast<Raw::value_type *>(value.data())), static_cast<unsigned int>(value.size())));
5752 }
5753 
5754 inline Dequeue::DequeueVisibility Dequeue::GetVisibility() const
5755 {
5756  return DequeueVisibility((DequeueVisibility::type) Check(OCI_DequeueGetVisibility(*this)));
5757 }
5758 
5759 inline void Dequeue::SetVisibility(DequeueVisibility value)
5760 {
5761  Check(OCI_DequeueSetVisibility(*this, value));
5762 }
5763 
5764 inline Dequeue::DequeueMode Dequeue::GetMode() const
5765 {
5766  return DequeueMode((DequeueMode::type) Check(OCI_DequeueGetMode(*this)));
5767 }
5768 
5769 inline void Dequeue::SetMode(DequeueMode value)
5770 {
5771  Check(OCI_DequeueSetMode(*this, value));
5772 }
5773 
5774 inline Dequeue::NavigationMode Dequeue::GetNavigation() const
5775 {
5776  return NavigationMode((NavigationMode::type) Check(OCI_DequeueGetNavigation(*this)));
5777 }
5778 
5779 inline void Dequeue::SetNavigation(NavigationMode value)
5780 {
5781  Check(OCI_DequeueSetNavigation(*this, value));
5782 }
5783 
5784 inline int Dequeue::GetWaitTime() const
5785 {
5786  return Check(OCI_DequeueGetWaitTime(*this));
5787 }
5788 
5789 inline void Dequeue::SetWaitTime(int value)
5790 {
5791  Check(OCI_DequeueSetWaitTime(*this, value));
5792 }
5793 
5794 inline void Dequeue::SetAgents(std::vector<Agent> &agents)
5795 {
5796  size_t size = agents.size();
5797  ManagedBuffer<OCI_Agent*> buffer(size);
5798 
5799  OCI_Agent ** pAgents = static_cast<OCI_Agent **>(buffer);
5800 
5801  for (size_t i = 0; i < size; i++)
5802  {
5803  pAgents[i] = static_cast<const Agent &>(agents[i]);
5804  }
5805 
5806  Check(OCI_DequeueSetAgentList(*this, pAgents, static_cast<unsigned int>(size)));
5807 }
5808 
5809 inline void Dequeue::Subscribe(unsigned int port, unsigned int timeout, NotifyAQHandlerProc handler)
5810 {
5811  Check(OCI_DequeueSubscribe(*this, port, timeout, static_cast<POCI_NOTIFY_AQ>(handler != 0 ? Environment::NotifyHandlerAQ : 0 )));
5812 
5813  Environment::GetEnvironmentHandle().Callbacks.Set(static_cast<OCI_Dequeue*>(*this), reinterpret_cast<CallbackPointer>(handler));
5814 }
5815 
5816 inline void Dequeue::Unsubscribe()
5817 {
5818  Check(OCI_DequeueUnsubscribe(*this));
5819 }
5820 
5821 /* --------------------------------------------------------------------------------------------- *
5822  * DirectPath
5823  * --------------------------------------------------------------------------------------------- */
5824 
5825 inline DirectPath::DirectPath(const TypeInfo &typeInfo, unsigned int nbCols, unsigned int nbRows, const ostring& partition)
5826 {
5827  Acquire(Check(OCI_DirPathCreate(typeInfo, partition.c_str(), nbCols, nbRows)), reinterpret_cast<HandleFreeFunc>(OCI_DirPathFree), 0);
5828 }
5829 
5830 inline void DirectPath::SetColumn(unsigned int colIndex, const ostring& name, unsigned int maxSize, const ostring& format)
5831 {
5832  Check(OCI_DirPathSetColumn(*this, colIndex, name.c_str(), maxSize, format.c_str()));
5833 }
5834 
5835 template <class TDataType>
5836 inline void DirectPath::SetEntry(unsigned int rowIndex, unsigned int colIndex, const TDataType &value, bool complete)
5837 {
5838  Check(OCI_DirPathSetEntry(*this, rowIndex, colIndex, static_cast<const AnyPointer>(const_cast<typename TDataType::value_type *>(value.c_str())), static_cast<unsigned int>(value.size()), complete));
5839 }
5840 
5841 inline void DirectPath::Reset()
5842 {
5843  Check(OCI_DirPathReset(*this));
5844 }
5845 
5846 inline void DirectPath::Prepare()
5847 {
5848  Check(OCI_DirPathPrepare(*this));
5849 }
5850 
5851 inline DirectPath::Result DirectPath::Convert()
5852 {
5853  return Result((Result::type) Check(OCI_DirPathConvert(*this)));
5854 }
5855 
5856 inline DirectPath::Result DirectPath::Load()
5857 {
5858  return Result((Result::type) Check(OCI_DirPathLoad(*this)));
5859 }
5860 
5861 inline void DirectPath::Finish()
5862 {
5863  Check(OCI_DirPathFinish(*this));
5864 }
5865 
5866 inline void DirectPath::Abort()
5867 {
5868  Check(OCI_DirPathAbort(*this));
5869 }
5870 
5871 inline void DirectPath::Save()
5872 {
5873  Check(OCI_DirPathSave(*this));
5874 }
5875 
5876 inline void DirectPath::FlushRow()
5877 {
5878  Check(OCI_DirPathFlushRow(*this));
5879 }
5880 
5881 inline void DirectPath::SetCurrentRows(unsigned int value)
5882 {
5883  Check(OCI_DirPathSetCurrentRows(*this, value));
5884 }
5885 
5886 inline unsigned int DirectPath::GetCurrentRows() const
5887 {
5888  return Check(OCI_DirPathGetCurrentRows(*this));
5889 }
5890 
5891 inline unsigned int DirectPath::GetMaxRows() const
5892 {
5893  return Check(OCI_DirPathGetMaxRows(*this));
5894 }
5895 
5896 inline unsigned int DirectPath::GetRowCount() const
5897 {
5898  return Check(OCI_DirPathGetRowCount(*this));
5899 }
5900 
5901 inline unsigned int DirectPath::GetAffectedRows() const
5902 {
5903  return Check(OCI_DirPathGetAffectedRows(*this));
5904 }
5905 
5906 inline void DirectPath::SetDateFormat(const ostring& format)
5907 {
5908  Check(OCI_DirPathSetDateFormat(*this, format.c_str()));
5909 }
5910 
5911 inline void DirectPath::SetParallel(bool value)
5912 {
5913  Check(OCI_DirPathSetParallel(*this, value));
5914 }
5915 
5916 inline void DirectPath::SetNoLog(bool value)
5917 {
5918  Check(OCI_DirPathSetNoLog(*this, value));
5919 }
5920 
5921 inline void DirectPath::SetCacheSize(unsigned int value)
5922 {
5923  Check(OCI_DirPathSetCacheSize(*this, value));
5924 }
5925 
5926 inline void DirectPath::SetBufferSize(unsigned int value)
5927 {
5928  Check(OCI_DirPathSetBufferSize(*this, value));
5929 }
5930 
5931 inline void DirectPath::SetConversionMode(ConversionMode value)
5932 {
5933  Check(OCI_DirPathSetConvertMode(*this, value));
5934 }
5935 
5936 inline unsigned int DirectPath::GetErrorColumn()
5937 {
5938  return Check(OCI_DirPathGetErrorColumn(*this));
5939 }
5940 
5941 inline unsigned int DirectPath::GetErrorRow()
5942 {
5943  return Check(OCI_DirPathGetErrorRow(*this));
5944 }
5945 
5946 /* --------------------------------------------------------------------------------------------- *
5947  * Queue
5948  * --------------------------------------------------------------------------------------------- */
5949 
5950 inline void Queue::Create(const Connection &connection, const ostring& queue, const ostring& table, QueueType queueType, unsigned int maxRetries,
5951  unsigned int retryDelay, unsigned int retentionTime, bool dependencyTracking, const ostring& comment)
5952 {
5953  Check(OCI_QueueCreate(connection, queue.c_str(), table.c_str(), queueType, maxRetries, retryDelay, retentionTime, dependencyTracking, comment.c_str()));
5954 }
5955 
5956 inline void Queue::Alter(const Connection &connection, const ostring& queue, unsigned int maxRetries, unsigned int retryDelay, unsigned int retentionTime, const ostring& comment)
5957 {
5958  Check(OCI_QueueAlter(connection, queue.c_str(), maxRetries, retryDelay, retentionTime, comment.c_str()));
5959 }
5960 
5961 inline void Queue::Drop(const Connection &connection, const ostring& queue)
5962 {
5963  Check(OCI_QueueDrop(connection, queue.c_str()));
5964 }
5965 
5966 inline void Queue::Start(const Connection &connection, const ostring& queue, bool enableEnqueue, bool enableDequeue)
5967 {
5968  Check(OCI_QueueStart(connection, queue.c_str(), enableEnqueue, enableDequeue));
5969 }
5970 
5971 inline void Queue::Stop(const Connection &connection, const ostring& queue, bool stopEnqueue, bool stopDequeue, bool wait)
5972 {
5973  Check(OCI_QueueStop(connection, queue.c_str(), stopEnqueue, stopDequeue, wait));
5974 }
5975 
5976 /* --------------------------------------------------------------------------------------------- *
5977  * QueueTable
5978  * --------------------------------------------------------------------------------------------- */
5979 
5980 inline void QueueTable::Create(const Connection &connection, const ostring& table, const ostring& payloadType, bool multipleConsumers, const ostring& storageClause, const ostring& sortList,
5981  GroupingMode groupingMode, const ostring& comment, unsigned int primaryInstance, unsigned int secondaryInstance, const ostring& compatible)
5982 
5983 {
5984  Check(OCI_QueueTableCreate(connection, table.c_str(), payloadType.c_str(), storageClause.c_str(), sortList.c_str(), multipleConsumers,
5985  groupingMode, comment.c_str(), primaryInstance, secondaryInstance, compatible.c_str()));
5986 }
5987 
5988 inline void QueueTable::Alter(const Connection &connection, const ostring& table, const ostring& comment, unsigned int primaryInstance, unsigned int secondaryInstance)
5989 {
5990  Check(OCI_QueueTableAlter(connection, table.c_str(), comment.c_str(), primaryInstance, secondaryInstance));
5991 }
5992 
5993 inline void QueueTable::Drop(const Connection &connection, const ostring& table, bool force)
5994 {
5995  Check(OCI_QueueTableDrop(connection, table.c_str(), force));
5996 }
5997 
5998 inline void QueueTable::Purge(const Connection &connection, const ostring& table, PurgeMode mode, const ostring& condition, bool block)
5999 {
6000  Check(OCI_QueueTablePurge(connection, table.c_str(), condition.c_str(), block, static_cast<unsigned int>(mode)));
6001 }
6002 
6003 inline void QueueTable::Migrate(const Connection &connection, const ostring& table, const ostring& compatible)
6004 {
6005  Check(OCI_QueueTableMigrate(connection, table.c_str(), compatible.c_str()));
6006 }
6007 
6012 }
ostring GetServer() const
Return the Oracle server Hos name of the connected database/service name.
OCI_EXPORT OCI_Subscription *OCI_API OCI_EventGetSubscription(OCI_Event *event)
Return the subscription handle that generated this event.
Oracle Named types representation.
OCI_EXPORT boolean OCI_API OCI_ObjectSetFile(OCI_Object *obj, const otext *attr, OCI_File *value)
Set an object attribute of type File.
Transaction GetTransaction() const
Return the current transaction of the connection.
OCI_EXPORT boolean OCI_API OCI_BindUnsignedBigInt(OCI_Statement *stmt, const otext *name, big_uint *data)
Bind an unsigned big integer variable.
OCI_EXPORT unsigned int OCI_API OCI_GetLongMode(OCI_Statement *stmt)
Return the long datatype handling mode of a SQL statement.
OCI_EXPORT unsigned int OCI_API OCI_EnqueueGetVisibility(OCI_Enqueue *enqueue)
Get the enqueuing/locking behavior.
OCI_EXPORT OCI_Column *OCI_API OCI_GetColumn(OCI_Resultset *rs, unsigned int index)
Return the column object handle at the given index in the resultset.
Oracle Collection item representation.
Encapsulate a Resultset column or object member properties.
Definition: ocilib.hpp:5994
OCI_EXPORT int OCI_API OCI_ErrorGetInternalCode(OCI_Error *err)
Retrieve Internal Error code from error handle.
OCI_EXPORT big_int OCI_API OCI_ElemGetBigInt(OCI_Elem *elem)
Return the big int value of the given collection element.
void SetHours(int value)
Set the interval hours value.
OCI_EXPORT const otext *OCI_API OCI_GetVersionServer(OCI_Connection *con)
Return the connected database server version.
OCI_EXPORT boolean OCI_API OCI_DateLastDay(OCI_Date *date)
Place the last day of month (from the given date) into the given date.
Interval Clone() const
Clone the current instance to a new one performing deep copy.
int GetMilliSeconds() const
Return the interval seconds value.
OCI_EXPORT boolean OCI_API OCI_MsgGetID(OCI_Msg *msg, void *id, unsigned int *len)
Return the ID of the message.
ObjectType GetType() const
Return the type of the given object.
bool operator>(const Date &other) const
Indicates if the current date value is superior to the given date value.
OCI_EXPORT boolean OCI_API OCI_ConnectionFree(OCI_Connection *con)
Close a physical connection to an Oracle database server.
Lob< Raw, LobBinary > Blob
Class handling BLOB oracle type.
Definition: ocilib.hpp:3866
TypeInfo GetTypeInfo() const
Return the TypeInfo object describing the referenced object.
OCI_EXPORT boolean OCI_API OCI_QueueStart(OCI_Connection *con, const otext *queue_name, boolean enqueue, boolean dequeue)
Start the given queue.
OCI_EXPORT boolean OCI_API OCI_DequeueSubscribe(OCI_Dequeue *dequeue, unsigned int port, unsigned int timeout, POCI_NOTIFY_AQ callback)
Subscribe for asynchronous messages notifications.
OCI_EXPORT const otext *OCI_API OCI_ServerGetOutput(OCI_Connection *con)
Retrieve one line of the server buffer.
OCI_EXPORT boolean OCI_API OCI_ColumnGetCharUsed(OCI_Column *col)
Return TRUE if the length of the column is character-length or FALSE if it is byte-length.
OCI_EXPORT boolean OCI_API OCI_SubscriptionUnregister(OCI_Subscription *sub)
Unregister a previously registered notification.
long long big_int
big_int is a C scalar integer (32 or 64 bits) depending on compiler support for 64bits integers...
Definition: ocilib.h:1048
OCI_EXPORT unsigned int OCI_API OCI_LobGetType(OCI_Lob *lob)
Return the type of the given Lob object.
void Open(const ostring &db, const ostring &user, const ostring &pwd, Pool::PoolType poolType, unsigned int minSize, unsigned int maxSize, unsigned int increment=1, Environment::SessionFlags sessionFlags=Environment::SessionDefault)
Create an Oracle pool of connections or sessions.
static void Initialize(EnvironmentFlags mode=Environment::Default, const ostring &libpath=OTEXT(""))
Initialize the OCILIB environment.
OCI_EXPORT boolean OCI_API OCI_CollClear(OCI_Coll *coll)
clear all items of the given collection
OCI_EXPORT boolean OCI_API OCI_BindSetNullAtPos(OCI_Bind *bnd, unsigned int position)
Set to null the entry in the bind variable input array.
OCI_EXPORT OCI_Object *OCI_API OCI_ObjectCreate(OCI_Connection *con, OCI_TypeInfo *typinf)
Create a local object instance.
Timestamp & operator-=(int value)
Decrement the Timestamp by the given number of days.
OCI_EXPORT unsigned int OCI_API OCI_MsgGetState(OCI_Msg *msg)
Return the state of the message at the time of the dequeue.
OCI_EXPORT boolean OCI_API OCI_ElemSetNull(OCI_Elem *elem)
Set a collection element value to null.
int GetHours() const
Return the timestamp hours value.
OCI_EXPORT boolean OCI_API OCI_ObjectSetLob(OCI_Object *obj, const otext *attr, OCI_Lob *value)
Set an object attribute of type Lob.
OCI_EXPORT boolean OCI_API OCI_ExecuteStmt(OCI_Statement *stmt, const otext *sql)
Prepare and Execute a SQL statement or PL/SQL block.
int GetYear() const
Return the date year value.
ostring ToString(const ostring &format=OCI_STRING_FORMAT_DATE, int precision=0) const
Convert the timestamp value to a string.
OCI_EXPORT boolean OCI_API OCI_ObjectSetNull(OCI_Object *obj, const otext *attr)
Set an object attribute to null.
bool IsElementNull(unsigned int index) const
check if the element at the given index is null
OCI_EXPORT OCI_Column *OCI_API OCI_GetColumn2(OCI_Resultset *rs, const otext *name)
Return the column object handle from its name in the resultset.
OCI_EXPORT boolean OCI_API OCI_DateAddDays(OCI_Date *date, int nb)
Add or subtract days to a date handle.
OCI_EXPORT boolean OCI_API OCI_RegisterUnsignedShort(OCI_Statement *stmt, const otext *name)
Register an unsigned short output bind placeholder.
void Truncate(big_uint length)
Truncate the lob to a shorter length.
OCI_EXPORT boolean OCI_API OCI_RegisterUnsignedBigInt(OCI_Statement *stmt, const otext *name)
Register an unsigned big integer output bind placeholder.
void(* NotifyAQHandlerProc)(Dequeue &dequeue)
User callback for dequeue event notifications.
Definition: ocilib.hpp:7065
OCI_EXPORT boolean OCI_API OCI_EnqueueSetRelativeMsgID(OCI_Enqueue *enqueue, const void *id, unsigned int len)
Set a message identifier to use for enqueuing messages using a sequence deviation.
unsigned int GetTimeout() const
Return the transaction Timeout.
OCI_EXPORT boolean OCI_API OCI_RegisterFile(OCI_Statement *stmt, const otext *name, unsigned int type)
Register a file output bind placeholder.
void SetTAFHandler(TAFHandlerProc handler)
Set the Transparent Application Failover (TAF) user handler.
OCI_EXPORT unsigned int OCI_API OCI_GetPrefetchSize(OCI_Statement *stmt)
Return the number of rows pre-fetched by OCI Client.
OCI_EXPORT boolean OCI_API OCI_RegisterDate(OCI_Statement *stmt, const otext *name)
Register a date output bind placeholder.
static void EnableWarnings(bool value)
Enable or disable Oracle warning notifications.
Date operator-(int value)
Return a new date holding the current date value decremented by the given number of days...
OCI_EXPORT OCI_Statement *OCI_API OCI_StatementCreate(OCI_Connection *con)
Create a statement object and return its handle.
OCI_EXPORT boolean OCI_API OCI_ServerDisableOutput(OCI_Connection *con)
Disable the server output.
Oracle Transaction.
OCI_EXPORT boolean OCI_API OCI_BindUnsignedInt(OCI_Statement *stmt, const otext *name, unsigned int *data)
Bind an unsigned integer variable.
OCI_EXPORT boolean OCI_API OCI_RefSetNull(OCI_Ref *ref)
Nullify the given Ref handle.
bool Delete(unsigned int index) const
Delete the element at the given position in the Nested Table Collection.
OCI_EXPORT int OCI_API OCI_ObjectGetInt(OCI_Object *obj, const otext *attr)
Return the integer value of the given object attribute.
OCI_EXPORT boolean OCI_API OCI_ThreadRun(OCI_Thread *thread, POCI_THREAD proc, void *arg)
Execute the given routine within the given thread object.
Reference Clone() const
Clone the current instance to a new one performing deep copy.
Timestamp operator-(int value)
Return a new Timestamp holding the current Timestamp value decremented by the given number of days...
Exception class handling all OCILIB errors.
Definition: ocilib.hpp:433
OCI_EXPORT unsigned int OCI_API OCI_GetLongMaxSize(OCI_Statement *stmt)
Return the LONG data type piece buffer size.
void SetMinutes(int value)
Set the date minutes value.
OCI_EXPORT boolean OCI_API OCI_BindSetNotNullAtPos(OCI_Bind *bnd, unsigned int position)
Set to NOT null the entry in the bind variable input array.
int GetOracleErrorCode() const
Return the Oracle error code.
OCI_EXPORT unsigned int OCI_API OCI_IntervalGetType(OCI_Interval *itv)
Return the type of the given Interval object.
OCI_EXPORT boolean OCI_API OCI_SetDefaultFormatDate(OCI_Connection *con, const otext *format)
Set the date format for implicit string / date conversions.
Provides SQL bind informations.
Definition: ocilib.hpp:4752
OCI_EXPORT boolean OCI_API OCI_SetDefaultFormatNumeric(OCI_Connection *con, const otext *format)
Set the numeric format for implicit string / numeric conversions.
OCI_EXPORT boolean OCI_API OCI_DequeueFree(OCI_Dequeue *dequeue)
Free a Dequeue object.
Timestamp operator+(int value)
Return a new Timestamp holding the current Timestamp value incremented by the given number of days...
ostring GetDatabase() const
Return the Oracle server database name of the connected database/service name.
OCI_EXPORT OCI_Connection *OCI_API OCI_ErrorGetConnection(OCI_Error *err)
Retrieve connection handle within the error occurred.
unsigned int GetServerMinorVersion() const
Return the minor version number of the connected database server.
void SetTrace(SessionTrace trace, const ostring &value)
Set tracing information for the session.
OCI_EXPORT boolean OCI_API OCI_FileAssign(OCI_File *file, OCI_File *file_src)
Assign a file to another one.
OCI_EXPORT boolean OCI_API OCI_DateFromText(OCI_Date *date, const otext *str, const otext *fmt)
Convert a string to a date and store it in the given date handle.
OCI_EXPORT const otext *OCI_API OCI_GetUserName(OCI_Connection *con)
Return the current logged user name.
OCI_EXPORT const otext *OCI_API OCI_ColumnGetSQLType(OCI_Column *col)
Return the Oracle SQL type name of the column data type.
OCI_EXPORT boolean OCI_API OCI_PoolSetStatementCacheSize(OCI_Pool *pool, unsigned int value)
Set the maximum number of statements to keep in the pool statement cache.
OCI_EXPORT boolean OCI_API OCI_DequeueSetWaitTime(OCI_Dequeue *dequeue, int timeout)
set the time that OCIDequeueGet() waits for messages if no messages are currently available ...
OCI_EXPORT boolean OCI_API OCI_FetchPrev(OCI_Resultset *rs)
Fetch the previous row of the resultset.
Oracle Long data type.
OCI_EXPORT boolean OCI_API OCI_DequeueSetNavigation(OCI_Dequeue *dequeue, unsigned int position)
Set the position of messages to be retrieved.
OCI_EXPORT boolean OCI_API OCI_IsNull(OCI_Resultset *rs, unsigned int index)
Check if the current row value is null for the column at the given index in the resultset.
OCI_EXPORT unsigned int OCI_API OCI_ElemGetUnsignedInt(OCI_Elem *elem)
Return the unsigned int value of the given collection element.
OCI_EXPORT boolean OCI_API OCI_SetUserPassword(const otext *db, const otext *user, const otext *pwd, const otext *new_pwd)
Change the password of the given user on the given database.
OCI_EXPORT boolean OCI_API OCI_ObjectSetRaw(OCI_Object *obj, const otext *attr, void *value, unsigned int len)
Set an object attribute of type RAW.
OCI_EXPORT const otext *OCI_API OCI_ObjectGetString(OCI_Object *obj, const otext *attr)
Return the string value of the given object attribute.
OCI_EXPORT big_uint OCI_API OCI_LobGetOffset(OCI_Lob *lob)
Return the current position in the Lob content buffer.
OCI_EXPORT boolean OCI_API OCI_IntervalSubtract(OCI_Interval *itv, OCI_Interval *itv2)
Subtract an interval handle value from another.
OCI_EXPORT unsigned int OCI_API OCI_ColumnGetFullSQLType(OCI_Column *col, otext *buffer, unsigned int len)
Return the Oracle SQL Full name including precision and size of the column datatype.
void SetDefaultLobPrefetchSize(unsigned int value)
Enable or disable prefetching for all LOBs fetched in the connection.
void ChangePassword(const ostring &newPwd)
Change the password of the logged user.
OCI_EXPORT double OCI_API OCI_ObjectGetDouble(OCI_Object *obj, const otext *attr)
Return the double value of the given object attribute.
OCI_EXPORT boolean OCI_API OCI_BindString(OCI_Statement *stmt, const otext *name, otext *data, unsigned int len)
Bind a string variable.
int GetInternalErrorCode() const
Return the OCILIB error code.
OCI_EXPORT unsigned int OCI_API OCI_ObjectGetType(OCI_Object *obj)
Return the type of an object instance.
void GetDateTime(int &year, int &month, int &day, int &hour, int &min, int &sec) const
Extract the date and time parts.
ostring GetInstance() const
Return the Oracle server Instance name of the connected database/service name.
void(* HAHandlerProc)(Connection &con, HAEventSource eventSource, HAEventType eventType, Timestamp &time)
User callback for HA event notifications.
Definition: ocilib.hpp:829
OCI_EXPORT OCI_Enqueue *OCI_API OCI_EnqueueCreate(OCI_TypeInfo *typinf, const otext *name)
Create a Enqueue object for the given queue.
OCI_EXPORT OCI_Elem *OCI_API OCI_ElemCreate(OCI_TypeInfo *typinf)
Create a local collection element instance based on a collection type descriptor. ...
OCI_EXPORT boolean OCI_API OCI_ElemSetRaw(OCI_Elem *elem, void *value, unsigned int len)
Set a RAW value to a collection element.
ostring GetUserName() const
Return the current logged user name.
OCI_EXPORT const otext *OCI_API OCI_ColumnGetName(OCI_Column *col)
Return the name of the given column.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfUnsignedShorts(OCI_Statement *stmt, const otext *name, unsigned short *data, unsigned int nbelem)
Bind an array of unsigned shorts.
OCI_EXPORT int OCI_API OCI_ObjectGetRaw(OCI_Object *obj, const otext *attr, void *value, unsigned int len)
Return the raw attribute value of the given object attribute into the given buffer.
OCI_EXPORT boolean OCI_API OCI_BindArraySetSize(OCI_Statement *stmt, unsigned int size)
Set the input array size for bulk operations.
OCI_EXPORT OCI_File *OCI_API OCI_ElemGetFile(OCI_Elem *elem)
Return the File value of the given collection element.
OCI_EXPORT OCI_Connection *OCI_API OCI_PoolGetConnection(OCI_Pool *pool, const otext *tag)
Get a connection from the pool.
void SetAutoCommit(bool enabled)
Enable or disable auto commit mode (implicit commits after every SQL execution)
OCI_EXPORT boolean OCI_API OCI_IntervalFromTimeZone(OCI_Interval *itv, const otext *str)
Correct an interval handle value with the given time zone.
OCI_EXPORT unsigned int OCI_API OCI_GetImportMode(void)
Return the Oracle shared library import mode.
OCI_EXPORT unsigned int OCI_API OCI_BindGetDirection(OCI_Bind *bnd)
Get the direction mode of a bind handle.
Long< Raw, LongBinary > Blong
Class handling LONG RAW oracle type.
OCI_EXPORT OCI_Connection *OCI_API OCI_FileGetConnection(OCI_File *file)
Retrieve connection handle from the file handle.
OCI_EXPORT boolean OCI_API OCI_SetBindMode(OCI_Statement *stmt, unsigned int mode)
Set the binding mode of a SQL statement.
OCI_EXPORT boolean OCI_API OCI_ObjectToText(OCI_Object *obj, unsigned int *size, otext *str)
Convert an object handle value to a string.
OCI_EXPORT boolean OCI_API OCI_DequeueSetVisibility(OCI_Dequeue *dequeue, unsigned int visibility)
Set whether the new message is dequeued as part of the current transaction.
OCI_EXPORT OCI_Statement *OCI_API OCI_GetStatement(OCI_Resultset *rs, unsigned int index)
Return the current cursor value (Nested table) of the column at the given index in the resultset...
OCI_EXPORT boolean OCI_API OCI_FileExists(OCI_File *file)
Check if the given file exists on server.
OCI_EXPORT boolean OCI_API OCI_FetchLast(OCI_Resultset *rs)
Fetch the last row of the resultset.
bool operator==(const Timestamp &other) const
Indicates if the current Timestamp value is equal to the given Timestamp value.
int GetMonth() const
Return the interval month value.
ostring MakeString(const otext *result)
Internal usage. Constructs a C++ string object from the given OCILIB string pointer.
Definition: ocilib_impl.hpp:70
OCI_EXPORT boolean OCI_API OCI_BindStatement(OCI_Statement *stmt, const otext *name, OCI_Statement *data)
Bind a Statement variable (PL/SQL Ref Cursor)
OCI_EXPORT boolean OCI_API OCI_ObjectSetShort(OCI_Object *obj, const otext *attr, short value)
Set an object attribute of type short.
OCI_EXPORT boolean OCI_API OCI_DateAddMonths(OCI_Date *date, int nb)
Add or subtract months to a date handle.
bool operator==(const Lob &other) const
Indicates if the current lob value is equal to the given lob value.
void Forget()
Cancel the prepared global transaction validation.
void ChangeTimeZone(const ostring &tzSrc, const ostring &tzDst)
Convert the date from one zone to another zone.
OCI_EXPORT boolean OCI_API OCI_MutexAcquire(OCI_Mutex *mutex)
Acquire a mutex lock.
OCI_EXPORT boolean OCI_API OCI_ElemSetString(OCI_Elem *elem, const otext *value)
Set a string value to a collection element.
void SetDaySecond(int day, int hour, int min, int sec, int fsec)
Set the Day / Second parts.
OCI_EXPORT boolean OCI_API OCI_Ping(OCI_Connection *con)
Makes a round trip call to the server to confirm that the connection and the server are active...
OCI_EXPORT unsigned int OCI_API OCI_GetAffectedRows(OCI_Statement *stmt)
Return the number of rows affected by the SQL statement.
OCI_EXPORT unsigned int OCI_API OCI_LobRead(OCI_Lob *lob, void *buffer, unsigned int len)
[OBSOLETE] Read a portion of a lob into the given buffer
void Open()
Open a file for reading on the server.
void SetHours(int value)
Set the timestamp hours value.
void GetTime(int &hour, int &min, int &sec) const
Extract time parts.
OCILIB encapsulation of OCI mutexes.
OCI_EXPORT unsigned short OCI_API OCI_GetUnsignedShort2(OCI_Resultset *rs, const otext *name)
Return the current unsigned short value of the column from its name in the resultset.
OCI_EXPORT boolean OCI_API OCI_ElemSetInterval(OCI_Elem *elem, OCI_Interval *value)
Assign an Interval handle to a collection element.
Date operator+(int value)
Return a new date holding the current date value incremented by the given number of days...
OCI_EXPORT unsigned int OCI_API OCI_PoolGetStatementCacheSize(OCI_Pool *pool)
Return the maximum number of statements to keep in the pool statement cache.
OCI_EXPORT boolean OCI_API OCI_BindDouble(OCI_Statement *stmt, const otext *name, double *data)
Bind a double variable.
OCI_EXPORT OCI_Ref *OCI_API OCI_ObjectGetRef(OCI_Object *obj, const otext *attr)
Return the Ref value of the given object attribute.
OCI_EXPORT boolean OCI_API OCI_ObjectSetDouble(OCI_Object *obj, const otext *attr, double value)
Set an object attribute of type double.
OCI_EXPORT OCI_Lob *OCI_API OCI_GetLob2(OCI_Resultset *rs, const otext *name)
Return the current lob value of the column from its name in the resultset.
Enum< LobTypeValues > LobType
Type of Lob.
Definition: ocilib.hpp:400
OCI_EXPORT int OCI_API OCI_ColumnGetScale(OCI_Column *col)
Return the scale of the column for numeric columns.
static void Release(MutexHandle handle)
Release a mutex lock.
Statement GetStatement() const
Return the statement within the error occurred.
OCI_EXPORT boolean OCI_API OCI_SetDefaultLobPrefetchSize(OCI_Connection *con, unsigned int value)
Enable or disable prefetching for all LOBs fetched in the connection.
OCI_EXPORT boolean OCI_API OCI_CollDeleteElem(OCI_Coll *coll, unsigned int index)
Delete the element at the given position in the Nested Table Collection.
OCI_EXPORT boolean OCI_API OCI_TimestampFromText(OCI_Timestamp *tmsp, const otext *str, const otext *fmt)
Convert a string to a timestamp and store it in the given timestamp handle.
OCI_EXPORT int OCI_API OCI_DateCompare(OCI_Date *date, OCI_Date *date2)
Compares two date handles.
OCI_EXPORT boolean OCI_API OCI_MsgSetOriginalID(OCI_Msg *msg, const void *id, unsigned int len)
Set the original ID of the message in the last queue that generated this message. ...
ostring GetDomain() const
Return the Oracle server Domain name of the connected database/service name.
OCI_EXPORT OCI_Interval *OCI_API OCI_GetInterval(OCI_Resultset *rs, unsigned int index)
Return the current interval value of the column at the given index in the resultset.
OCI_EXPORT boolean OCI_API OCI_ObjectSetRef(OCI_Object *obj, const otext *attr, OCI_Ref *value)
Set an object attribute of type Ref.
Global transaction identifier.
Definition: ocilib.h:956
OCI_EXPORT OCI_Bind *OCI_API OCI_GetBind(OCI_Statement *stmt, unsigned int index)
Return the bind handle at the given index in the internal array of bind handle.
unsigned int GetDefaultLobPrefetchSize() const
Return the default LOB prefetch buffer size for the connection.
OCI_EXPORT OCI_Lob *OCI_API OCI_ObjectGetLob(OCI_Object *obj, const otext *attr)
Return the lob value of the given object attribute.
Object used for executing SQL or PL/SQL statement and returning the produced results.
Definition: ocilib.hpp:4907
int GetDay() const
Return the interval day value.
OCI_EXPORT boolean OCI_API OCI_MsgGetOriginalID(OCI_Msg *msg, void *id, unsigned int *len)
Return the original ID of the message in the last queue that generated this message.
Encapsulates an Oracle or OCILIB exception.
static void ShutdownDatabase(const ostring &db, const ostring &user, const ostring &pwd, Environment::ShutdownFlags shutdownFlags, Environment::ShutdownMode shutdownMode, Environment::SessionFlags sessionFlags=SessionSysDba)
Shutdown a database instance.
A connection or session with a specific database.
Definition: ocilib.hpp:1465
OCI_EXPORT boolean OCI_API OCI_DirPathSetBufferSize(OCI_DirPath *dp, unsigned int size)
Set the size of the internal stream transfer buffer.
OCI_EXPORT boolean OCI_API OCI_Commit(OCI_Connection *con)
Commit current pending changes.
OCI_EXPORT OCI_Ref *OCI_API OCI_GetRef(OCI_Resultset *rs, unsigned int index)
Return the current Ref value of the column at the given index in the resultset.
void Convert(const Timestamp &other)
Convert the current timestamp to the type of the given timestamp.
OCI_EXPORT boolean OCI_API OCI_StatementFree(OCI_Statement *stmt)
Free a statement and all resources associated to it (resultsets ...)
Iterator end()
Returns an iterator referring to the past-the-end element in the collection.
OCI_EXPORT const otext *OCI_API OCI_GetString(OCI_Resultset *rs, unsigned int index)
Return the current string value of the column at the given index in the resultset.
unsigned int Write(const TLongObjectType &content)
Write the given string into the long Object.
void Close()
Close the physical connection to the DB server.
OCI_EXPORT boolean OCI_API OCI_ElemSetBigInt(OCI_Elem *elem, big_int value)
Set a big int value to a collection element.
unsigned int GetLength() const
Return the buffer length.
OCI_EXPORT unsigned int OCI_API OCI_ErrorGetType(OCI_Error *err)
Retrieve the type of error from error handle.
OCI_EXPORT int OCI_API OCI_DateCheck(OCI_Date *date)
Check if the given date is valid.
Timestamp & operator+=(int value)
Increment the Timestamp by the given number of days.
void SetYear(int value)
Set the interval year value.
OCI_EXPORT boolean OCI_API OCI_BindBigInt(OCI_Statement *stmt, const otext *name, big_int *data)
Bind a big integer variable.
OCI_EXPORT unsigned int OCI_API OCI_DirPathLoad(OCI_DirPath *dp)
Loads the data converted to direct path stream format.
OCI_EXPORT OCI_Date *OCI_API OCI_GetDate(OCI_Resultset *rs, unsigned int index)
Return the current date value of the column at the given index in the resultset.
OCI_EXPORT boolean OCI_API OCI_Break(OCI_Connection *con)
Perform an immediate abort of any currently Oracle OCI call.
void GetDateTime(int &year, int &month, int &day, int &hour, int &min, int &sec, int &fsec) const
Extract date and time parts.
unsigned int GetMinSize() const
Return the minimum number of connections/sessions that can be opened to the database.
Internal bind representation.
OCI_EXPORT boolean OCI_API OCI_SetTAFHandler(OCI_Connection *con, POCI_TAF_HANDLER handler)
Set the Transparent Application Failover (TAF) user handler.
OCI_EXPORT boolean OCI_API OCI_DirPathFree(OCI_DirPath *dp)
Free an OCI_DirPath handle.
static void Join(ThreadHandle handle)
Join the given thread.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfIntervals(OCI_Statement *stmt, const otext *name, OCI_Interval **data, unsigned int type, unsigned int nbelem)
Bind an array of interval handles.
OCI_EXPORT unsigned int OCI_API OCI_FileRead(OCI_File *file, void *buffer, unsigned int len)
Read a portion of a file into the given buffer.
Object identifying the SQL data type LONG.
Definition: ocilib.hpp:4697
OCI_EXPORT boolean OCI_API OCI_DateFree(OCI_Date *date)
Free a date object.
OCI_EXPORT const otext *OCI_API OCI_MsgGetExceptionQueue(OCI_Msg *msg)
Get the Exception queue name of the message.
Oracle Transaction object.
Definition: ocilib.hpp:2195
OCI_EXPORT OCI_Object *OCI_API OCI_GetObject2(OCI_Resultset *rs, const otext *name)
Return the current Object value of the column from its name in the resultset.
OCI_EXPORT boolean OCI_API OCI_GetAutoCommit(OCI_Connection *con)
Get current auto commit mode status.
OCI_EXPORT unsigned short OCI_API OCI_ElemGetUnsignedShort(OCI_Elem *elem)
Return the unsigned short value of the given collection element.
int GetMinutes() const
Return the date minutes value.
OCI_EXPORT OCI_Ref *OCI_API OCI_GetRef2(OCI_Resultset *rs, const otext *name)
Return the current Ref value of the column from its name in the resultset.
OCI_EXPORT big_uint OCI_API OCI_FileGetSize(OCI_File *file)
Return the size in bytes of a file.
int GetYear() const
Return the interval year value.
OCI_EXPORT OCI_File *OCI_API OCI_GetFile2(OCI_Resultset *rs, const otext *name)
Return the current File value of the column from its name in the resultset.
void SetMinutes(int value)
Set the interval minutes value.
Raw MakeRaw(void *result, unsigned int size)
Internal usage. Constructs a C++ Raw object from the given OCILIB raw buffer.
Definition: ocilib_impl.hpp:76
OCI_EXPORT boolean OCI_API OCI_BindInterval(OCI_Statement *stmt, const otext *name, OCI_Interval *data)
Bind an interval variable.
OCI_EXPORT boolean OCI_API OCI_FileSetName(OCI_File *file, const otext *dir, const otext *name)
Set the directory and file name of FILE handle.
OCI_EXPORT int OCI_API OCI_ErrorGetOCICode(OCI_Error *err)
Retrieve Oracle Error code from error handle.
OCI_EXPORT const otext *OCI_API OCI_MsgGetCorrelation(OCI_Msg *msg)
Get the correlation identifier of the message.
ostring GetSessionTag() const
Return the tag associated with the given connection.
OCI_EXPORT int OCI_API OCI_DateAssign(OCI_Date *date, OCI_Date *date_src)
Assign the value of a date handle to another one.
OCI_EXPORT boolean OCI_API OCI_BindInt(OCI_Statement *stmt, const otext *name, int *data)
Bind an integer variable.
OCI_EXPORT boolean OCI_API OCI_ThreadKeyCreate(const otext *name, POCI_THREADKEYDEST destfunc)
Create a thread key object.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfTimestamps(OCI_Statement *stmt, const otext *name, OCI_Timestamp **data, unsigned int type, unsigned int nbelem)
Bind an array of timestamp handles.
OCI_EXPORT boolean OCI_API OCI_ObjectSetObject(OCI_Object *obj, const otext *attr, OCI_Object *value)
Set an object attribute of type Object.
Enum< ObjectTypeValues > ObjectType
Object Type.
Definition: ocilib.hpp:4193
OCI_EXPORT boolean OCI_API OCI_TimestampGetDateTime(OCI_Timestamp *tmsp, int *year, int *month, int *day, int *hour, int *min, int *sec, int *fsec)
Extract the date and time parts from a date handle.
static Environment::EnvironmentFlags GetMode()
Return the Environment mode flags.
TimestampTypeValues
Interval types enumerated values.
Definition: ocilib.hpp:3107
void Clear()
Clear all items of the collection.
OCI_EXPORT boolean OCI_API OCI_BindFile(OCI_Statement *stmt, const otext *name, OCI_File *data)
Bind a File variable.
Object GetObject() const
Returns the object pointed by the reference.
AQ identified agent for messages delivery.
Definition: ocilib.hpp:6446
Lob & operator+=(const Lob &other)
Appending the given lob content to the current lob content.
TDataType Get(const ostring &name) const
Return the given object attribute value.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfShorts(OCI_Statement *stmt, const otext *name, short *data, unsigned int nbelem)
Bind an array of shorts.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfDoubles(OCI_Statement *stmt, const otext *name, double *data, unsigned int nbelem)
Bind an array of doubles.
void SetSeconds(int value)
Set the date seconds value.
OCI_EXPORT OCI_Statement *OCI_API OCI_ResultsetGetStatement(OCI_Resultset *rs)
Return the statement handle associated with a resultset handle.
OCI_EXPORT short OCI_API OCI_ObjectGetShort(OCI_Object *obj, const otext *attr)
Return the short value of the given object attribute.
OCI_EXPORT boolean OCI_API OCI_ObjectSetColl(OCI_Object *obj, const otext *attr, OCI_Coll *value)
Set an object attribute of type Collection.
OCI_EXPORT int OCI_API OCI_TimestampCompare(OCI_Timestamp *tmsp, OCI_Timestamp *tmsp2)
Compares two timestamp handles.
Collection Clone() const
Clone the current instance to a new one performing deep copy.
OCI_EXPORT double OCI_API OCI_GetDouble2(OCI_Resultset *rs, const otext *name)
Return the current double value of the column from its name in the resultset.
void GetDate(int &year, int &month, int &day) const
Extract the date parts.
OCI_EXPORT boolean OCI_API OCI_BindObject(OCI_Statement *stmt, const otext *name, OCI_Object *data)
Bind an object (named type) variable.
OCI_EXPORT const otext *OCI_API OCI_SubscriptionGetName(OCI_Subscription *sub)
Return the name of the given registered subscription.
static Environment::ImportMode GetImportMode()
Return the Oracle shared library import mode.
OCI_EXPORT unsigned int OCI_API OCI_PoolGetOpenedCount(OCI_Pool *pool)
Return the current number of opened connections/sessions.
OCI_EXPORT OCI_Connection *OCI_API OCI_TypeInfoGetConnection(OCI_TypeInfo *typinf)
Retrieve connection handle from the type info handle.
OCI_EXPORT unsigned int OCI_API OCI_ColumnGetSubType(OCI_Column *col)
Return the OCILIB object subtype of a column.
OCI_EXPORT boolean OCI_API OCI_FileIsOpen(OCI_File *file)
Check if the specified file is opened within the file handle.
OCI_EXPORT int OCI_API OCI_GetInt2(OCI_Resultset *rs, const otext *name)
Return the current integer value of the column from its name in the resultset.
OCI_EXPORT boolean OCI_API OCI_PoolSetNoWait(OCI_Pool *pool, boolean value)
Set the waiting mode used when no more connections/sessions are available from the pool...
Class used for handling transient collection value. it is used internally by:
Definition: ocilib.hpp:4607
OCI_EXPORT boolean OCI_API OCI_DateGetDateTime(OCI_Date *date, int *year, int *month, int *day, int *hour, int *min, int *sec)
Extract the date and time parts from a date handle.
OCI_EXPORT OCI_Long *OCI_API OCI_GetLong(OCI_Resultset *rs, unsigned int index)
Return the current Long value of the column at the given index in the resultset.
OCI_EXPORT const otext *OCI_API OCI_EventGetObject(OCI_Event *event)
Return the name of the object that generated the event.
unsigned int Append(const TLobObjectType &content)
Append the given content to the lob.
OCI_EXPORT big_uint OCI_API OCI_ObjectGetUnsignedBigInt(OCI_Object *obj, const otext *attr)
Return the unsigned big integer value of the given object attribute.
OCI_EXPORT big_uint OCI_API OCI_GetUnsignedBigInt2(OCI_Resultset *rs, const otext *name)
Return the current unsigned big integer value of the column from its name in the resultset.
Object Clone() const
Clone the current instance to a new one performing deep copy.
OCI_EXPORT OCI_Timestamp *OCI_API OCI_GetInstanceStartTime(OCI_Connection *con)
Return the date and time (Timestamp) server instance start of the connected database/service name...
OCI_EXPORT OCI_Date *OCI_API OCI_GetDate2(OCI_Resultset *rs, const otext *name)
Return the current date value of the column from its name in the resultset.
OCI_EXPORT unsigned int OCI_API OCI_PoolGetIncrement(OCI_Pool *pool)
Return the increment for connections/sessions to be opened to the database when the pool is not full...
OCI_EXPORT boolean OCI_API OCI_DequeueSetConsumer(OCI_Dequeue *dequeue, const otext *consumer)
Set the current consumer name to retrieve message for.
OCI_EXPORT const otext *OCI_API OCI_GetSessionTag(OCI_Connection *con)
Return the tag associated the given connection.
OCI_EXPORT unsigned int OCI_API OCI_ElemGetRawSize(OCI_Elem *elem)
Return the raw attribute value size of the given element handle.
bool IsServerAlive() const
Indicate if the connection is still connected to the server.
OCI_EXPORT boolean OCI_API OCI_QueueTableAlter(OCI_Connection *con, const otext *queue_table, const otext *comment, unsigned int primary_instance, unsigned int secondary_instance)
Alter the given queue table.
OCI_EXPORT const otext *OCI_API OCI_TypeInfoGetName(OCI_TypeInfo *typinf)
Return the name described by the type info object.
OCI_EXPORT boolean OCI_API OCI_MsgReset(OCI_Msg *msg)
Reset all attributes of a message object.
void SetStatementCacheSize(unsigned int value)
Set the maximum number of statements to keep in the pool's statement cache.
void FromString(const ostring &str, const ostring &format=OCI_STRING_FORMAT_DATE)
Assign to the date object the value provided by the input date time string.
OCI_EXPORT boolean OCI_API OCI_AgentSetName(OCI_Agent *agent, const otext *name)
Set the given AQ agent name.
bool PingServer() const
Performs a round trip call to the server to confirm that the connection to the server is still valid...
OCI_EXPORT boolean OCI_API OCI_QueueTablePurge(OCI_Connection *con, const otext *queue_table, const otext *purge_condition, boolean block, unsigned int delivery_mode)
Purge messages from the given queue table.
bool IsTAFCapable() const
Verify if the connection support TAF events.
OCI_EXPORT unsigned int OCI_API OCI_PoolGetMax(OCI_Pool *pool)
Return the maximum number of connections/sessions that can be opened to the database.
OCI_EXPORT boolean OCI_API OCI_LobIsEqual(OCI_Lob *lob, OCI_Lob *lob2)
Compare two lob handles for equality.
ostring GetDefaultNumericFormat() const
Return the current numeric format for implicit string / numeric conversions.
void Truncate(unsigned int size)
Trim the given number of elements from the end of the collection.
Object(const TypeInfo &typeInfo)
Parametrized constructor.
OCI_EXPORT boolean OCI_API OCI_LobAssign(OCI_Lob *lob, OCI_Lob *lob_src)
Assign a lob to another one.
OCI_EXPORT big_uint OCI_API OCI_LobErase(OCI_Lob *lob, big_uint offset, big_uint len)
Erase a portion of the lob at a given position.
void SetDefaultDateFormat(const ostring &format)
Set the date format for implicit string / date conversions.
OCI_EXPORT const otext *OCI_API OCI_GetString2(OCI_Resultset *rs, const otext *name)
Return the current string value of the column from its name in the resultset.
OCI_EXPORT OCI_TypeInfo *OCI_API OCI_CollGetTypeInfo(OCI_Coll *coll)
Return the type info object associated to the collection.
ostring GetService() const
Return the Oracle server Service name of the connected database/service name.
Template Enum template class providing some type safety to some extends for manipulating enum variabl...
OCI_EXPORT unsigned int OCI_API OCI_LobGetChunkSize(OCI_Lob *lob)
Returns the chunk size of a LOB.
File Clone() const
Clone the current instance to a new one performing deep copy.
OCI_EXPORT boolean OCI_API OCI_RefToText(OCI_Ref *ref, unsigned int size, otext *str)
Converts a Ref handle value to a hexadecimal string.
OCI_EXPORT boolean OCI_API OCI_ThreadJoin(OCI_Thread *thread)
Join the given thread.
OCI_EXPORT unsigned int OCI_API OCI_GetCharset(void)
Return the OCILIB charset type.
Timestamp & operator++()
Increment the timestamp by 1 day.
OCI_EXPORT float OCI_API OCI_ElemGetFloat(OCI_Elem *elem)
Return the float value of the given collection element.
OCI_EXPORT unsigned int OCI_API OCI_GetServerRevisionVersion(OCI_Connection *con)
Return the revision version number of the connected database server.
OCI_EXPORT boolean OCI_API OCI_ObjectAssign(OCI_Object *obj, OCI_Object *obj_src)
Assign an object to another one.
void SetDateTime(int year, int month, int day, int hour, int min, int sec)
Set the date and time part.
OCI_EXPORT OCI_TypeInfo *OCI_API OCI_TypeInfoGet(OCI_Connection *con, const otext *name, unsigned int type)
Retrieve the available type info information.
OCI_EXPORT boolean OCI_API OCI_BindRaw(OCI_Statement *stmt, const otext *name, void *data, unsigned int len)
Bind a raw buffer.
Enum< ExceptionTypeValues > ExceptionType
Type of Exception.
Definition: ocilib.hpp:462
OCI_EXPORT boolean OCI_API OCI_BindArrayOfLobs(OCI_Statement *stmt, const otext *name, OCI_Lob **data, unsigned int type, unsigned int nbelem)
Bind an array of Lob handles.
Date Clone() const
Clone the current instance to a new one performing deep copy.
void SetHours(int value)
Set the date hours value.
bool operator!=(const Interval &other) const
Indicates if the current Interval value is not equal the given Interval value.
void FromString(const ostring &data)
Assign to the interval object the value provided by the input interval string.
Column GetColumn(unsigned int index) const
Return the column from its index in the resultset.
OCI_EXPORT boolean OCI_API OCI_DirPathSetCacheSize(OCI_DirPath *dp, unsigned int size)
Set number of elements in the date cache.
OCI_EXPORT OCI_Date *OCI_API OCI_ElemGetDate(OCI_Elem *elem)
Return the Date value of the given collection element.
static void ChangeUserPassword(const ostring &db, const ostring &user, const ostring &pwd, const ostring &newPwd)
Change the password of the given user on the given database.
OCI_EXPORT unsigned int OCI_API OCI_GetRowCount(OCI_Resultset *rs)
Retrieve the number of rows fetched so far.
Flags< EnvironmentFlagsValues > EnvironmentFlags
Environment Flags.
Definition: ocilib.hpp:637
OCI_EXPORT unsigned int OCI_API OCI_LobWrite(OCI_Lob *lob, void *buffer, unsigned int len)
[OBSOLETE] Write a buffer into a LOB
ostring GetMessage() const
Retrieve the error message.
OCI_EXPORT unsigned int OCI_API OCI_BindArrayGetSize(OCI_Statement *stmt)
Return the current input array size for bulk operations.
OCI_EXPORT unsigned int OCI_API OCI_EventGetType(OCI_Event *event)
Return the type of event reported by a notification.
boolean OCI_API OCI_BindSetCharsetForm(OCI_Bind *bnd, unsigned int csfrm)
Set the charset form of the given character based bind variable.
OCI_EXPORT boolean OCI_API OCI_DatabaseShutdown(const otext *db, const otext *user, const otext *pwd, unsigned int sess_mode, unsigned int shut_mode, unsigned int shut_flag)
Shutdown a database instance.
OCI_EXPORT boolean OCI_API OCI_DateGetTime(OCI_Date *date, int *hour, int *min, int *sec)
Extract the time part from a date handle.
OCI_EXPORT const otext *OCI_API OCI_GetPassword(OCI_Connection *con)
Return the current logged user password.
OCI_EXPORT boolean OCI_API OCI_TimestampGetTime(OCI_Timestamp *tmsp, int *hour, int *min, int *sec, int *fsec)
Extract the time portion from a timestamp handle.
Timestamp Clone() const
Clone the current instance to a new one performing deep copy.
bool IsValid() const
Check if the given date is valid.
OCILIB encapsulation of Oracle DCN notification.
void Close()
Destroy the current Oracle pool of connections or sessions.
OCI_EXPORT unsigned int OCI_API OCI_GetUnsignedInt2(OCI_Resultset *rs, const otext *name)
Return the current unsigned integer value of the column from its name in the resultset.
OCILIB encapsulation of A/Q dequeuing operations.
static void Create(const ostring &name, ThreadKeyFreeProc freeProc=0)
Create a thread key object.
int GetHours() const
Return the date hours value.
OCI_EXPORT OCI_Timestamp *OCI_API OCI_ObjectGetTimestamp(OCI_Object *obj, const otext *attr)
Return the timestamp value of the given object attribute.
OCI_EXPORT boolean OCI_API OCI_BindSetDirection(OCI_Bind *bnd, unsigned int direction)
Set the direction mode of a bind handle.
OCI_EXPORT boolean OCI_API OCI_EnqueueGetRelativeMsgID(OCI_Enqueue *enqueue, void *id, unsigned int *len)
Get the current associated message identifier used for enqueuing messages using a sequence deviation...
OCI_EXPORT boolean OCI_API OCI_IsRebindingAllowed(OCI_Statement *stmt)
Indicate if rebinding is allowed on the given statement.
OCI_EXPORT boolean OCI_API OCI_TimestampGetTimeZoneName(OCI_Timestamp *tmsp, int size, otext *str)
Return the time zone name of a timestamp handle.
OCI_EXPORT unsigned int OCI_API OCI_TransactionGetMode(OCI_Transaction *trans)
Return global transaction mode.
OCI_EXPORT OCI_Statement *OCI_API OCI_BindGetStatement(OCI_Bind *bnd)
Return the statement handle associated with a bind handle.
OCI_EXPORT boolean OCI_API OCI_IntervalGetDaySecond(OCI_Interval *itv, int *day, int *hour, int *min, int *sec, int *fsec)
Return the day / time portion of an interval handle.
Oracle SQL or PL/SQL statement.
ostring ToString() const
return a string representation of the current reference
bool operator>=(const Timestamp &other) const
Indicates if the current Timestamp value is superior or equal to the given Timestamp value...
OCI_EXPORT boolean OCI_API OCI_ElemSetRef(OCI_Elem *elem, OCI_Ref *value)
Assign a Ref handle to a collection element.
const void * ThreadId
Thread Unique ID.
Definition: ocilib.hpp:210
OCI_EXPORT OCI_Object *OCI_API OCI_ObjectGetObject(OCI_Object *obj, const otext *attr)
Return the object value of the given object attribute.
OCI_EXPORT unsigned int OCI_API OCI_EventGetOperation(OCI_Event *event)
Return the type of operation reported by a notification.
ostring GetDefaultDateFormat() const
Return the current date format for implicit string / date conversions.
bool GetAutoCommit() const
Indicates if auto commit is currently activated.
Object identifying the SQL data type REF.
Definition: ocilib.hpp:4310
void SetUserData(AnyPointer value)
Associate a pointer to user data to the given connection.
CollectionType GetType() const
Return the type of the collection.
ostring GetName() const
Return the file name.
OCI_EXPORT boolean OCI_API OCI_ThreadKeySetValue(const otext *name, void *value)
Set a thread key value.
OCI_EXPORT short OCI_API OCI_GetShort2(OCI_Resultset *rs, const otext *name)
Return the current short value of the column from its name in the resultset.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfUnsignedBigInts(OCI_Statement *stmt, const otext *name, big_uint *data, unsigned int nbelem)
Bind an array of unsigned big integers.
OCI_EXPORT boolean OCI_API OCI_TimestampIntervalSub(OCI_Timestamp *tmsp, OCI_Interval *itv)
Subtract an interval value from a timestamp value of a timestamp handle.
void SetDay(int value)
Set the date day value.
Enum< IntervalTypeValues > IntervalType
Interval types.
Definition: ocilib.hpp:2739
OCI_EXPORT boolean OCI_API OCI_MutexFree(OCI_Mutex *mutex)
Destroy a mutex object.
int DaysBetween(const Date &other) const
Return the number of days with the given date.
void FromString(const ostring &data, const ostring &format=OCI_STRING_FORMAT_DATE)
Assign to the timestamp object the value provided by the input date time string.
void SetDefaultNumericFormat(const ostring &format)
Set the numeric format for implicit string / numeric conversions.
OCILIB encapsulation of OCI Threads.
OCI_EXPORT boolean OCI_API OCI_TimestampFree(OCI_Timestamp *tmsp)
Free an OCI_Timestamp handle.
OCI_EXPORT unsigned int OCI_API OCI_BindGetSubtype(OCI_Bind *bnd)
Return the OCILIB object subtype of the given bind.
OCI_EXPORT boolean OCI_API OCI_SetUserData(OCI_Connection *con, void *data)
Associate a pointer to user data to the given connection.
OCI_EXPORT OCI_Date *OCI_API OCI_DateCreate(OCI_Connection *con)
Create a local date object.
OCI_EXPORT OCI_Ref *OCI_API OCI_RefCreate(OCI_Connection *con, OCI_TypeInfo *typinf)
Create a local Ref instance.
OCI_EXPORT OCI_Interval *OCI_API OCI_IntervalCreate(OCI_Connection *con, unsigned int type)
Create a local interval object.
OCI_EXPORT OCI_Connection *OCI_API OCI_LobGetConnection(OCI_Lob *lob)
Retrieve connection handle from the lob handle.
big_uint GetLength() const
Returns the number of bytes contained in the file.
OCI_EXPORT boolean OCI_API OCI_EnqueueSetSequenceDeviation(OCI_Enqueue *enqueue, unsigned int sequence)
Set the enqueuing sequence of messages to put in the queue.
OCI_EXPORT const otext *OCI_API OCI_GetDBName(OCI_Connection *con)
Return the Oracle server database name of the connected database/service name.
Oracle physical connection.
void SetDateTime(int year, int month, int day, int hour, int min, int sec, int fsec, const ostring &timeZone=OTEXT(""))
Set the timestamp value from given date time parts.
void Flush()
Flush the lob content to the server (if applicable)
OCI_EXPORT boolean OCI_API OCI_ElemIsNull(OCI_Elem *elem)
Check if the collection element value is null.
Reference(const TypeInfo &typeInfo)
Parametrized constructor.
void Stop()
Stop current global transaction.
OCI_EXPORT boolean OCI_API OCI_RegisterBigInt(OCI_Statement *stmt, const otext *name)
Register a big integer output bind placeholder.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfFloats(OCI_Statement *stmt, const otext *name, float *data, unsigned int nbelem)
Bind an array of floats.
OCI_EXPORT big_uint OCI_API OCI_FileGetOffset(OCI_File *file)
Return the current position in the file.
OCI_EXPORT boolean OCI_API OCI_SetLongMaxSize(OCI_Statement *stmt, unsigned int size)
Set the LONG data type piece buffer size.
void GetTime(int &hour, int &min, int &sec, int &fsec) const
Extract time parts.
OCI_EXPORT OCI_TypeInfo *OCI_API OCI_RefGetTypeInfo(OCI_Ref *ref)
Return the type info object associated to the Ref.
OCI_EXPORT boolean OCI_API OCI_ElemSetLob(OCI_Elem *elem, OCI_Lob *value)
Assign a Lob handle to a collection element.
OCI_EXPORT OCI_File *OCI_API OCI_FileCreate(OCI_Connection *con, unsigned int type)
Create a file object instance.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfUnsignedInts(OCI_Statement *stmt, const otext *name, unsigned int *data, unsigned int nbelem)
Bind an array of unsigned integers.
void SetMinutes(int value)
Set the timestamp minutes value.
OCI_EXPORT OCI_Transaction *OCI_API OCI_TransactionCreate(OCI_Connection *con, unsigned int timeout, unsigned int mode, OCI_XID *pxid)
Create a new global transaction or a serializable/read-only local transaction.
void SetDate(int year, int month, int day)
Set the date part.
void Close()
Close explicitly a Lob.
bool operator>(const Interval &other) const
Indicates if the current Interval value is superior to the given Interval value.
OCI_EXPORT OCI_Coll *OCI_API OCI_GetColl(OCI_Resultset *rs, unsigned int index)
Return the current Collection value of the column at the given index in the resultset.
OCI_EXPORT unsigned int OCI_API OCI_ObjectGetUnsignedInt(OCI_Object *obj, const otext *attr)
Return the unsigned integer value of the given object attribute.
OCI_EXPORT boolean OCI_API OCI_ElemSetUnsignedShort(OCI_Elem *elem, unsigned short value)
Set a unsigned short value to a collection element.
big_uint GetOffset() const
Returns the current R/W offset within the lob.
TypeInfo GetTypeInfo() const
Return the TypeInfo object describing the object.
OCI_EXPORT boolean OCI_API OCI_SetPassword(OCI_Connection *con, const otext *password)
Change the password of the logged user.
OCI_EXPORT int OCI_API OCI_TimestampCheck(OCI_Timestamp *tmsp)
Check if the given timestamp is valid.
void(* NotifyHandlerProc)(Event &evt)
User callback for subscriptions event notifications.
Definition: ocilib.hpp:6195
void SetTransaction(const Transaction &transaction)
Set a transaction to a connection.
OCI_EXPORT big_uint OCI_API OCI_GetUnsignedBigInt(OCI_Resultset *rs, unsigned int index)
Return the current unsigned big integer value of the column at the given index in the resultset...
Connection GetConnection() const
Return the connection within the error occurred.
OCI_EXPORT boolean OCI_API OCI_TransactionForget(OCI_Transaction *trans)
Cancel the prepared global transaction validation.
Element operator[](int index)
Returns the element at a given position in the collection.
OCI_EXPORT unsigned int OCI_API OCI_GetRaw2(OCI_Resultset *rs, const otext *name, void *buffer, unsigned int len)
Copy the current raw value of the column from its name into the specified buffer. ...
OCI_EXPORT boolean OCI_API OCI_IntervalToText(OCI_Interval *itv, int leading_prec, int fraction_prec, int size, otext *str)
Convert an interval value from the given interval handle to a string.
OCI_EXPORT boolean OCI_API OCI_RegisterInt(OCI_Statement *stmt, const otext *name)
Register an integer output bind placeholder.
OCI_EXPORT OCI_Resultset *OCI_API OCI_GetResultset(OCI_Statement *stmt)
Retrieve the resultset handle from an executed statement.
void Open(OpenMode mode)
Open explicitly a Lob.
void * AnyPointer
Alias for the generic void pointer.
Definition: ocilib.hpp:174
OCI_EXPORT unsigned int OCI_API OCI_GetBindIndex(OCI_Statement *stmt, const otext *name)
Return the index of the bind from its name belonging to the given statement.
Oracle internal interval representation.
OCI_EXPORT boolean OCI_API OCI_TransactionFree(OCI_Transaction *trans)
Free current transaction.
OCI_EXPORT boolean OCI_API OCI_ObjectSetUnsignedBigInt(OCI_Object *obj, const otext *attr, big_uint value)
Set an object attribute of type unsigned big int.
OCI_EXPORT void *OCI_API OCI_GetUserData(OCI_Connection *con)
Return the pointer to user data previously associated with the connection.
ostring ToString() const
return a string representation of the current collection
ostring GetPassword() const
Return the current logged user password.
static void Cleanup()
Clean up all resources allocated by the environment.
int GetSeconds() const
Return the timestamp seconds value.
void SetMilliSeconds(int value)
Set the interval milliseconds value.
ExceptionType GetType() const
Return the Exception type.
OCI_EXPORT unsigned int OCI_API OCI_DequeueGetMode(OCI_Dequeue *dequeue)
Get the dequeuing/locking behavior.
OCI_EXPORT unsigned short OCI_API OCI_GetUnsignedShort(OCI_Resultset *rs, unsigned int index)
Return the current unsigned short value of the column at the given index in the resultset.
OCI_EXPORT boolean OCI_API OCI_FetchFirst(OCI_Resultset *rs)
Fetch the first row of the resultset.
Date()
Create an empty date object.
ostring GetDirectory() const
Return the file directory.
OCI_EXPORT boolean OCI_API OCI_DateSetTime(OCI_Date *date, int hour, int min, int sec)
Set the time portion if the given date handle.
OCI_EXPORT OCI_Timestamp *OCI_API OCI_GetTimestamp2(OCI_Resultset *rs, const otext *name)
Return the current timestamp value of the column from its name in the resultset.
bool operator<(const Date &other) const
Indicates if the current date value is inferior to the given date value.
Oracle REF type representation.
Interval & operator+=(const Interval &other)
Increment the current Value with the given Interval value.
static void Run(ThreadHandle handle, ThreadProc func, void *args)
Execute the given routine within the given thread.
OCI_EXPORT unsigned int OCI_API OCI_SubscriptionGetPort(OCI_Subscription *sub)
Return the port used by the notification.
OCI_EXPORT unsigned int OCI_API OCI_RefGetHexSize(OCI_Ref *ref)
Returns the size of the hex representation of the given Ref handle.
OCI_EXPORT const otext *OCI_API OCI_AgentGetAddress(OCI_Agent *agent)
Get the given AQ agent address.
OCI_EXPORT unsigned int OCI_API OCI_GetOCICompileVersion(void)
Return the version of OCI used for compilation.
OCI_EXPORT boolean OCI_API OCI_DatabaseStartup(const otext *db, const otext *user, const otext *pwd, unsigned int sess_mode, unsigned int start_mode, unsigned int start_flag, const otext *spfile)
Start a database instance.
OCI_EXPORT float OCI_API OCI_ObjectGetFloat(OCI_Object *obj, const otext *attr)
Return the float value of the given object attribute.
void Prepare()
Prepare a global transaction validation.
OCI_EXPORT int OCI_API OCI_ColumnGetLeadingPrecision(OCI_Column *col)
Return the leading precision of the column for interval columns.
OCI_EXPORT unsigned int OCI_API OCI_GetServerMinorVersion(OCI_Connection *con)
Return the minor version number of the connected database server.
OCI_EXPORT boolean OCI_API OCI_DirPathReset(OCI_DirPath *dp)
Reset internal arrays and streams to prepare another load.
IntervalType GetType() const
Return the type of the given interval object.
bool operator<(const Timestamp &other) const
Indicates if the current Timestamp value is inferior to the given Timestamp value.
OCI_EXPORT OCI_Interval *OCI_API OCI_ElemGetInterval(OCI_Elem *elem)
Return the Interval value of the given collection element.
OCI_EXPORT boolean OCI_API OCI_MsgSetObject(OCI_Msg *msg, OCI_Object *obj)
Set the object payload of the given message.
OCI_EXPORT unsigned int OCI_API OCI_CollGetMax(OCI_Coll *coll)
Returns the maximum number of elements of the given collection.
OCI_EXPORT const otext *OCI_API OCI_DequeueGetCorrelation(OCI_Dequeue *dequeue)
Get the correlation identifier of the message to be dequeued.
Object identifying the SQL data type BFILE.
Definition: ocilib.hpp:3876
Object identifying the SQL data types VARRAY and NESTED TABLE.
Definition: ocilib.hpp:4401
OCI_EXPORT unsigned int OCI_API OCI_ElemGetRaw(OCI_Elem *elem, void *value, unsigned int len)
Read the RAW value of the collection element into the given buffer.
static unsigned int GetCompileVersion()
Return the version of OCI used for compiling OCILIB.
Timestamp & operator--()
Decrement the Timestamp by 1 day.
OCI_EXPORT OCI_Statement *OCI_API OCI_GetStatement2(OCI_Resultset *rs, const otext *name)
Return the current cursor value of the column from its name in the resultset.
OCI_EXPORT boolean OCI_API OCI_FileFree(OCI_File *file)
Free a local File object.
OCI_EXPORT unsigned int OCI_API OCI_ColumnGetPropertyFlags(OCI_Column *col)
Return the column property flags.
void SetNoWait(bool value)
Set the waiting mode used when no more connections/sessions are available from the pool...
OCI_EXPORT boolean OCI_API OCI_LobOpen(OCI_Lob *lob, unsigned int mode)
Open explicitly a Lob.
void SetMonth(int value)
Set the date month value.
Interval(IntervalType type)
Create a new instance of the given type.
OCI_EXPORT big_int OCI_API OCI_GetBigInt(OCI_Resultset *rs, unsigned int index)
Return the current big integer value of the column at the given index in the resultset.
big_uint GetChunkSize() const
Returns the current lob chunk size.
bool operator!=(const Timestamp &other) const
Indicates if the current Timestamp value is not equal the given Timestamp value.
OCI_EXPORT unsigned int OCI_API OCI_DequeueGetNavigation(OCI_Dequeue *dequeue)
Return the navigation position of messages to retrieve from the queue.
unsigned int GetBusyConnectionsCount() const
Return the current number of busy connections/sessions.
OCI_EXPORT boolean OCI_API OCI_PoolGetNoWait(OCI_Pool *pool)
Get the waiting mode used when no more connections/sessions are available from the pool...
OCI_EXPORT unsigned int OCI_API OCI_DirPathConvert(OCI_DirPath *dp)
Convert provided user data to the direct path stream format.
OCI_EXPORT boolean OCI_API OCI_DateSetDate(OCI_Date *date, int year, int month, int day)
Set the date portion if the given date handle.
OCI_EXPORT int OCI_API OCI_DateDaysBetween(OCI_Date *date, OCI_Date *date2)
Return the number of days betWeen two dates.
void SetTimeZone(const ostring &timeZone)
Set the given time zone to the timestamp.
Connection GetConnection() const
Return the lob parent connection.
Object identifying the SQL data type INTERVAL.
Definition: ocilib.hpp:2707
OCI_EXPORT unsigned int OCI_API OCI_GetVersionConnection(OCI_Connection *con)
Return the highest Oracle version is supported by the connection.
OCI_EXPORT unsigned int OCI_API OCI_BindGetDataSizeAtPos(OCI_Bind *bnd, unsigned int position)
Return the actual size of the element at the given position in the bind input array.
OCI_EXPORT boolean OCI_API OCI_IsTAFCapable(OCI_Connection *con)
Verifiy if the given connection support TAF events.
bool operator!=(const Date &other) const
Indicates if the current date value is not equal the given date value.
OCI_EXPORT const void *OCI_API OCI_HandleGetEnvironment(void)
Return the OCI Environment Handle (OCIEnv *) of OCILIB library.
OCI_EXPORT int OCI_API OCI_MsgGetExpiration(OCI_Msg *msg)
Return the duration that the message is available for dequeuing.
static void Destroy(MutexHandle handle)
Destroy a mutex handle.
OCI_EXPORT boolean OCI_API OCI_BindDate(OCI_Statement *stmt, const otext *name, OCI_Date *data)
Bind a date variable.
File(const Connection &connection)
Parametrized constructor.
OCI_EXPORT boolean OCI_API OCI_CollFree(OCI_Coll *coll)
Free a local collection.
OCI_EXPORT boolean OCI_API OCI_DateSysDate(OCI_Date *date)
Return the current system date/time into the date handle.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfRaws(OCI_Statement *stmt, const otext *name, void *data, unsigned int len, unsigned int nbelem)
Bind an array of raw buffers.
OCI_EXPORT OCI_Object *OCI_API OCI_RefGetObject(OCI_Ref *ref)
Returns the object pointed by the Ref handle.
void GetTimeZoneOffset(int &hour, int &min) const
Return the time zone (hour, minute) offsets.
void EnableBuffering(bool value)
Enable / disable buffering mode on the given lob object.
OCI_EXPORT OCI_Coll *OCI_API OCI_ElemGetColl(OCI_Elem *elem)
Return the collection value of the given collection element.
bool IsValid() const
Check if the given interval is valid.
void Resume()
Resume a stopped global transaction.
void SetSeconds(int value)
Set the timestamp seconds value.
OCI_EXPORT unsigned int OCI_API OCI_CollGetCount(OCI_Coll *coll)
Returns the current number of elements of the given collection.
OCI_EXPORT OCI_Elem *OCI_API OCI_CollGetElem(OCI_Coll *coll, unsigned int index)
Return the element at the given position in the collection.
OCI_EXPORT boolean OCI_API OCI_ElemSetUnsignedInt(OCI_Elem *elem, unsigned int value)
Set a unsigned int value to a collection element.
OCI_EXPORT unsigned short OCI_API OCI_ObjectGetUnsignedShort(OCI_Object *obj, const otext *attr)
Return the unsigned short value of the given object attribute.
OCI_EXPORT const otext *OCI_API OCI_GetInstanceName(OCI_Connection *con)
Return the Oracle server Instance name of the connected database/service name.
OCI_EXPORT unsigned int OCI_API OCI_GetFetchMode(OCI_Statement *stmt)
Return the fetch mode of a SQL statement.
OCI_EXPORT boolean OCI_API OCI_SubscriptionAddStatement(OCI_Subscription *sub, OCI_Statement *stmt)
Add a statement to the notification to monitor.
OCI_EXPORT boolean OCI_API OCI_LobTruncate(OCI_Lob *lob, big_uint size)
Truncate the given lob to a shorter length.
Timestamp GetInstanceStartTime() const
Return the date and time (Timestamp) server instance start of the.
bool IsOpened() const
Check if the specified file is currently opened on the server by our object.
bool GetNoWait() const
Get the waiting mode used when no more connections/sessions are available from the pool...
OCI_EXPORT void *OCI_API OCI_ThreadKeyGetValue(const otext *name)
Get a thread key value.
void SetDay(int value)
Set the timestamp day value.
bool Seek(SeekMode seekMode, big_uint offset)
Move the current position within the lob for read/write operations.
OCI_EXPORT boolean OCI_API OCI_LobClose(OCI_Lob *lob)
Close explicitly a Lob.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfDates(OCI_Statement *stmt, const otext *name, OCI_Date **data, unsigned int nbelem)
Bind an array of dates.
bool IsValid() const
Check if the given timestamp is valid.
OCI_EXPORT OCI_Interval *OCI_API OCI_GetInterval2(OCI_Resultset *rs, const otext *name)
Return the current interval value of the column from its name in the resultset.
Date LastDay() const
Return the last day of month from the current date object.
void SetTimeout(unsigned int value)
Set the connections/sessions idle timeout.
OCI_EXPORT boolean OCI_API OCI_CollSetElem(OCI_Coll *coll, unsigned int index, OCI_Elem *elem)
Assign the given element value to the element at the given position in the collection.
LobType GetType() const
return the type of lob
virtual const char * what() const
Override the std::exception::what() method.
OCI_EXPORT boolean OCI_API OCI_DirPathAbort(OCI_DirPath *dp)
Terminate a direct path operation without committing changes.
Oracle internal date representation.
OCI_EXPORT boolean OCI_API OCI_CollAppend(OCI_Coll *coll, OCI_Elem *elem)
Append the given element at the end of the collection.
OCI_EXPORT boolean OCI_API OCI_ElemSetUnsignedBigInt(OCI_Elem *elem, big_uint value)
Set a unsigned big_int value to a collection element.
OCI_EXPORT boolean OCI_API OCI_BindLob(OCI_Statement *stmt, const otext *name, OCI_Lob *data)
Bind a Lob variable.
OCILIB encapsulation of Oracle DCN event.
OCI_EXPORT boolean OCI_API OCI_RegisterDouble(OCI_Statement *stmt, const otext *name)
Register a double output bind placeholder.
OCI_EXPORT unsigned int OCI_API OCI_GetColumnCount(OCI_Resultset *rs)
Return the number of columns in the resultset.
OCI_EXPORT unsigned int OCI_API OCI_DirPathGetErrorColumn(OCI_DirPath *dp)
Return the index of a column which caused an error during data conversion.
OCI_EXPORT unsigned int OCI_API OCI_ColumnGetCharsetForm(OCI_Column *col)
Return the charset form of the given column.
void(* POCI_NOTIFY)(OCI_Event *event)
Database Change Notification User callback prototype.
Definition: ocilib.h:850
Enum< TimestampTypeValues > TimestampType
Type of Exception.
Definition: ocilib.hpp:3124
OCI_EXPORT boolean OCI_API OCI_AllowRebinding(OCI_Statement *stmt, boolean value)
Allow different host variables to be binded using the same bind name or position between executions o...
OCI_EXPORT boolean OCI_API OCI_Describe(OCI_Statement *stmt, const otext *sql)
Describe the select list of a SQL select statement.
Long(const Statement &statement)
Constructor.
OCI_EXPORT const otext *OCI_API OCI_BindGetName(OCI_Bind *bnd)
Return the name of the given bind.
void UpdateTimeZone(const ostring &timeZone)
Update the interval value with the given time zone.
OCI_EXPORT boolean OCI_API OCI_ServerEnableOutput(OCI_Connection *con, unsigned int bufsize, unsigned int arrsize, unsigned int lnsize)
Enable the server output.
OCI_EXPORT unsigned int OCI_API OCI_LobAppend(OCI_Lob *lob, void *buffer, unsigned int len)
Append a buffer at the end of a LOB.
OCI_EXPORT boolean OCI_API OCI_LobCopy(OCI_Lob *lob, OCI_Lob *lob_src, big_uint offset_dst, big_uint offset_src, big_uint count)
Copy a portion of a source LOB into a destination LOB.
bool IsAttributeNull(const ostring &name) const
Check if an object attribute is null.
OCI_EXPORT boolean OCI_API OCI_MsgSetSender(OCI_Msg *msg, OCI_Agent *sender)
Set the original sender of a message.
OCI_EXPORT const otext *OCI_API OCI_GetSQLVerb(OCI_Statement *stmt)
Return the verb of the SQL command held by the statement handle.
OCI_EXPORT const otext *OCI_API OCI_ErrorGetString(OCI_Error *err)
Retrieve error message from error handle.
void SetInfos(const ostring &directory, const ostring &name)
Set the directory and file name of our file object.
OCI_EXPORT const otext *OCI_API OCI_GetDomainName(OCI_Connection *con)
Return the Oracle server domain name of the connected database/service name.
OCI_EXPORT boolean OCI_API OCI_ObjectIsNull(OCI_Object *obj, const otext *attr)
Check if an object attribute is null.
OCI_EXPORT int OCI_API OCI_DequeueGetWaitTime(OCI_Dequeue *dequeue)
Return the time that OCIDequeueGet() waits for messages if no messages are currently available...
OCI_EXPORT boolean OCI_API OCI_Execute(OCI_Statement *stmt)
Execute a prepared SQL statement or PL/SQL block.
void SetStatementCacheSize(unsigned int value)
Set the maximum number of statements to keep in the statement cache.
bool operator==(const Date &other) const
Indicates if the current date value is equal to the given date value.
OCI_EXPORT boolean OCI_API OCI_ObjectFree(OCI_Object *obj)
Free a local object.
Oracle Collections (VARRAYs and Nested Tables) representation.
OCI_EXPORT boolean OCI_API OCI_ElemSetFile(OCI_Elem *elem, OCI_File *value)
Assign a File handle to a collection element.
OCI_EXPORT OCI_Error *OCI_API OCI_GetLastError(void)
Retrieve the last error or warning occurred within the last OCILIB call.
OCI_EXPORT boolean OCI_API OCI_TransactionPrepare(OCI_Transaction *trans)
Prepare a global transaction validation.
Enum< FailoverEventValues > FailoverEvent
Failover events.
Definition: ocilib.hpp:1533
OCI_EXPORT const otext *OCI_API OCI_FileGetDirectory(OCI_File *file)
Return the directory of the given file.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfInts(OCI_Statement *stmt, const otext *name, int *data, unsigned int nbelem)
Bind an array of integers.
void AddDays(int days)
Add or subtract days.
static unsigned int GetRuntimeVersion()
Return the version of OCI used at runtime.
OCI_EXPORT unsigned int OCI_API OCI_DirPathGetAffectedRows(OCI_DirPath *dp)
return the number of rows successfully processed during in the last conversion or loading call ...
OCI_EXPORT OCI_Date *OCI_API OCI_MsgGetEnqueueTime(OCI_Msg *msg)
return the time the message was enqueued
static void Destroy(ThreadHandle handle)
Destroy a thread.
TLongObjectType GetContent() const
Return the string read from a fetch sequence.
void Append(const TDataType &data)
Append the given element value at the end of the collection.
TimestampType GetType() const
Return the type of the given timestamp object.
OCI_EXPORT int OCI_API OCI_GetInt(OCI_Resultset *rs, unsigned int index)
Return the current integer value of the column at the given index in the resultset.
void SetTime(int hour, int min, int sec)
Set the time part.
OCI_EXPORT unsigned int OCI_API OCI_GetCurrentRow(OCI_Resultset *rs)
Retrieve the current row number.
Type info metadata handle.
OCI_EXPORT OCI_Connection *OCI_API OCI_SubscriptionGetConnection(OCI_Subscription *sub)
Return the connection handle associated with a subscription handle.
Enum< CollectionTypeValues > CollectionType
Collection type.
Definition: ocilib.hpp:4434
OCI_EXPORT boolean OCI_API OCI_ObjectSetUnsignedInt(OCI_Object *obj, const otext *attr, unsigned int value)
Set an object attribute of type unsigned int.
unsigned int Write(const TLobObjectType &content)
Write the given content at the current position within the lob.
OCI_EXPORT float OCI_API OCI_GetFloat2(OCI_Resultset *rs, const otext *name)
Return the current float value of the column from its name in the resultset.
bool operator>=(const Interval &other) const
Indicates if the current Interval value is superior or equal to the given Interval value...
OCI_EXPORT big_int OCI_API OCI_GetBigInt2(OCI_Resultset *rs, const otext *name)
Return the current big integer value of the column from its name in the resultset.
bool operator!=(const File &other) const
Indicates if the current file value is not equal the given file value.
Long< ostring, LongCharacter > Clong
Class handling LONG oracle type.
OCI_EXPORT boolean OCI_API OCI_DirPathSetCurrentRows(OCI_DirPath *dp, unsigned int nb_rows)
Set the current number of rows to convert and load.
void Start()
Start global transaction.
void SysTimestamp()
Assign the current system timestamp to the current timestamp object.
OCI_EXPORT boolean OCI_API OCI_MsgGetRaw(OCI_Msg *msg, void *raw, unsigned int *size)
Get the RAW payload of the given message.
Raw Read(unsigned int size)
Read a portion of a file.
OCI_EXPORT boolean OCI_API OCI_MutexRelease(OCI_Mutex *mutex)
Release a mutex lock.
void SetMilliSeconds(int value)
Set the timestamp milliseconds value.
OCI_EXPORT boolean OCI_API OCI_TimestampConstruct(OCI_Timestamp *tmsp, int year, int month, int day, int hour, int min, int sec, int fsec, const otext *time_zone)
Set a timestamp handle value.
OCI_EXPORT boolean OCI_API OCI_TimestampSubtract(OCI_Timestamp *tmsp, OCI_Timestamp *tmsp2, OCI_Interval *itv)
Store the difference of two timestamp handles into an interval handle.
static AnyPointer GetValue(const ostring &name)
Get a thread key value.
OCI_EXPORT int OCI_API OCI_MsgGetPriority(OCI_Msg *msg)
Return the priority of the message.
void DisableServerOutput()
Disable the server output.
OCI_EXPORT boolean OCI_API OCI_DateZoneToZone(OCI_Date *date, const otext *zone1, const otext *zone2)
Convert a date from one zone to another zone.
OCI_EXPORT unsigned int OCI_API OCI_CollGetSize(OCI_Coll *coll)
Returns the total number of elements of the given collection.
OCI_EXPORT const void *OCI_API OCI_HandleGetThreadID(OCI_Thread *thread)
Return OCI Thread ID (OCIThreadId *) of an OCILIB OCI_Thread object.
OCI_EXPORT boolean OCI_API OCI_MsgFree(OCI_Msg *msg)
Free a message object.
OCI_EXPORT boolean OCI_API OCI_RegisterUnsignedInt(OCI_Statement *stmt, const otext *name)
Register an unsigned integer output bind placeholder.
OCI_EXPORT boolean OCI_API OCI_EnqueueSetVisibility(OCI_Enqueue *enqueue, unsigned int visibility)
Set whether the new message is enqueued as part of the current transaction.
OCI_EXPORT unsigned int OCI_API OCI_PoolGetBusyCount(OCI_Pool *pool)
Return the current number of busy connections/sessions.
OCI_EXPORT OCI_Connection *OCI_API OCI_ConnectionCreate(const otext *db, const otext *user, const otext *pwd, unsigned int mode)
Create a physical connection to an Oracle database server.
OCILIB encapsulation of A/Q Agent.
OCI_EXPORT double OCI_API OCI_GetDouble(OCI_Resultset *rs, unsigned int index)
Return the current double value of the column at the given index in the resultset.
OCI_EXPORT boolean OCI_API OCI_CollAssign(OCI_Coll *coll, OCI_Coll *coll_src)
Assign a collection to another one.
OCI_EXPORT unsigned int OCI_API OCI_SubscriptionGetTimeout(OCI_Subscription *sub)
Return the timeout of the given registered subscription.
OCI_EXPORT OCI_Agent *OCI_API OCI_MsgGetSender(OCI_Msg *msg)
Return the original sender of a message.
OCI_EXPORT boolean OCI_API OCI_SetHAHandler(POCI_HA_HANDLER handler)
Set the High availability (HA) user handler.
Enum< HAEventSourceValues > HAEventSource
Source of HA events.
Definition: ocilib.hpp:591
Interval & operator-=(const Interval &other)
Decrement the current Value with the given Interval value.
OCI_EXPORT boolean OCI_API OCI_DateToText(OCI_Date *date, const otext *fmt, int size, otext *str)
Convert a Date value from the given date handle to a string.
OCI_EXPORT short OCI_API OCI_ElemGetShort(OCI_Elem *elem)
Return the short value of the given collection element.
static void SetValue(const ostring &name, AnyPointer value)
Set a thread key value.
OCI_EXPORT const otext *OCI_API OCI_EventGetDatabase(OCI_Event *event)
Return the name of the database that generated the event.
OCI_EXPORT boolean OCI_API OCI_RegisterObject(OCI_Statement *stmt, const otext *name, OCI_TypeInfo *typinf)
Register an object output bind placeholder.
OCI_EXPORT boolean OCI_API OCI_ObjectSetBigInt(OCI_Object *obj, const otext *attr, big_int value)
Set an object attribute of type big int.
OCI_EXPORT OCI_Lob *OCI_API OCI_LobCreate(OCI_Connection *con, unsigned int type)
Create a local temporary Lob instance.
static MutexHandle Create()
Create a Mutex handle.
OCI_EXPORT const otext *OCI_API OCI_GetDatabase(OCI_Connection *con)
Return the name of the connected database/service name.
Enum< HAEventTypeValues > HAEventType
Type of HA events.
Definition: ocilib.hpp:613
OCI_EXPORT boolean OCI_API OCI_IntervalAdd(OCI_Interval *itv, OCI_Interval *itv2)
Adds an interval handle value to another.
OCI_EXPORT boolean OCI_API OCI_BindTimestamp(OCI_Statement *stmt, const otext *name, OCI_Timestamp *data)
Bind a timestamp variable.
OCI_EXPORT boolean OCI_API OCI_SetTrace(OCI_Connection *con, unsigned int trace, const otext *value)
Set tracing information to the session of the given connection.
OCI_EXPORT boolean OCI_API OCI_ObjectSetDate(OCI_Object *obj, const otext *attr, OCI_Date *value)
Set an object attribute of type Date.
ostring GetTrace(SessionTrace trace) const
Get the current trace for the trace type from the given connection.
void SetElementNull(unsigned int index)
Nullify the element at the given index.
OCI_EXPORT boolean OCI_API OCI_FetchNext(OCI_Resultset *rs)
Fetch the next row of the resultset.
OCI_EXPORT float OCI_API OCI_GetFloat(OCI_Resultset *rs, unsigned int index)
Return the current float value of the column at the given index in the resultset. ...
big_uint GetLength() const
Returns the number of characters or bytes contained in the lob.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfFiles(OCI_Statement *stmt, const otext *name, OCI_File **data, unsigned int type, unsigned int nbelem)
Bind an array of File handles.
OCI_EXPORT boolean OCI_API OCI_MsgSetRaw(OCI_Msg *msg, const void *raw, unsigned int size)
Set the RAW payload of the given message.
OCI_EXPORT boolean OCI_API OCI_MsgSetConsumers(OCI_Msg *msg, OCI_Agent **consumers, unsigned int count)
Set the recipient list of a message to enqueue.
Date & operator--()
Decrement the date by 1 day.
OCI_EXPORT boolean OCI_API OCI_QueueTableMigrate(OCI_Connection *con, const otext *queue_table, const otext *compatible)
Migrate a queue table from one version to another.
OCI_EXPORT boolean OCI_API OCI_ObjectSetTimestamp(OCI_Object *obj, const otext *attr, OCI_Timestamp *value)
Set an object attribute of type Timestamp.
unsigned int GetColumnCount() const
Return the number of columns contained in the type.
OCI_EXPORT boolean OCI_API OCI_RegisterLob(OCI_Statement *stmt, const otext *name, unsigned int type)
Register a lob output bind placeholder.
OCI_EXPORT boolean OCI_API OCI_ThreadFree(OCI_Thread *thread)
Destroy a thread object.
void Set(unsigned int index, const TDataType &value)
Set the collection element value at the given position.
STL compliant bi-directional iterator class.
Definition: ocilib.hpp:4628
OCI_EXPORT boolean OCI_API OCI_TimestampIntervalAdd(OCI_Timestamp *tmsp, OCI_Interval *itv)
Add an interval value to a timestamp value of a timestamp handle.
OCI_EXPORT OCI_Date *OCI_API OCI_ObjectGetDate(OCI_Object *obj, const otext *attr)
Return the date value of the given object attribute.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfStrings(OCI_Statement *stmt, const otext *name, otext *data, unsigned int len, unsigned int nbelem)
Bind an array of strings.
unsigned int GetServerRevisionVersion() const
Return the revision version number of the connected database server.
OCI_EXPORT boolean OCI_API OCI_ObjectGetSelfRef(OCI_Object *obj, OCI_Ref *ref)
Retrieve an Oracle Ref handle from an object and assign it to the given OCILIB OCI_Ref handle...
OCI_EXPORT boolean OCI_API OCI_PoolFree(OCI_Pool *pool)
Destroy a pool object.
OCI_EXPORT OCI_Coll *OCI_API OCI_CollCreate(OCI_TypeInfo *typinf)
Create a local collection instance.
Oracle internal timestamp representation.
Interval operator+(const Interval &other)
Return a new Interval holding the sum of the current Interval value and the given Interval value...
OCI_EXPORT unsigned int OCI_API OCI_GetFetchSize(OCI_Statement *stmt)
Return the number of rows fetched per internal server fetch call.
void SetMonth(int value)
Set the timestamp month value.
OCI_EXPORT boolean OCI_API OCI_ColumnGetNullable(OCI_Column *col)
Return the nullable attribute of the column.
OCI_EXPORT const otext *OCI_API OCI_FileGetName(OCI_File *file)
Return the name of the given file.
OCI_EXPORT unsigned int OCI_API OCI_GetStatementType(OCI_Statement *stmt)
Return the type of a SQL statement.
OCI_EXPORT boolean OCI_API OCI_QueueCreate(OCI_Connection *con, const otext *queue_name, const otext *queue_table, unsigned int queue_type, unsigned int max_retries, unsigned int retry_delay, unsigned int retention_time, boolean dependency_tracking, const otext *comment)
Create a queue.
OCI_EXPORT unsigned int OCI_API OCI_GetRaw(OCI_Resultset *rs, unsigned int index, void *buffer, unsigned int len)
Copy the current raw value of the column at the given index into the specified buffer.
OCI_EXPORT boolean OCI_API OCI_FileSeek(OCI_File *file, big_uint offset, unsigned int mode)
Perform a seek operation on the OCI_File content buffer.
OCI_EXPORT boolean OCI_API OCI_SetAutoCommit(OCI_Connection *con, boolean enable)
Enable / disable auto commit mode.
OCI_EXPORT boolean OCI_API OCI_LobIsTemporary(OCI_Lob *lob)
Check if the given lob is a temporary lob.
OCI_EXPORT boolean OCI_API OCI_DirPathSetColumn(OCI_DirPath *dp, unsigned int index, const otext *name, unsigned int maxsize, const otext *format)
Describe a column to load into the given table.
OCI_EXPORT const otext *OCI_API OCI_GetDefaultFormatNumeric(OCI_Connection *con)
Return the current numeric format for implicit string / numeric conversions.
ostring ToString() const
return a string representation of the current object
OCI_EXPORT boolean OCI_API OCI_DirPathSetNoLog(OCI_DirPath *dp, boolean value)
Set the logging mode for the loading operation.
OCI_EXPORT boolean OCI_API OCI_IsConnected(OCI_Connection *con)
Returns TRUE is the given connection is still connected otherwise FALSE.
static void SetHAHandler(HAHandlerProc handler)
Set the High availability (HA) user handler.
TDataType Get(unsigned int index) const
Return the collection element value at the given position.
OCI_EXPORT boolean OCI_API OCI_QueueTableCreate(OCI_Connection *con, const otext *queue_table, const otext *queue_payload_type, const otext *storage_clause, const otext *sort_list, boolean multiple_consumers, unsigned int message_grouping, const otext *comment, unsigned int primary_instance, unsigned int secondary_instance, const otext *compatible)
Create a queue table for messages of the given type.
OCI_EXPORT OCI_Bind *OCI_API OCI_GetBind2(OCI_Statement *stmt, const otext *name)
Return a bind handle from its name.
OCI_EXPORT boolean OCI_API OCI_Prepare(OCI_Statement *stmt, const otext *sql)
Prepare a SQL statement or PL/SQL block.
OCI_EXPORT boolean OCI_API OCI_DequeueSetAgentList(OCI_Dequeue *dequeue, OCI_Agent **consumers, unsigned int count)
Set the Agent list to listen to message for.
bool operator!=(const Lob &other) const
Indicates if the current lob value is not equal the given lob value.
OCI_EXPORT boolean OCI_API OCI_PoolSetTimeout(OCI_Pool *pool, unsigned int value)
Set the connections/sessions idle timeout.
void SetDate(int year, int month, int day)
Set the date part.
OCI_EXPORT OCI_File *OCI_API OCI_GetFile(OCI_Resultset *rs, unsigned int index)
Return the current File value of the column at the given index in the resultset.
ostring GetTimeZone() const
Return the name of the current time zone.
OCI_EXPORT boolean OCI_API OCI_DateSetDateTime(OCI_Date *date, int year, int month, int day, int hour, int min, int sec)
Set the date and time portions if the given date handle.
Connection GetConnection(const ostring &sessionTag=OTEXT(""))
Get a connection from the pool.
OCI_EXPORT boolean OCI_API OCI_ObjectSetInt(OCI_Object *obj, const otext *attr, int value)
Set an object attribute of type int.
OCI_EXPORT big_uint OCI_API OCI_LobGetLength(OCI_Lob *lob)
Return the actual length of a lob.
Connection GetConnection() const
Return the connection associated with a statement.
OCI_EXPORT unsigned int OCI_API OCI_GetServerMajorVersion(OCI_Connection *con)
Return the major version number of the connected database server.
OCI_EXPORT boolean OCI_API OCI_DirPathSetEntry(OCI_DirPath *dp, unsigned int row, unsigned int index, void *value, unsigned size, boolean complete)
Set the value of the given row/column array entry.
OCI_EXPORT OCI_Lob *OCI_API OCI_ElemGetLob(OCI_Elem *elem)
Return the Lob value of the given collection element.
OCI_EXPORT boolean OCI_API OCI_LobEnableBuffering(OCI_Lob *lob, boolean value)
Enable / disable buffering mode on the given lob handle.
ostring GetConnectionString() const
Return the name of the connected database/service name.
OCI_EXPORT unsigned int OCI_API OCI_GetStatementCacheSize(OCI_Connection *con)
Return the maximum number of statements to keep in the statement cache.
OCI_EXPORT boolean OCI_API OCI_SetTransaction(OCI_Connection *con, OCI_Transaction *trans)
Set a transaction to a connection.
OCI_EXPORT boolean OCI_API OCI_CollTrim(OCI_Coll *coll, unsigned int nb_elem)
Trims the given number of elements from the end of the collection.
void Open(const ostring &db, const ostring &user, const ostring &pwd, Environment::SessionFlags sessionFlags=Environment::SessionDefault)
Create a physical connection to an Oracle database server.
OCI_EXPORT boolean OCI_API OCI_RefFree(OCI_Ref *ref)
Free a local Ref.
OCI_EXPORT OCI_Transaction *OCI_API OCI_GetTransaction(OCI_Connection *con)
Return the current transaction of the connection.
AnyPointer GetUserData()
Return the pointer to user data previously associated with the connection.
Enum< CharsetModeValues > CharsetMode
Environment charset mode.
Definition: ocilib.hpp:681
OCI_EXPORT boolean OCI_API OCI_DateNextDay(OCI_Date *date, const otext *day)
Gets the date of next day of the week, after a given date.
OCI_EXPORT boolean OCI_API OCI_Rollback(OCI_Connection *con)
Cancel current pending changes.
OCI_EXPORT OCI_TypeInfo *OCI_API OCI_ObjectGetTypeInfo(OCI_Object *obj)
Return the type info object associated to the object.
OCI_EXPORT unsigned int OCI_API OCI_LongGetSize(OCI_Long *lg)
Return the buffer size of a long object in bytes (OCI_BLONG) or character (OCI_CLONG) ...
void Execute()
Execute a prepared SQL statement or PL/SQL block.
OCI_EXPORT boolean OCI_API OCI_FileOpen(OCI_File *file)
Open a file for reading.
OCI_EXPORT boolean OCI_API OCI_FetchSeek(OCI_Resultset *rs, unsigned int mode, int offset)
Custom Fetch of the resultset.
OCI_EXPORT boolean OCI_API OCI_IntervalGetYearMonth(OCI_Interval *itv, int *year, int *month)
Return the year / month portion of an interval handle.
OCI_EXPORT boolean OCI_API OCI_IntervalSetDaySecond(OCI_Interval *itv, int day, int hour, int min, int sec, int fsec)
Set the day / time portion if the given interval handle.
OCI_EXPORT void OCI_API OCI_EnableWarnings(boolean value)
Enable or disable Oracle warning notifications.
int GetHours() const
Return the interval hours value.
Pool()
Default constructor.
Template Flags template class providing some type safety to some extends for manipulating flags set v...
Enum< TypeInfoTypeValues > TypeInfoType
Type of object information.
Definition: ocilib.hpp:4089
OCI_EXPORT boolean OCI_API OCI_ElemSetColl(OCI_Elem *elem, OCI_Coll *value)
Assign a Collection handle to a collection element.
int GetSeconds() const
Return the interval seconds value.
OCI_EXPORT unsigned int OCI_API OCI_DequeueGetVisibility(OCI_Dequeue *dequeue)
Get the dequeuing/locking behavior.
OCI_EXPORT boolean OCI_API OCI_ElemSetDate(OCI_Elem *elem, OCI_Date *value)
Assign a Date handle to a collection element.
OCI_EXPORT boolean OCI_API OCI_ObjectSetUnsignedShort(OCI_Object *obj, const otext *attr, unsigned short value)
Set an object attribute of type unsigned short.
OCI_EXPORT unsigned int OCI_API OCI_GetDataLength(OCI_Resultset *rs, unsigned int index)
Return the current row data length of the column at the given index in the resultset.
void SetDay(int value)
Set the interval day value.
unsigned int GetVersion() const
Return the Oracle version supported by the connection.
OCI_EXPORT boolean OCI_API OCI_RegisterString(OCI_Statement *stmt, const otext *name, unsigned int len)
Register a string output bind placeholder.
OCI_EXPORT boolean OCI_API OCI_RegisterShort(OCI_Statement *stmt, const otext *name)
Register a short output bind placeholder.
void Commit()
Commit current pending changes.
OCI_EXPORT OCI_Object *OCI_API OCI_ElemGetObject(OCI_Elem *elem)
Return the object value of the given collection element.
Enum< ImportModeValues > ImportMode
OCI libraries import mode.
Definition: ocilib.hpp:659
OCI_EXPORT unsigned int OCI_API OCI_GetSQLCommand(OCI_Statement *stmt)
Return the Oracle SQL code the command held by the statement handle.
OCI_EXPORT unsigned int OCI_API OCI_DirPathGetRowCount(OCI_DirPath *dp)
Return the number of rows successfully loaded into the database so far.
void Break()
Perform an immediate abort of any currently Oracle OCI call on the given connection.
OCI_EXPORT boolean OCI_API OCI_TimestampAssign(OCI_Timestamp *tmsp, OCI_Timestamp *tmsp_src)
Assign the value of a timestamp handle to another one.
static void StartDatabase(const ostring &db, const ostring &user, const ostring &pwd, Environment::StartFlags startFlags, Environment::StartMode startMode, Environment::SessionFlags sessionFlags=SessionSysDba, const ostring &spfile=OTEXT(""))
Start a database instance.
OCI_EXPORT boolean OCI_API OCI_DirPathSetConvertMode(OCI_DirPath *dp, unsigned int mode)
Set the direct path conversion mode.
OCI_EXPORT int OCI_API OCI_ColumnGetFractionalPrecision(OCI_Column *col)
Return the fractional precision of the column for timestamp and interval columns. ...
void SetYear(int value)
Set the timestamp year value.
OCI_EXPORT unsigned int OCI_API OCI_GetPrefetchMemory(OCI_Statement *stmt)
Return the amount of memory used to retrieve rows pre-fetched by OCI Client.
OCI_EXPORT boolean OCI_API OCI_SetPrefetchSize(OCI_Statement *stmt, unsigned int size)
Set the number of rows pre-fetched by OCI Client.
OCI_EXPORT boolean OCI_API OCI_DequeueGetRelativeMsgID(OCI_Dequeue *dequeue, void *id, unsigned int *len)
Get the message identifier of the message to be dequeued.
OCI_EXPORT boolean OCI_API OCI_DirPathSetParallel(OCI_DirPath *dp, boolean value)
Set the parallel loading mode.
OCI_EXPORT boolean OCI_API OCI_DequeueSetCorrelation(OCI_Dequeue *dequeue, const otext *pattern)
set the correlation identifier of the message to be dequeued
OCILIB encapsulation of A/Q message.
int GetDay() const
Return the timestamp day value.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfRefs(OCI_Statement *stmt, const otext *name, OCI_Ref **data, OCI_TypeInfo *typinf, unsigned int nbelem)
Bind an array of Ref handles.
OCI_EXPORT boolean OCI_API OCI_QueueAlter(OCI_Connection *con, const otext *queue_name, unsigned int max_retries, unsigned int retry_delay, unsigned int retention_time, const otext *comment)
Alter the given queue.
std::vector< unsigned char > Raw
C++ counterpart of SQL RAW data type.
Definition: ocilib.hpp:183
OCI_EXPORT OCI_Dequeue *OCI_API OCI_DequeueCreate(OCI_TypeInfo *typinf, const otext *name)
Create a Dequeue object for the given queue.
bool operator>(const Timestamp &other) const
Indicates if the current Timestamp value is superior to the given Timestamp value.
OCI_EXPORT OCI_Error *OCI_API OCI_GetBatchError(OCI_Statement *stmt)
Returns the first or next error that occurred within a DML array statement execution.
Transaction(const Connection &connection, unsigned int timeout, TransactionFlags flags, OCI_XID *pxid=NULL)
Create a new global transaction or a serializable/read-only local transaction.
unsigned int GetMaxSize() const
Return the maximum number of connections/sessions that can be opened to the database.
OCI_EXPORT OCI_Resultset *OCI_API OCI_GetNextResultset(OCI_Statement *stmt)
Retrieve the next available resultset.
OCI_EXPORT unsigned int OCI_API OCI_TransactionGetTimeout(OCI_Transaction *trans)
Return global transaction Timeout.
OCI_EXPORT boolean OCI_API OCI_ElemSetInt(OCI_Elem *elem, int value)
Set a int value to a collection element.
OCI_EXPORT boolean OCI_API OCI_LongFree(OCI_Long *lg)
Free a local temporary long.
Connection GetConnection() const
Return the file parent connection.
OCI_EXPORT double OCI_API OCI_ElemGetDouble(OCI_Elem *elem)
Return the Double value of the given collection element.
OCI_EXPORT boolean OCI_API OCI_RegisterRef(OCI_Statement *stmt, const otext *name, OCI_TypeInfo *typinf)
Register a Ref output bind placeholder.
OCI_EXPORT boolean OCI_API OCI_TimestampToText(OCI_Timestamp *tmsp, const otext *fmt, int size, otext *str, int precision)
Convert a timestamp value from the given timestamp handle to a string.
OCI_EXPORT short OCI_API OCI_GetShort(OCI_Resultset *rs, unsigned int index)
Return the current short value of the column at the given index in the resultset. ...
Iterator begin()
Returns an iterator pointing to the first element in the collection.
void Set(const ostring &name, const TDataType &value)
Set the given object attribute value.
Provides type information on Oracle Database objects.
Definition: ocilib.hpp:4058
OCI_EXPORT boolean OCI_API OCI_SetPrefetchMemory(OCI_Statement *stmt, unsigned int size)
Set the amount of memory pre-fetched by OCI Client.
unsigned int GetIncrement() const
Return the increment for connections/sessions to be opened to the database when the pool is not full...
unsigned int GetServerMajorVersion() const
Return the major version number of the connected database server.
OCI_EXPORT OCI_Column *OCI_API OCI_TypeInfoGetColumn(OCI_TypeInfo *typinf, unsigned int index)
Return the column object handle at the given index in the table.
void SysDate()
Assign the current system date time to the current date object.
int GetMonth() const
Return the timestamp month value.
OCI_EXPORT const otext *OCI_API OCI_EventGetRowid(OCI_Event *event)
Return the rowid of the altered database object row.
OCI_EXPORT unsigned int OCI_API OCI_DirPathGetErrorRow(OCI_DirPath *dp)
Return the index of a row which caused an error during data conversion.
void Rollback()
Cancel current pending changes.
OCI_EXPORT const otext *OCI_API OCI_ElemGetString(OCI_Elem *elem)
Return the String value of the given collection element.
OCI_EXPORT const otext *OCI_API OCI_GetServiceName(OCI_Connection *con)
Return the Oracle server service name of the connected database/service name.
OCI_EXPORT OCI_Object *OCI_API OCI_MsgGetObject(OCI_Msg *msg)
Get the object payload of the given message.
OCI_EXPORT boolean OCI_API OCI_BindShort(OCI_Statement *stmt, const otext *name, short *data)
Bind an short variable.
OCI_EXPORT boolean OCI_API OCI_ElemSetDouble(OCI_Elem *elem, double value)
Set a double value to a collection element.
OCI_EXPORT const otext *OCI_API OCI_DequeueGetConsumer(OCI_Dequeue *dequeue)
Get the current consumer name associated with the dequeuing process.
TypeInfoType GetType() const
Return the type of the given TypeInfo object.
OCI_EXPORT boolean OCI_API OCI_ElemSetObject(OCI_Elem *elem, OCI_Object *value)
Assign an Object handle to a collection element.
Lob Clone() const
Clone the current instance to a new one performing deep copy.
OCI_EXPORT unsigned int OCI_API OCI_GetUnsignedInt(OCI_Resultset *rs, unsigned int index)
Return the current unsigned integer value of the column at the given index in the resultset...
OCI_EXPORT boolean OCI_API OCI_RefIsNull(OCI_Ref *ref)
Check if the Ref points to an object or not.
Lob(const Connection &connection)
Parametrized constructor.
OCI_EXPORT unsigned int OCI_API OCI_GetOCIRuntimeVersion(void)
Return the version of OCI used at runtime.
OCI_EXPORT boolean OCI_API OCI_BindFloat(OCI_Statement *stmt, const otext *name, float *data)
Bind a float variable.
OCI_EXPORT boolean OCI_API OCI_IsNull2(OCI_Resultset *rs, const otext *name)
Check if the current row value is null for the column of the given name in the resultset.
OCI_EXPORT boolean OCI_API OCI_TimestampGetDate(OCI_Timestamp *tmsp, int *year, int *month, int *day)
Extract the date part from a timestamp handle.
Date & operator-=(int value)
Decrement the date by the given number of days.
OCI_EXPORT boolean OCI_API OCI_DequeueSetMode(OCI_Dequeue *dequeue, unsigned int mode)
Set the dequeuing/locking behavior.
ostring GetServerVersion() const
Return the connected database server string version.
unsigned int GetOpenedConnectionsCount() const
Return the current number of opened connections/sessions.
void GetDaySecond(int &day, int &hour, int &min, int &sec, int &fsec) const
Extract the date / second parts from the interval value.
bool IsTemporary() const
Check if the given lob is a temporary lob.
OCI_EXPORT big_uint OCI_API OCI_LobGetMaxSize(OCI_Lob *lob)
Return the maximum size that the lob can contain.
OCI_EXPORT int OCI_API OCI_ElemGetInt(OCI_Elem *elem)
Return the int value of the given collection element.
OCI_EXPORT boolean OCI_API OCI_FileClose(OCI_File *file)
Close a file.
OCI_EXPORT boolean OCI_API OCI_DirPathPrepare(OCI_DirPath *dp)
Prepares the OCI direct path load interface before any rows can be converted or loaded.
big_uint GetOffset() const
Returns the current R/W offset within the file.
OCI_EXPORT void *OCI_API OCI_LongGetBuffer(OCI_Long *lg)
Return the internal buffer of an OCI_Long object read from a fetch sequence.
OCI_EXPORT unsigned int OCI_API OCI_TypeInfoGetType(OCI_TypeInfo *typinf)
Return the type of the type info object.
bool Exists() const
Check if the given file exists on server.
unsigned int GetStatementCacheSize() const
Return the maximum number of statements to keep in the pool's statement cache.
OCI_EXPORT boolean OCI_API OCI_SetFetchSize(OCI_Statement *stmt, unsigned int size)
Set the number of rows fetched per internal server fetch call.
bool operator==(const File &other) const
Indicates if the current file value is equal the given file value.
OCI_EXPORT unsigned int OCI_API OCI_DirPathGetMaxRows(OCI_DirPath *dp)
Return the maximum number of rows allocated in the OCI and OCILIB internal arrays of rows...
OCI_EXPORT unsigned int OCI_API OCI_EnqueueGetSequenceDeviation(OCI_Enqueue *enqueue)
Return the sequence deviation of messages to enqueue to the queue.
void EnableServerOutput(unsigned int bufsize, unsigned int arrsize, unsigned int lnsize)
Enable the server output.
OCI_EXPORT OCI_Msg *OCI_API OCI_DequeueGet(OCI_Dequeue *dequeue)
Dequeue messages from the given queue.
OCI_EXPORT OCI_Agent *OCI_API OCI_AgentCreate(OCI_Connection *con, const otext *name, const otext *address)
Create an AQ agent object.
unsigned int GetSize() const
Returns the total number of elements in the collection.
bool operator<=(const Interval &other) const
Indicates if the current Interval value is inferior or equal to the given Interval value...
OCI_EXPORT unsigned int OCI_API OCI_GetBindMode(OCI_Statement *stmt)
Return the binding mode of a SQL statement.
ostring ToString(const ostring &format=OCI_STRING_FORMAT_DATE) const
Convert the date value to a string.
OCI_EXPORT big_int OCI_API OCI_ObjectGetBigInt(OCI_Object *obj, const otext *attr)
Return the big integer value of the given object attribute.
OCI_EXPORT boolean OCI_API OCI_TimestampSysTimestamp(OCI_Timestamp *tmsp)
Stores the system current date and time as a timestamp value with time zone into the timestamp handle...
bool Seek(SeekMode seekMode, big_uint offset)
Move the current position within the file for read/write operations.
Date NextDay(const ostring &day) const
Return the date of next day of the week, after the current date object.
OCI_EXPORT unsigned int OCI_API OCI_CollGetType(OCI_Coll *coll)
Return the collection type.
Date & operator+=(int value)
Increment the date by the given number of days.
OCI_EXPORT boolean OCI_API OCI_CollToText(OCI_Coll *coll, unsigned int *size, otext *str)
Convert a collection handle value to a string.
big_uint GetMaxSize() const
Returns the lob maximum possible size.
OCI_EXPORT boolean OCI_API OCI_SetSessionTag(OCI_Connection *con, const otext *tag)
Associate a tag to the given connection/session.
OCI_EXPORT boolean OCI_API OCI_BindIsNullAtPos(OCI_Bind *bnd, unsigned int position)
Check if the current entry value at the given index of the binded array is marked as NULL...
Enum< FailoverRequestValues > FailoverRequest
Failover requests.
Definition: ocilib.hpp:1505
OCI_EXPORT boolean OCI_API OCI_MsgSetExpiration(OCI_Msg *msg, int value)
set the duration that the message is available for dequeuing
OCI_EXPORT unsigned int OCI_API OCI_TimestampGetType(OCI_Timestamp *tmsp)
Return the type of the given Timestamp object.
OCI_EXPORT boolean OCI_API OCI_IntervalFromText(OCI_Interval *itv, const otext *str)
Convert a string to an interval and store it in the given interval handle.
void GetYearMonth(int &year, int &month) const
Extract the year / month parts from the interval value.
void SetTime(int hour, int min, int sec, int fsec)
Set the time part.
Lob< ostring, LobNationalCharacter > NClob
Class handling NCLOB oracle type.
Definition: ocilib.hpp:3855
OCI_EXPORT OCI_Timestamp *OCI_API OCI_TimestampCreate(OCI_Connection *con, unsigned int type)
Create a local Timestamp instance.
OCI_EXPORT boolean OCI_API OCI_ObjectSetInterval(OCI_Object *obj, const otext *attr, OCI_Interval *value)
Set an object attribute of type Interval.
bool operator<=(const Timestamp &other) const
Indicates if the current Timestamp value is inferior or equal to the given Timestamp value...
static void Acquire(MutexHandle handle)
Acquire a mutex lock.
OCI_EXPORT boolean OCI_API OCI_SetStatementCacheSize(OCI_Connection *con, unsigned int value)
Set the maximum number of statements to keep in the statement cache.
void SetReferenceNull()
Nullify the given Ref handle.
OCI_EXPORT OCI_Thread *OCI_API OCI_ThreadCreate(void)
Create a Thread object.
OCI_EXPORT unsigned int OCI_API OCI_TypeInfoGetColumnCount(OCI_TypeInfo *typinf)
Retruns the number of columns of a table/view/object.
int GetMinutes() const
Return the timestamp minutes value.
void SetAttributeNull(const ostring &name)
Set the given object attribute to null.
OCI_EXPORT boolean OCI_API OCI_ObjectSetFloat(OCI_Object *obj, const otext *attr, float value)
Set an object attribute of type float.
OCI_EXPORT OCI_Coll *OCI_API OCI_ObjectGetColl(OCI_Object *obj, const otext *attr)
Return the collection value of the given object attribute.
OCI_EXPORT boolean OCI_API OCI_SetLongMode(OCI_Statement *stmt, unsigned int mode)
Set the long datatype handling mode of a SQL statement.
OCI_EXPORT boolean OCI_API OCI_AgentFree(OCI_Agent *agent)
Free an AQ agent object.
OCI_EXPORT OCI_Long *OCI_API OCI_GetLong2(OCI_Resultset *rs, const otext *name)
Return the current Long value of the column from its name in the resultset.
OCI_EXPORT int OCI_API OCI_IntervalCheck(OCI_Interval *itv)
Check if the given interval is valid.
OCI_EXPORT OCI_Connection *OCI_API OCI_StatementGetConnection(OCI_Statement *stmt)
Return the connection handle associated with a statement handle.
OCI_EXPORT boolean OCI_API OCI_QueueTableDrop(OCI_Connection *con, const otext *queue_table, boolean force)
Drop the given queue table.
OCI_EXPORT OCI_Timestamp *OCI_API OCI_GetTimestamp(OCI_Resultset *rs, unsigned int index)
Return the current timestamp value of the column at the given index in the resultset.
OCI_EXPORT boolean OCI_API OCI_BindLong(OCI_Statement *stmt, const otext *name, OCI_Long *data, unsigned int size)
Bind a Long variable.
OCI_EXPORT unsigned int OCI_API OCI_GetBindCount(OCI_Statement *stmt)
Return the number of binds currently associated to a statement.
OCI_EXPORT OCI_Agent *OCI_API OCI_DequeueListen(OCI_Dequeue *dequeue, int timeout)
Listen for messages that match any recipient of the associated Agent list.
unsigned int GetMax() const
Returns the maximum number of elements for the collection.
OCI_EXPORT boolean OCI_API OCI_MsgSetPriority(OCI_Msg *msg, int value)
Set the priority of the message.
OCI_EXPORT int OCI_API OCI_MsgGetEnqueueDelay(OCI_Msg *msg)
Return the number of seconds that a message is delayed for dequeuing.
Object identifying the SQL data type LOB (CLOB, NCLOB and BLOB)
Definition: ocilib.hpp:3558
OCI_EXPORT OCI_TypeInfo *OCI_API OCI_ColumnGetTypeInfo(OCI_Column *col)
Return the type information object associated to the column.
OCI_EXPORT unsigned int OCI_API OCI_PoolGetTimeout(OCI_Pool *pool)
Get the idle timeout for connections/sessions in the pool.
OCI_EXPORT boolean OCI_API OCI_RegisterTimestamp(OCI_Statement *stmt, const otext *name, unsigned int type)
Register a timestamp output bind placeholder.
OCI_EXPORT OCI_File *OCI_API OCI_ObjectGetFile(OCI_Object *obj, const otext *attr)
Return the file value of the given object attribute.
TLobObjectType Read(unsigned int length)
Read a portion of a lob.
Oracle External Large objects:
TypeInfo(const Connection &connection, const ostring &name, TypeInfoType type)
Parametrized constructor.
OCI_EXPORT OCI_Interval *OCI_API OCI_ObjectGetInterval(OCI_Object *obj, const otext *attr)
Return the interval value of the given object attribute.
OCI_EXPORT boolean OCI_API OCI_IntervalFree(OCI_Interval *itv)
Free an OCI_Interval handle.
OCI_EXPORT boolean OCI_API OCI_DirPathSave(OCI_DirPath *dp)
Execute a data savepoint (server side)
OCI_EXPORT boolean OCI_API OCI_MsgSetEnqueueDelay(OCI_Msg *msg, int value)
set the number of seconds to delay the enqueued message
Oracle Internal Large objects:
OCI_EXPORT boolean OCI_API OCI_DateGetDate(OCI_Date *date, int *year, int *month, int *day)
Extract the date part from a date handle.
unsigned int GetRow() const
Return the row index which caused an error during statement execution.
OCI_EXPORT unsigned int OCI_API OCI_ColumnGetSize(OCI_Column *col)
Return the size of the column.
unsigned int GetCount() const
Returns the current number of elements in the collection.
static Environment::CharsetMode GetCharset()
Return the OCILIB charset type.
OCI_EXPORT boolean OCI_API OCI_TransactionStart(OCI_Transaction *trans)
Start global transaction.
Lob< ostring, LobCharacter > Clob
Class handling CLOB oracle type.
Definition: ocilib.hpp:3844
OCI_EXPORT unsigned int OCI_API OCI_GetColumnIndex(OCI_Resultset *rs, const otext *name)
Return the index of the column in the result from its name.
int GetDay() const
Return the date day value.
OCI_EXPORT boolean OCI_API OCI_BindColl(OCI_Statement *stmt, const otext *name, OCI_Coll *data)
Bind a Collection variable.
void SetSessionTag(const ostring &tag)
Associate a tag to the given connection/session.
OCI_EXPORT unsigned int OCI_API OCI_LongWrite(OCI_Long *lg, void *buffer, unsigned int len)
Write a buffer into a Long.
OCI_EXPORT boolean OCI_API OCI_QueueDrop(OCI_Connection *con, const otext *queue_name)
Drop the given queue.
OCI_EXPORT int OCI_API OCI_ColumnGetPrecision(OCI_Column *col)
Return the precision of the column for numeric columns.
OCI_EXPORT const otext *OCI_API OCI_GetServerName(OCI_Connection *con)
Return the Oracle server machine name of the connected database/service name.
OCI_EXPORT boolean OCI_API OCI_DequeueUnsubscribe(OCI_Dequeue *dequeue)
Unsubscribe for asynchronous messages notifications.
int GetMinutes() const
Return the interval minutes value.
OCI_EXPORT boolean OCI_API OCI_TransactionStop(OCI_Transaction *trans)
Stop current global transaction.
OCI_EXPORT unsigned int OCI_API OCI_DirPathGetCurrentRows(OCI_DirPath *dp)
Return the current number of rows used in the OCILIB internal arrays of rows.
OCI_EXPORT boolean OCI_API OCI_MsgSetCorrelation(OCI_Msg *msg, const otext *correlation)
set the correlation identifier of the message
OCI_EXPORT unsigned int OCI_API OCI_ErrorGetRow(OCI_Error *err)
Return the row index which caused an error during statement execution.
OCI_EXPORT boolean OCI_API OCI_ElemFree(OCI_Elem *elem)
Free a local collection element.
OCI_EXPORT const otext *OCI_API OCI_AgentGetName(OCI_Agent *agent)
Get the given AQ agent name.
OCI_EXPORT OCI_DirPath *OCI_API OCI_DirPathCreate(OCI_TypeInfo *typinf, const otext *partition, unsigned int nb_cols, unsigned int nb_rows)
Create a direct path object.
OCI_EXPORT boolean OCI_API OCI_LobSeek(OCI_Lob *lob, big_uint offset, unsigned int mode)
Perform a seek operation on the OCI_lob content buffer.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfObjects(OCI_Statement *stmt, const otext *name, OCI_Object **data, OCI_TypeInfo *typinf, unsigned int nbelem)
Bind an array of object handles.
void SetYear(int value)
Set the date year value.
int GetYear() const
Return the timestamp year value.
OCI_EXPORT boolean OCI_API OCI_DirPathFlushRow(OCI_DirPath *dp)
Flushes a partially loaded row from server.
OCI_EXPORT boolean OCI_API OCI_ElemSetTimestamp(OCI_Elem *elem, OCI_Timestamp *value)
Assign a Timestamp handle to a collection element.
OCI_EXPORT boolean OCI_API OCI_Initialize(POCI_ERROR err_handler, const otext *lib_path, unsigned int mode)
Initialize the library.
OCI_EXPORT const otext *OCI_API OCI_GetSql(OCI_Statement *stmt)
Return the last SQL or PL/SQL statement prepared or executed by the statement.
AQ message.
Definition: ocilib.hpp:6536
Database resultset.
Definition: ocilib.hpp:5716
OCI_EXPORT OCI_Coll *OCI_API OCI_GetColl2(OCI_Resultset *rs, const otext *name)
Return the current Collection value of the column from its name in the resultset. ...
OCI_EXPORT boolean OCI_API OCI_ObjectSetString(OCI_Object *obj, const otext *attr, const otext *value)
Set an object attribute of type string.
Date & operator++()
Increment the date by 1 day.
OCI_EXPORT big_uint OCI_API OCI_ElemGetUnsignedBigInt(OCI_Elem *elem)
Return the unsigned big int value of the given collection element.
OCI_EXPORT unsigned int OCI_API OCI_PoolGetMin(OCI_Pool *pool)
Return the minimum number of connections/sessions that can be opened to the database.
Flags< TransactionFlagsValues > TransactionFlags
Transaction flags.
Definition: ocilib.hpp:2230
void GetDate(int &year, int &month, int &day) const
Extract the date parts.
OCI_EXPORT int OCI_API OCI_MsgGetAttemptCount(OCI_Msg *msg)
Return the number of attempts that have been made to dequeue the message.
big_uint Erase(big_uint offset, big_uint length)
Erase a portion of the lob at a given position.
std::basic_string< otext, std::char_traits< otext >, std::allocator< otext > > ostring
string class wrapping the OCILIB otext * type and OTEXT() macros ( see Character sets ) ...
Definition: ocilib.hpp:165
OCI_EXPORT boolean OCI_API OCI_ElemSetShort(OCI_Elem *elem, short value)
Set a short value to a collection element.
Collection of output columns from a select statement.
OCI_EXPORT unsigned int OCI_API OCI_BindGetDataCount(OCI_Bind *bnd)
Return the number of elements of the bind handle.
OCI_EXPORT OCI_Mutex *OCI_API OCI_MutexCreate(void)
Create a Mutex object.
bool operator<=(const Date &other) const
Indicates if the current date value is inferior or equal to the given date value. ...
OCI_EXPORT OCI_Long *OCI_API OCI_LongCreate(OCI_Statement *stmt, unsigned int type)
Create a local temporary Long instance.
OCI_EXPORT boolean OCI_API OCI_IntervalAssign(OCI_Interval *itv, OCI_Interval *itv_src)
Assign the value of a interval handle to another one.
OCI_EXPORT int OCI_API OCI_IntervalCompare(OCI_Interval *itv, OCI_Interval *itv2)
Compares two interval handles.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfBigInts(OCI_Statement *stmt, const otext *name, big_int *data, unsigned int nbelem)
Bind an array of big integers.
OCI_EXPORT OCI_Timestamp *OCI_API OCI_ElemGetTimestamp(OCI_Elem *elem)
Return the Timestamp value of the given collection element.
void SetSeconds(int value)
Set the interval seconds value.
OCI_EXPORT const otext *OCI_API OCI_GetDefaultFormatDate(OCI_Connection *con)
Return the current date format for implicit string / date conversions.
OCI_EXPORT unsigned int OCI_API OCI_GetDefaultLobPrefetchSize(OCI_Connection *con)
Return the default LOB prefetch buffer size for the connection.
bool GetServerOutput(ostring &line) const
Retrieve one line of the server buffer.
OCI_EXPORT boolean OCI_API OCI_LobFree(OCI_Lob *lob)
Free a local temporary lob.
OCI_EXPORT unsigned int OCI_API OCI_ColumnGetType(OCI_Column *col)
Return the type of the given column.
Oracle SQL Column and Type member representation.
int GetMilliSeconds() const
Return the timestamp seconds value.
void AddMonths(int months)
Add or subtract months.
OCI_EXPORT OCI_Object *OCI_API OCI_GetObject(OCI_Resultset *rs, unsigned int index)
Return the current Object value of the column at the given index in the resultset.
OCI_EXPORT boolean OCI_API OCI_TimestampGetTimeZoneOffset(OCI_Timestamp *tmsp, int *hour, int *min)
Return the time zone (hour, minute) portion of a timestamp handle.
TypeInfo GetTypeInfo() const
Return the type information object associated to the collection.
OCI_EXPORT boolean OCI_API OCI_EnqueuePut(OCI_Enqueue *enqueue, OCI_Msg *msg)
Enqueue a message on the queue associated to the Enqueue object.
OCI_EXPORT boolean OCI_API OCI_TransactionResume(OCI_Transaction *trans)
Resume a stopped global transaction.
OCI_EXPORT unsigned int OCI_API OCI_GetSqlErrorPos(OCI_Statement *stmt)
Return the error position (in terms of characters) in the SQL statement where the error occurred in c...
OCI_EXPORT boolean OCI_API OCI_QueueStop(OCI_Connection *con, const otext *queue_name, boolean enqueue, boolean dequeue, boolean wait)
Stop enqueuing or dequeuing or both on the given queue.
OCI_EXPORT boolean OCI_API OCI_LobAppendLob(OCI_Lob *lob, OCI_Lob *lob_src)
Append a source LOB at the end of a destination LOB.
void Close()
Close the file on the server.
OCI_EXPORT boolean OCI_API OCI_MsgSetExceptionQueue(OCI_Msg *msg, const otext *queue)
Set the name of the queue to which the message is moved to if it cannot be processed successfully...
OCI_EXPORT boolean OCI_API OCI_RegisterInterval(OCI_Statement *stmt, const otext *name, unsigned int type)
Register an interval output bind placeholder.
void SetMonth(int value)
Set the interval month value.
OCI_EXPORT boolean OCI_API OCI_Parse(OCI_Statement *stmt, const otext *sql)
Parse a SQL statement or PL/SQL block.
bool operator==(const Interval &other) const
Indicates if the current Interval value is equal to the given Interval value.
Object identifying the SQL data type TIMESTAMP.
Definition: ocilib.hpp:3089
OCI_EXPORT boolean OCI_API OCI_IntervalSetYearMonth(OCI_Interval *itv, int year, int month)
Set the year / month portion if the given Interval handle.
OCI_EXPORT OCI_Statement *OCI_API OCI_ErrorGetStatement(OCI_Error *err)
Retrieve statement handle within the error occurred.
OCI_EXPORT boolean OCI_API OCI_SetFetchMode(OCI_Statement *stmt, unsigned int mode)
Set the fetch mode of a SQL statement.
ostring ToString(int leadingPrecision=10, int fractionPrecision=10) const
Convert the interval value to a string.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfColls(OCI_Statement *stmt, const otext *name, OCI_Coll **data, OCI_TypeInfo *typinf, unsigned int nbelem)
Bind an array of Collection handles.
TransactionFlags GetFlags() const
Return the transaction mode.
OCI_EXPORT boolean OCI_API OCI_DirPathSetDateFormat(OCI_DirPath *dp, const otext *format)
Set the default date format string for input conversion.
OCI_EXPORT boolean OCI_API OCI_DequeueSetRelativeMsgID(OCI_Dequeue *dequeue, const void *id, unsigned int len)
Set the message identifier of the message to be dequeued.
OCI_EXPORT boolean OCI_API OCI_RegisterRaw(OCI_Statement *stmt, const otext *name, unsigned int len)
Register an raw output bind placeholder.
OCI_EXPORT boolean OCI_API OCI_DirPathFinish(OCI_DirPath *dp)
Terminate a direct path operation and commit changes into the database.
OCI_EXPORT boolean OCI_API OCI_EnqueueFree(OCI_Enqueue *enqueue)
Free a Enqueue object.
void SetYearMonth(int year, int month)
Set the Year / Month parts.
OCI_EXPORT boolean OCI_API OCI_RefAssign(OCI_Ref *ref, OCI_Ref *ref_src)
Assign a Ref to another one.
OCI_EXPORT const otext *OCI_API OCI_GetTrace(OCI_Connection *con, unsigned int trace)
Get the current trace for the trace type from the given connection.
OCI_EXPORT OCI_Msg *OCI_API OCI_MsgCreate(OCI_TypeInfo *typinf)
Create a message object based on the given payload type.
Object identifying the SQL data type OBJECT.
Definition: ocilib.hpp:4159
OCI_EXPORT boolean OCI_API OCI_AgentSetAddress(OCI_Agent *agent, const otext *address)
Set the given AQ agent address.
static ThreadId GetThreadId(ThreadHandle handle)
Return the system Thread ID of the given thread handle.
OCI_EXPORT boolean OCI_API OCI_LobFlush(OCI_Lob *lob)
Flush Lob content to the server.
OCI_EXPORT OCI_Lob *OCI_API OCI_GetLob(OCI_Resultset *rs, unsigned int index)
Return the current lob value of the column at the given index in the resultset.
unsigned int GetTimeout() const
Get the idle timeout for connections/sessions in the pool.
OCI_EXPORT boolean OCI_API OCI_BindUnsignedShort(OCI_Statement *stmt, const otext *name, unsigned short *data)
Bind an unsigned short variable.
OCI_EXPORT OCI_Subscription *OCI_API OCI_SubscriptionRegister(OCI_Connection *con, const otext *name, unsigned int type, POCI_NOTIFY handler, unsigned int port, unsigned int timeout)
Register a notification against the given database.
OCI_EXPORT OCI_Ref *OCI_API OCI_ElemGetRef(OCI_Elem *elem)
Return the Ref value of the given collection element.
OCI_EXPORT boolean OCI_API OCI_RegisterFloat(OCI_Statement *stmt, const otext *name)
Register a float output bind placeholder.
static void Check()
Internal usage. Checks if the last OCILIB method call has raised an error. If so, it raises a C++ exc...
Definition: ocilib_impl.hpp:52
bool operator<(const Interval &other) const
Indicates if the current Interval value is inferior to the given Interval value.
OCI_EXPORT boolean OCI_API OCI_ElemSetFloat(OCI_Elem *elem, float value)
Set a float value to a collection element.
Subscription to database or objects changes.
Definition: ocilib.hpp:6182
int GetSeconds() const
Return the date seconds value.
OCI_EXPORT unsigned int OCI_API OCI_ObjectGetRawSize(OCI_Object *obj, const otext *attr)
Return the raw attribute value size of the given object attribute into the given buffer.
OCI_EXPORT boolean OCI_API OCI_BindRef(OCI_Statement *stmt, const otext *name, OCI_Ref *data)
Bind a Ref variable.
int GetMonth() const
Return the date month value.
OCI_EXPORT boolean OCI_API OCI_FileIsEqual(OCI_File *file, OCI_File *file2)
Compare two file handle for equality.
OCI_EXPORT boolean OCI_API OCI_Cleanup(void)
Clean up all resources allocated by the library.
Reference GetReference() const
Creates a reference on the current object.
FailoverResult(* TAFHandlerProc)(Connection &con, FailoverRequest failoverRequest, FailoverEvent failoverEvent)
User callback for TAF event notifications.
Definition: ocilib.hpp:1590
unsigned int GetStatementCacheSize() const
Return the maximum number of statements to keep in the statement cache.
OCI_EXPORT unsigned int OCI_API OCI_BindGetType(OCI_Bind *bnd)
Return the OCILIB type of the given bind.
static ThreadHandle Create()
Create a Thread.
void Copy(Lob &dest, big_uint offset, big_uint offsetDest, big_uint length) const
Copy the given portion of the lob content to another one.
Connection()
Default constructor.
bool operator>=(const Date &other) const
Indicates if the current date value is superior or equal to the given date value. ...
OCI_EXPORT OCI_Pool *OCI_API OCI_PoolCreate(const otext *db, const otext *user, const otext *pwd, unsigned int type, unsigned int mode, unsigned int min_con, unsigned int max_con, unsigned int incr_con)
Create an Oracle pool of connections or sessions.
bool IsReferenceNull() const
Check if the reference points to an object or not.
Interval operator-(const Interval &other)
Return a new Interval holding the difference of the current Interval value and the given Interval val...
Object identifying the SQL data type DATE.
Definition: ocilib.hpp:2311
OCI_EXPORT boolean OCI_API OCI_TimestampConvert(OCI_Timestamp *tmsp, OCI_Timestamp *tmsp_src)
Convert one timestamp value from one type to another.