List:MySQL ODBC« Previous MessageNext Message »
From:Michael Widenius Date:March 18 1999 8:40pm
Subject:Problem with BLOBs
View as plain text  
>>>>> "M" == M -A Lemburg <mal@stripped> writes:

M> Hi,
M> I'm having trouble with the way MyODBC treats parameters.
M> The source says:

M> /*
M> ** Returns the description of a parameter marker.
M> ** As we can't detect this easily, but MySQL can use strings anywhere
M> ** we simple say that all parameters can be strings.
M> */

M> RETCODE SQL_API SQLDescribeParam(HSTMT hstmt, UWORD ipar, SWORD FAR
M> *pfSqlType,
M>                                  UDWORD FAR *pcbColDef, SWORD FAR
M> *pibScale,
M>                                  SWORD FAR *pfNullable)

M> The API always returns SQL_VARCHAR.

M> This is obviously wrong for binary data, since VARCHAR is
M> defined as being ascii data only, leading to data truncation
M> for BLOB data.

Why?  Most well-coded ODBC programs shouldn't have any problems with \0
character in VARCHAR columns.

M> Shouldn't this be changed to SQL_VARBINARY or SQL_LONGVARBINARY ?

Sorry, no.

The problem is that in this case ODBC will require the parameters to
be in hexadecimal format (0xab0102...), which will not work with numbers.

In what kind of applications do you get the above problem?
Can't you tell your application the type of the parameter?
Can you generate the query instead of using parameters ?

Regards,
Monty
Thread
Problem with BLOBsM.-A. Lemburg18 Mar
  • Problem with BLOBsMichael Widenius18 Mar
  • Re: Problem with BLOBsM.-A. Lemburg19 Mar