pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Strange parse error??
3+ messages / 3 participants
[nested] [flat]

* Strange parse error??
@ 2001-02-22 22:49 Bjørn T Johansen <bjorntj@softinn.no>
  2001-02-22 23:05 ` Re: Strange parse error?? Stephan Szabo <sszabo@megazone23.bigpanda.com>
  2001-02-22 23:18 ` Re: Strange parse error?? Ross J. Reedstrom <reedstrm@rice.edu>
  0 siblings, 2 replies; 3+ messages in thread

From: Bjørn T Johansen @ 2001-02-22 22:49 UTC (permalink / raw)
  To: pgsql-sql

I am trying to do a simple update (or at least I thought it was
simple), but I just keep getting a parse error, saying:

Error executing query

Update "Config" Set "Wave" = 'F:\wav\BTJ.wav',"Answer" = 20,
"Recordwav" ='F:\wav\',"CalledID" = '12345678' where "Recno" = 1

PostgreSQL error message:
ERROR: parser: parse error at or near "12345678"

PostgreSQL status:PGRES_FATAL_ERROR


Does anyone have any suggestions to what might be wrong?


Regards,

BTJ

-------------------------------------------------------------------------------
Bjørn T Johansen

bjorntj@softinn.no
-------------------------------------------------------------------------------
"The stickers on the side of the box said "Supported Platforms: Windows 98,
Windows NT 4.0, Windows 2000 or better", so clearly Linux was a supported
platform."





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Strange parse error??
  2001-02-22 22:49 Strange parse error?? Bjørn T Johansen <bjorntj@softinn.no>
@ 2001-02-22 23:05 ` Stephan Szabo <sszabo@megazone23.bigpanda.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Stephan Szabo @ 2001-02-22 23:05 UTC (permalink / raw)
  To: Bjørn T Johansen <bjorntj@softinn.no>; +Cc: pgsql-sql

On Thu, 22 Feb 2001, [ISO-8859-1] Bjørn T Johansen wrote:

> I am trying to do a simple update (or at least I thought it was
> simple), but I just keep getting a parse error, saying:
> 
> Error executing query
> 
> Update "Config" Set "Wave" = 'F:\wav\BTJ.wav',"Answer" = 20,
> "Recordwav" ='F:\wav\',"CalledID" = '12345678' where "Recno" = 1
> 
> PostgreSQL error message:
> ERROR: parser: parse error at or near "12345678"

I believe that it's because postgres treats \ as an escape character
so the 'F:\wav\' was probably treating the closing \' as an escaped
quote inside the string.  You'll probably want to double the \ 
characters.





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Strange parse error??
  2001-02-22 22:49 Strange parse error?? Bjørn T Johansen <bjorntj@softinn.no>
@ 2001-02-22 23:18 ` Ross J. Reedstrom <reedstrm@rice.edu>
  1 sibling, 0 replies; 3+ messages in thread

From: Ross J. Reedstrom @ 2001-02-22 23:18 UTC (permalink / raw)
  To: Bjørn T Johansen <bjorntj@softinn.no>; +Cc: pgsql-sql

On Thu, Feb 22, 2001 at 11:49:30PM +0100, Bjørn T Johansen wrote:
> I am trying to do a simple update (or at least I thought it was
> simple), but I just keep getting a parse error, saying:
> 
> Error executing query
> 
> Update "Config" Set "Wave" = 'F:\wav\BTJ.wav',"Answer" = 20,
> "Recordwav" ='F:\wav\',"CalledID" = '12345678' where "Recno" = 1
> 
> PostgreSQL error message:
> ERROR: parser: parse error at or near "12345678"

Backslashes are used for quoting, so what you're trying to do looks
something like this to the server:

Update "Config" Set "Wave" = 'F:wavBTJ.wav',"Answer" = 20,
 "Recordwav" ='F:wav\',"CalledID" = '12345678' where "Recno" = 1

You could confirm by turning up debugging on the server and check
the logs.

So, it's trying to store the string :

F:wav',"CalledID" =

(with trailing space, even) in Recordwav.

Try doubling your backslashes, as so:

 Update "Config" Set "Wave" = 'F:\\wav\\BTJ.wav',"Answer" = 20,
"Recordwav" ='F:\\wav\\',"CalledID" = '12345678' where "Recno" = 1


Ross



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2001-02-22 23:18 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-02-22 22:49 Strange parse error?? Bjørn T Johansen <bjorntj@softinn.no>
2001-02-22 23:05 ` Stephan Szabo <sszabo@megazone23.bigpanda.com>
2001-02-22 23:18 ` Ross J. Reedstrom <reedstrm@rice.edu>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox