654{
659 );
660
663 sword status = OCI_SUCCESS;
665 status = ::OCILobFileOpen(
666 pSvcCtx,
667 pError,
669 OCI_FILE_READONLY
670 );
671 if (status != OCI_SUCCESS) {
673 return false;
674 }
675 }
676
677 bool bResult = true;
678 size_t nTotalRead = 0;
679 ub4 nRead = 0;
680 while(nTotalRead < *_size) {
681 nRead = *_size - nTotalRead;
682 status = ::OCILobRead(
683 pSvcCtx,
684 pError,
686 &nRead,
687 1 + nTotalRead,
688 _pbuf,
689 nRead,
691 (OCICallbackLobRead)
NULL,
692 0,
693 SQLCS_IMPLICIT);
694 if (status == OCI_ERROR) {
696 bResult = false;
697 break;
698 }
699
700
701 if (nRead) {
702 nTotalRead += nRead;
703 _pbuf += nRead;
704 }
705 else
706 break;
707
708
709
710 }
711
713 if (bResult) {
714 status = ::OCILobFileClose(
715 pSvcCtx,
716 pError,
718 if (status != OCI_SUCCESS) {
720 return false;
721 }
722 }
723 else {
724
725 status = ::OCILobFileClose(
726 pSvcCtx,
727 conn()->errorHandle2(),
729 if (status != OCI_SUCCESS) {
731 }
732 }
733 }
734
735 if (*_size > nTotalRead)
736 *(_pbuf + nTotalRead) = '\0';
737
738 *_size = nTotalRead;
739
740 return bResult;
741}
#define __DCL_TRACE0(psz)
OCISvcCtx * svcctxHandle() const
OCIError * errorHandle() const
OciConnection * conn() const