Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> BLOB ODBC Oracle
Hi!
We are running into a problem while inserting LOBS through the Oracle ODBC driver. We are using Oracle 8.0.4 RDBMS and 8.0.5 Oracle ODBC driver.
For some reason, it is not working and it fails in SQLPutData and SQLParamData. Could you please throw some light?
Here is the code that we wrote:
void COdbcTestView::OnProceduresOther() {
char CmdBuff[128]; char BlobData[128]; SQLINTEGER BlobSizeIndicator; SQLPOINTER ParameterPtr; SQLRETURN l_ret,ret;
strcpy(BlobData,"ABCDEFGHIJKL");
BlobSizeIndicator = SQL_LEN_DATA_AT_EXEC(strlen(CharData));
sprintf(CmdBuff,"insert into test_odbc (c_blob) values(?)");
l_ret = SQLPrepare(m_ptr_dbproc->hStmt,(unsigned char *)CmdBuff,SQL_NTS);
l_ret = SQLBindParameter(m_ptr_dbproc->hStmt,
1, SQL_PARAM_INPUT, SQL_C_BINARY, SQL_LONGVARBINARY, 0, 0, (SQLPOINTER)BlobData, 0, &BlobSizeIndicator);
l_ret = SQLExecute(m_ptr_dbproc->hStmt);
while (l_ret == SQL_NEED_DATA)
{
l_ret = SQLParamData(m_ptr_dbproc->hStmt,&ParameterPtr); if (l_ret == SQL_NEED_DATA) { ret = SQLPutData(m_ptr_dbproc->hStmt,ParameterPtr,strlen((char *) ParameterPtr)); }
return;
}
// // Table Generation script // /*
c_char CHAR(1), c_tiny NUMBER(3), c_smallint NUMBER(5), c_int NUMBER, c_double NUMBER, c_float NUMBER, c_date DATE, c_datetime DATE, c_string CHAR(31), c_varchar VARCHAR2(31), c_datestr DATE, c_datetimestr DATE, c_blob blob
Thanks a lot for your attention.
regards,
saby
-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Tue Dec 08 1998 - 10:07:03 CST
![]() |
![]() |