Bug #1197: cannot insert long byte columns

From: Date: Tue, 02 Mar 1999 17:59:00 +0000
Subject: Bug #1197: cannot insert long byte columns
Groups: php.dev 
Request: Send a blank email to php-dev+get-4440@lists.php.net to get a copy of this message
From: tobi@web-arts.de Operating system: linux 2.0.36 (SuSE 6.0) PHP version: 3.0.5 PHP Bug Type: Adabas-D related Bug description: cannot insert long byte columns 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. -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#4440) next »