Click here to Skip to main content
15,914,608 members
Home / Discussions / Database
   

Database

 
Questionhow to write the querry for copying one image field into another image field in sql server 2000 Pin
developerit12-May-10 20:04
developerit12-May-10 20:04 
AnswerRe: how to write the querry for copying one image field into another image field in sql server 2000 Pin
developerit14-May-10 22:28
developerit14-May-10 22:28 
QuestionOS dependency with Interbase database 6.0 driver? Pin
navneet.professional12-May-10 19:57
navneet.professional12-May-10 19:57 
AnswerRe: OS dependency with Interbase database 6.0 driver? Pin
Henry Minute13-May-10 1:48
Henry Minute13-May-10 1:48 
QuestionHow to use CLongBinary to store image of size > 64 KB with Interbase Database 6.0 driver Pin
navneet.professional12-May-10 19:50
navneet.professional12-May-10 19:50 
QuestionNot Equal to Question/Problem Pin
djhankypark12-May-10 6:09
djhankypark12-May-10 6:09 
AnswerRe: Not Equal to Question/Problem Pin
J4amieC12-May-10 6:23
J4amieC12-May-10 6:23 
AnswerRe: Not Equal to Question/Problem Pin
David Skelly12-May-10 6:24
David Skelly12-May-10 6:24 
GeneralRe: Not Equal to Question/Problem Pin
PIEBALDconsult12-May-10 18:21
mvePIEBALDconsult12-May-10 18:21 
AnswerRe: Not Equal to Question/Problem Pin
Chris Meech12-May-10 6:38
Chris Meech12-May-10 6:38 
GeneralRe: Not Equal to Question/Problem Pin
J4amieC12-May-10 21:49
J4amieC12-May-10 21:49 
QuestionNeed help in query Pin
Saiyed Alam12-May-10 2:48
Saiyed Alam12-May-10 2:48 
AnswerRe: Need help in query Pin
J4amieC12-May-10 3:53
J4amieC12-May-10 3:53 
GeneralRe: Need help in query Pin
David Skelly12-May-10 5:16
David Skelly12-May-10 5:16 
GeneralRe: Need help in query Pin
J4amieC12-May-10 5:21
J4amieC12-May-10 5:21 
GeneralRe: Need help in query Pin
Saiyed Alam12-May-10 18:38
Saiyed Alam12-May-10 18:38 
AnswerRe: Need help in query Pin
Wayne Gaylard12-May-10 4:08
professionalWayne Gaylard12-May-10 4:08 
GeneralRe: Need help in query Pin
J4amieC12-May-10 5:23
J4amieC12-May-10 5:23 
QuestionHow can check the result of the TCP/IP connection???, Pin
Tunisien8611-May-10 23:37
Tunisien8611-May-10 23:37 
AnswerRe: How can check the result of the TCP/IP connection???, Pin
Simon_Whale12-May-10 0:14
Simon_Whale12-May-10 0:14 
GeneralRe: How can check the result of the TCP/IP connection???, Pin
Tunisien8612-May-10 1:02
Tunisien8612-May-10 1:02 
GeneralRe: How can check the result of the TCP/IP connection???, Pin
Simon_Whale12-May-10 1:07
Simon_Whale12-May-10 1:07 
AnswerRe: How can check the result of the TCP/IP connection???, Pin
CitrusTech12-May-10 20:12
CitrusTech12-May-10 20:12 
QuestionProblem to store file of size > 64 KB using BLOB in Interbase database Pin
navneet.professional11-May-10 21:14
navneet.professional11-May-10 21:14 
Hi,

I am successfully stored & retrieved image files of size less than 64 KB.But when I am storing a image file of size 3 MB, then there is no error,but it only stores partial data in database.
Please refer the code:
------------------------------------------------------------------
1. File CMyDb.hpp----->

class CMyDb : public CDatabase
{
public:
CMyDb();
virtual ~CMyDb();
virtual void BindParameters( HSTMT hstmt );

BYTE* m_pabImage; // address of the data of the blob
int m_nImageLen; // sizeof the data in the image, in bytes
CString m_sStmt; // looks like "UPDATE MyTable SET myFld=?
WHERE idxFld=123"
};
------------------------------------------------------------------
2. File CMyDb.cpp----->

CMyDb::CMyDb()
{
m_pabImage = NULL;
m_nImageLen = 0;
}

CMyDb::~CMyDb()
{

}
void CMyDb::BindParameters( HSTMT hstmt)
{
SQLINTEGER nLenOrInd= m_nImageLen;
SQLRETURN rc;
if ( m_sStmt.Find("?") == -1 )
{ // no binding needed
return;
}
rc= SQLBindParameter(
hstmt, (SQLSMALLINT)1, SQL_PARAM_INPUT, SQL_C_BINARY,
SQL_LONGVARCHAR,
m_nImageLen, 0, (void*)m_pabImage, m_nImageLen, &nLenOrInd);
}
------------------------------------------------------------------
3. File Main.cpp->

CFile file (sFileName, CFile::modeRead);//|CFile::typeBinary);
CFileStatus fileStatus;
file.GetStatus(fileStatus);
int nCntImgBytes= 3 * 1024 * 1024;//3MB buffer
BYTE* pabData = (BYTE*)calloc(nCntImgBytes,sizeof(BYTE));
DWORD lTemp = file.ReadHuge((void*)pabData,fileStatus.m_size);
pApp->pServerDatabase->m_pabImage = pabData;
pApp->pServerDatabase->m_nImageLen = fileStatus.m_size;
pApp->pServerDatabase->m_sStmt= "INSERT INTO TEST1 (\"NAME\" , \"myBlobfield\") VALUES ('2',?)";
pApp->pServerDatabase->ExecuteSQL( pApp->pServerDatabase->m_sStmt );
------------------------------------------------------------------

Please reply me as soon as possible.

Regards
Navneet
AnswerRe: Problem to store file of size > 64 KB using BLOB in Interbase database Pin
Bernhard Hiller12-May-10 2:35
Bernhard Hiller12-May-10 2:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.