682{
687 );
688
691 sword status = OCI_SUCCESS;
693 status = ::OCILobFileOpen(
694 pSvcCtx,
695 pError,
697 OCI_FILE_READONLY
698 );
699 if (status != OCI_SUCCESS) {
701 return false;
702 }
703 }
704
705 bool bResult = true;
706 size_t nTotalRead = 0;
707 ub4 nRead = 0;
708 while(nTotalRead < *_size) {
709 nRead = *_size - nTotalRead;
710 status = ::OCILobRead(
711 pSvcCtx,
712 pError,
714 &nRead,
715 1 + nTotalRead,
716 _pbuf,
717 nRead,
719 (OCICallbackLobRead)
NULL,
720 0,
721 SQLCS_IMPLICIT);
722 if (status == OCI_ERROR) {
724 bResult = false;
725 break;
726 }
727
728
729 if (nRead) {
730 nTotalRead += nRead;
731 _pbuf += nRead;
732 }
733 else
734 break;
735
736
737
738 }
739
741 if (bResult) {
742 status = ::OCILobFileClose(
743 pSvcCtx,
744 pError,
746 if (status != OCI_SUCCESS) {
748 return false;
749 }
750 }
751 else {
752
753 status = ::OCILobFileClose(
754 pSvcCtx,
755 conn()->errorHandle2(),
757 if (status != OCI_SUCCESS) {
759 }
760 }
761 }
762
763 if (*_size > nTotalRead)
764 *(_pbuf + nTotalRead) = '\0';
765
766 *_size = nTotalRead;
767
768 return bResult;
769}
#define __DCL_TRACE0(psz)
OCISvcCtx * svcctxHandle() const
OCIError * errorHandle() const
OciConnection * conn() const