473,508 Members | 2,382 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

postgresql, odbc and escape characters?


Hello everyone...
.... currently I am dealing with migrating the (unfortunately highly
proprietary) document management software we are running here from
MS Windows NT Server 4.0 to some more reliable environment. This
software relies on a file system to actually store the documents it
handles as well as on a database to keep them sorted. Right now, I
am trying to get postgresql set up as the database backend for this
software using the win32/odbc driver, but certain parts of the dms
application reproducibly fail with errors like:
DbException in SQL statement:
SELECT A_.id, A_.name, A_.description, A_.remark
FROM OrgRight A_
WHERE ((A_.description LIKE '%^%' escape '\'))
ORDER BY A_.description
Errornumber: 7
Errorstate: DbError
DbException in database
172-DSN=bf381;DATABASE=bf381;SERVER=192.168.1.170;PORT =5432;A6=;A7=
100;A8=4096;B0=254;B1=8190;BI=0;C2=dd_;;CX=1b1055d ab[Thu Aug 26
14:06:15 2004] DbException: FEHLER: Fehler »unterminated quoted
string« bei »'\')) ORDER BY A_.description« bei Zeichen 158 [S1000]
For what I understood (and what sounds logical to me, looking at
those things are handled in unix environments), the \' in "escape
'\'" is parsed as an escaped ' char, so in the end the query fails
because of a missing string termination.

Question: Is there any way to modify the behavior of postgresql
server itself or of the odbc driver to deal with things like that? I
am sorry if this all sounds a little vague, but I am still trying to
figure out where to tweak, here, so hope anyone can give me a slight
clue...
TIA and bye
Kris
--
Kristian Rink -- Programmierung/Systembetreuung
planConnect GmbH * Strehlener Str. 12 - 14 * 01069 Dresden
0176 24472771 * kr***@pm-planc.de

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 23 '05 #1
2 3404
Kristian Rink wrote:
For what I understood (and what sounds logical to me, looking at
those things are handled in unix environments), the \' in "escape
'\'" is parsed as an escaped ' char, so in the end the query fails
because of a missing string termination.

Question: Is there any way to modify the behavior of postgresql
server itself or of the odbc driver to deal with things like that?


No. Just pick a different escape character or double the backslash.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 23 '05 #2
On Fri, 27 Aug 2004 09:44:59 +0200
Peter Eisentraut <pe*****@gmx.net> wrote:
Question: Is there any way to modify the behavior of postgresql
server itself or of the odbc driver to deal with things like
that?


No. Just pick a different escape character or double the
backslash.


Guess this is something to be configured within the scope of the
application that tries to run the query through odbc, right? If so,
I am already doomed about that since this part of the dms
application appears to be closed-source. :(

Anyhow, thanks!
Cheers,
Kris

--
Kristian Rink -- Programmierung/Systembetreuung
planConnect GmbH * Strehlener Str. 12 - 14 * 01069 Dresden
0176 24472771 * kr***@pm-planc.de

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3664
by: ATK | last post by:
Hi, I'm trying to upload a image file to a oracle DB and i need to only use ODBC functions. In db i have a LONG RAW column (if this is not correct, please tell me). I'm getting the error from...
4
10070
by: Morten Goodwin Olsen | last post by:
Python, PostgreSQL and bytea Hi I am having a bit of trouble inserting images into a postgres database using python. The images should be stored in a bytea field. I have tried both with an odbc...
0
3829
by: Bill J. | last post by:
I have to update a PostgreSQL linked server through MSSQL2K. I first configured the connection with ODBC as follows and I can do queries with no problem: EXEC sp_droplinkedsrvlogin @rmtsrvname...
0
2165
by: Bill J. | last post by:
I have to update a PostgreSQL linked server through MSSQL2K. I first configured the connection with ODBC as follows and I can do queries with no problem: EXEC sp_droplinkedsrvlogin @rmtsrvname...
1
5946
by: fuzzy | last post by:
How cvan i install the postgresql ODBC Driver for Windows if i have only a DLL ? Thanx in Advance
13
7253
by: Zlatko Matiæ | last post by:
Is it possible to use Access as front-end for POstgreSQL and how ? What about Access Projects (.adp) and PostgreSQL ?
6
417
by: Karl O. Pinc | last post by:
These seem to work. I'm posting them now before I'm done with them before I start messing them up with specifics to my database. Any comment is welcome. However, I've no intention of publishing...
5
12824
by: Micha³ Gancarski | last post by:
Hello! How do one unescape strings prepared with pg_escape_string() ? stripslashes() will not work because both these functions are not completely compatible. Thank you all in advance --...
12
4140
by: Johnny BeGood | last post by:
Hi All, When a user enters an Apostrophe into a text area field on a form, i.e. didn't, it mucks with odbc as follows Syntax error (missing operator) in query expression ''didn't', Whats...
0
7231
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7133
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7336
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7504
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5643
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4724
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3198
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1568
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
773
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.