Thread: IODBC32.DLL: Access Violation
Hi! psqlODBC 7.02.0002 + PostgreSql 7.2.1 + Borland BDE + Windows95. ODBC behaves very strangely for bytea: create table MyTable (c1 integer,c2 bytea); --Then fill up value2 with blob value using Borland Delphi. INSERT INTO MyTable VALUES(:value1,:value2) The inserted row is really odd - c2 contains the OID pointing to the blob data. Though I don't know where the blob dataactually reside, lo_export command does export the blob data to Linux file system. The even more serious problem I cannotcircumvent is that I don't know how to retrieve that blob data from PostgreSQl through psqlODBC. This is because psqlODBCseems to not be able to return blob field type for BDE. Thus, I am trying to use TEXT column instead - and fail, too: create table MyTable (c1 integer,c2 text); --Then fill up value2 with string value using Delphi. INSERT INTO MyTable VALUES(:value1,:value2) The INSERT results in Access Violation from IODBC32.DLL. Please note that value2 is about 55 kbytes in size and contains some low values, '\0' in terms of C. Can this be the problemconfusing pgsqlODBC? I am in dilemma. Please help! CN -- _______________________________________________ Get your free email from http://www.graffiti.net Powered by Outblaze
CN LIOU wrote: > > Hi! > > psqlODBC 7.02.0002 + PostgreSql 7.2.1 + Borland BDE + Windows95. > > ODBC behaves very strangely for bytea: > > create table MyTable (c1 integer,c2 bytea); > --Then fill up value2 with blob value using Borland Delphi. > INSERT INTO MyTable VALUES(:value1,:value2) Are you binding the :value2 as LongVarBinary ? > The inserted row is really odd - c2 contains the OID pointing to > the blob data. Though I don't know where the blob data actually > reside, lo_export command does export the blob data to Linux file > system. The even more serious problem I cannot circumvent is that > I don't know how to retrieve that blob data from PostgreSQl through > psqlODBC. This is because psqlODBC seems to not be able to return > blob field type for BDE. > > Thus, I am trying to use TEXT column instead - and fail, too: > > create table MyTable (c1 integer,c2 text); > --Then fill up value2 with string value using Delphi. > INSERT INTO MyTable VALUES(:value1,:value2) > > The INSERT results in Access Violation from IODBC32.DLL. > Please note that value2 is about 55 kbytes in size and contains > some low values, '\0' in terms of C. Can this be the problem > confusing pgsqlODBC? Yes. regards, Hiroshi Inoue http://w2422.nsk.ne.jp/~inoue/
> > psqlODBC 7.02.0002 + PostgreSql 7.2.1 + Borland BDE + Windows95. > > > > ODBC behaves very strangely for bytea: > > > > create table MyTable (c1 integer,c2 bytea); > > --Then fill up value2 with blob value using Borland Delphi. > > INSERT INTO MyTable VALUES(:value1,:value2) > > Are you binding the :value2 as LongVarBinary ? The answer is "No" if you refer LongVarBinary to Delphi's field type. I want to associate :value2 with Delphi's TBlobField. If you refer LongVarBinary to the switches in pgsqlODBC, I have just tried switching on/off "Unknowns As LongVarChar" and"Maximum/Longest" in "Unknown sizes" box. They all give me the same result that follows. > > The inserted row is really odd - c2 contains the OID pointing to > > the blob data. Though I don't know where the blob data actually > > reside, lo_export command does export the blob data to Linux file > > system. The even more serious problem I cannot circumvent is that > > I don't know how to retrieve that blob data from PostgreSQl through > > psqlODBC. This is because psqlODBC seems to not be able to return > > blob field type for BDE. Best Regards, CN -- _______________________________________________ Get your free email from http://www.graffiti.net Powered by Outblaze
Thank you very much! Hiroshi, > > psqlODBC 7.02.0002 + PostgreSql 7.2.1 + Borland BDE +Windows95. [snip] > > > > Thus, I am trying to use TEXT column instead - and fail, too: > > > > create table MyTable (c1 integer,c2 text); > > --Then fill up value2 with string value using Delphi. > > INSERT INTO MyTable VALUES(:value1,:value2) > > > > The INSERT results in Access Violation from IDODBC32.DLL. > > Please note that value2 is about 55 kbytes in size and contains > > some low values, '\0' in terms of C. Can this be the problem > > confusing pgsqlODBC? > > Yes. I have then also removed low values from the string but AV remains. I have set the pgsqlODBC switches according to the instructionsin: http://gborg.postgresql.org/project/psqlodbc/faq/faq.php?faq_id=61 Can '\r' or '\n' be a problem? What are the allowed/disallowed characters in LongVarChar (to be sent to postgreSQL TEXT datatype column)? CN -- _______________________________________________ Get your free email from http://www.graffiti.net Powered by Outblaze
CN LIOU wrote: > > Thank you very much! Hiroshi, > > > > psqlODBC 7.02.0002 + PostgreSql 7.2.1 + Borland BDE +Windows95. > > [snip] > > > > > > > Thus, I am trying to use TEXT column instead - and fail, too: > > > > > > create table MyTable (c1 integer,c2 text); > > > --Then fill up value2 with string value using Delphi. > > > INSERT INTO MyTable VALUES(:value1,:value2) > > > > > > The INSERT results in Access Violation from IDODBC32.DLL. > > > Please note that value2 is about 55 kbytes in size and contains > > > some low values, '\0' in terms of C. Can this be the problem > > > confusing pgsqlODBC? > > > > Yes. > > I have then also removed low values from the string but AV remains. I have set the pgsqlODBC switches according to theinstructions in: > > http://gborg.postgresql.org/project/psqlodbc/faq/faq.php?faq_id=61 > > Can '\r' or '\n' be a problem? Maybe. Please turn off *LF <-> CR/LF conversion* DSN option setting. > What are the allowed/disallowed characters in LongVarChar > (to be sent to postgreSQL TEXT data type column)? AFAIK there's no inhibited character other than '\0'. However there may be another problem. If you are in a multibyte environment the client encoding would be converted to the server's one. regards, Hiroshi Inoue http://w2422.nsk.ne.jp/~inoue/
Many thanks! Hiroshi, > > > > psqlODBC 7.02.0002 + PostgreSql 7.2.1 + Borland BDE +Windows95. > > > > [snip] > > > > > > > > > > Thus, I am trying to use TEXT column instead - and fail, too: > > > > > > > > create table MyTable (c1 integer,c2 text); > > > > --Then fill up value2 with string value using Delphi. > > > > INSERT INTO MyTable VALUES(:value1,:value2) > > > > > > > > The INSERT results in Access Violation from IDODBC32.DLL. > > > > Please note that value2 is about 55 kbytes in size and contains > > > > some low values, '\0' in terms of C. Can this be the problem > > > > confusing pgsqlODBC? > > > > > > Yes. > > > > I have then also removed low values from the string but AV remains. I have set the pgsqlODBC switches according to theinstructions in: > > > > http://gborg.postgresql.org/project/psqlodbc/faq/faq.php?faq_id=61 > > > > Can '\r' or '\n' be a problem? > > Maybe. Please turn off *LF <-> CR/LF conversion* DSN > option setting. > > > What are the allowed/disallowed characters in LongVarChar > > (to be sent to postgreSQL TEXT data type column)? > > AFAIK there's no inhibited character other than '\0'. > However there may be another problem. If you are in a > multibyte environment the client encoding would be > converted to the server's one. Now I found that the problem has nothing to do with the data itself in the string to be inserted. It is the _size_ of thestring which causes IDODBC32.DLL Access Violation. The insert is OK for several bytes, but data with 55 kbytes causesODBC AV. Any idea? Regards, CNLIOU -- _______________________________________________ Get your free email from http://www.graffiti.net Powered by Outblaze