Problem about ODBC with type bytea and anomal byte 92

Поиск
Список
Период
Сортировка
От Massimo Lo iacono
Тема Problem about ODBC with type bytea and anomal byte 92
Дата
Msg-id 3A2574FB.973F574D@cpr.it
обсуждение исходный текст
Список pgsql-interfaces
Hy,
excuse me for my bad english:)

we have postgres 7.03 on Linux and an client VB6 on W98 using ODBC
pgsqlodbc 6.5.
We have to handle jpg files.
We have a table so:
 create table prova (     c_path      varchar(15)            not null,     i_num       int4                   not null,
   oid_img     oid                        null );
 

We insert images files on oid field using lo_import('path') so:
 insert into prova values(         '/tmp/ciao.jpg',         1,         lo_import('/tmp/ciao.jpg') );

We have build an shared library, named libpgcrea.so, with a c function:
 extern bytea *getchunk(const Oid oidFd, const int4 len, const int4
pos);

and create an SQL function on c function:
 create function getchunk(oid, int4, int4) returns bytea as '/home/massimo/lib/libpgcrea.so'     language 'C';
 commit;

Then we can run psql and execute:
 select getchunk(prova.oid_img, 0, 8) as datac from prova where i_num = 1;

This return right all the byte of file ciao.jpg.

The problem appears when we run this select from VB client. In this case
the byte 92 (in decimal) is corrupted and so are all bytes following it.

Important(?) The byte 92 is equivalent than '\' character.

On the contrary, all appear right with JDBC driver.

Please help!!!


-- 
Massimo Lo Iacono
Consorzio Pisa Ricerche - gruppo CREA
tel. 0347 7276358 - 050 540027
ITALIA


В списке pgsql-interfaces по дате отправления:

Предыдущее
От: Tim Uckun
Дата:
Сообщение: RE: postgreSQL and javascript
Следующее
От: Constantin Teodorescu
Дата:
Сообщение: Re: PgAccess is available on Mac OS X