php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1197 cannot insert long byte columns
Submitted: 1999-03-02 12:58 UTC Modified: 1999-10-03 06:35 UTC
From: tobi at web-arts dot de Assigned:
Status: Closed Package: Adabas-D related
PHP Version: 3.0.5 OS: linux 2.0.36 (SuSE 6.0)
Private report: No CVE-ID: None
 [1999-03-02 12:58 UTC] tobi at web-arts dot de
I am using the php3 module that came with SuSE Linux 6.0 and its apache server.

When I try to insert a long byte column (that is longvarbinary in ODBC), I get an "Error in assignment", SQLstate 22005 in SQLExecute.

The table was generated with Domain as a long byte column and I tried to write string data into it
using the following sequence of code:

$result2=odbc_prepare($connid1,"insert into blobs(ID,CONTENT_TYPE,BLOB) values (?,?,?)");
$o[0]=1;
$o[1]="image/gif";
$o[2]="rhabarber";
$result2=odbc_execute($result2,$o);

the error appears in odbc_execute.

It doesn't appear when I only insert the first and the second column (numeric and character data).


I don't know where php3 communicates with the Adabas D Database via ODBC, but it should determine the column type with SQLDescribeparam (hstmt, column, &sqltype, &sqllen, &sqlscane,&nullable). Then it should test if the column is of binary type:
switch(sqltype){
  case SQL_BINARY:
  case SQL_VARBINARY:
  case SQL_LONGVARBINARY:
    ctype=SQL_C_BINARY;
    break;
  default:
   ...
  }

and the variable ctype should be used in the SQLSetParam command:

  SQLSetParam(hstmt, column, ctype, sqltype, length,0,data,(SDWORD FAR*) (&length));

then Adabas D should eat it.






Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-10-03 06:35 UTC] kara at cvs dot php dot net
LONGs work ok
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 17:01:58 2024 UTC