Thread: lo_import doesn't works through ODBC !
I am successful by trying the following SQL statement in the psql prompt. INSERT INTO image (name, raster) VALUES ('myimg', lo_import('/var/lib/pgsql/CmpJpg.jpg')); Through the psql interface this works properly and i have tried the same using the UnixODBC's isql interface as well which again works perfectly. The problem is, the same SQL statement doesn't works through ODBC, I have no clues why it doesn't ? And when i tried to debug the application at some point of time i can notice that "Error while executing the Query (non-fatal)" and the return value is STMT_INFO_ONLY Any inputs on this problem would be hightly appreciated.. Regards - Sudhir -- Disclaimer: This document is intended for transmission to the named recipient only. If you are not that person, you should note that legal rights reside in this document and you are not authorized to access, read, disclose, copy, use or otherwise deal with it and any such actions are prohibited and may be unlawful. The views expressed in this document are not necessarily those of HCL Technologies Ltd. Notice is hereby given that no representation, contract or other binding obligation shall be created by this e-mail, which must be interpreted accordingly. Any representations, contractual rights or obligations shall be separately communicated in writing and signed in the original by a duly authorized officer of the relevant company.
"Sudhir S, Noida" wrote: > > I am successful by trying the following SQL statement in the psql prompt. > INSERT INTO image (name, raster) > VALUES ('myimg', lo_import('/var/lib/pgsql/CmpJpg.jpg')); > > Through the psql interface this works properly and i have tried the > same using the UnixODBC's isql interface as well which again works > perfectly. > > The problem is, the same SQL statement doesn't works through ODBC, I have > no clues why it doesn't ? And when i tried to debug the application > at some point of time i can notice that "Error while executing the Query > (non-fatal)" and the return value is STMT_INFO_ONLY > > Any inputs on this problem would be hightly appreciated.. You seem to be using a pretty old driver. regards, Hiroshi Inoue http://www.geocities.jp/inocchichichi/psqlodbc/
I am running PostgreSQL => 7.2.1 on RedHat 7.3 unixODBC => 2.2.4 And I beleive the psqlodbc driver that 'm using is part of the default drivers included by unixODBC... Should i download and compile a newer version of unixODBC or the psqlodbc driver from the postgresql.org ? I am stuck coz of this ! Otherwise is it possible to store binary data straight in to the database without lo_import/lo_export ? I couldn't find any proper literature yet to achieve this. Seems bytea does this and i should filter some escape sequences to achieve binary data storage..... It wld be great if i can get some help here ! Regards - Sudhir -----Original Message----- From: Hiroshi Inoue [mailto:Inoue@tpf.co.jp] Sent: Monday, April 14, 2003 8:27 AM To: Sudhir S, Noida Cc: pgsql-odbc@postgresql.org Subject: Re: [ODBC] lo_import doesn't works through ODBC ! "Sudhir S, Noida" wrote: > > I am successful by trying the following SQL statement in the psql prompt. > INSERT INTO image (name, raster) > VALUES ('myimg', lo_import('/var/lib/pgsql/CmpJpg.jpg')); > > Through the psql interface this works properly and i have tried the > same using the UnixODBC's isql interface as well which again works > perfectly. > > The problem is, the same SQL statement doesn't works through ODBC, I have > no clues why it doesn't ? And when i tried to debug the application > at some point of time i can notice that "Error while executing the Query > (non-fatal)" and the return value is STMT_INFO_ONLY > > Any inputs on this problem would be hightly appreciated.. You seem to be using a pretty old driver. regards, Hiroshi Inoue http://www.geocities.jp/inocchichichi/psqlodbc/