Re: [GENERAL] MS Access to PostgreSQL - Mailing list pgsql-jdbc

From Shelby Cain
Subject Re: [GENERAL] MS Access to PostgreSQL
Date
Msg-id 20050311173136.35598.qmail@web50101.mail.yahoo.com
Whole thread Raw
Responses Re: [GENERAL] MS Access to PostgreSQL  ("Brian Gunning" <brian.gunning@3touch.com>)
List pgsql-jdbc
--- William Shatner <shatner.william@gmail.com> wrote:
> I have recently migrated from MS Access to
> PostgreSQL.Previously I had
> a SQL command
>
>       ResultSet aGroupResultSet =
> aGroupPathStmt.executeQuery(
>           "SELECT \"groupID\",\"fullpath\" FROM
> \"groups\" WHERE
> \"fullpath\" Like '" +
>           aPath + "'");
>
>
>
> where aPath was equal to  'folder\another folder\%'.
>
> The field to be edited stores the full path in the
> format
> 'folder\folder1\folder2' and so on...
> The purpose being to change all groups at this level
> of the
> hieracarchy and below, this was achieved using the
> '%' in Access, this
> however doesn't seem to work in PostgreSQL, it
> doesn't error out but
> it just seems to see the '%' as a normal character.
>
> How can this be done in PostgreSQL?
>

I suspect that, unlike Access, PostgreSQL will
intrepret C-style escape sequences (ie: \r, \n, \t) so
you'll need to properly escape the backslash in aPath
like so:

folder1\\folder2\\folder3

Regards,

Shelby Cain



__________________________________
Do you Yahoo!?
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/

pgsql-jdbc by date:

Previous
From: William Shatner
Date:
Subject: MS Access to PostgreSQL
Next
From: Michael Fuhr
Date:
Subject: Re: [GENERAL] MS Access to PostgreSQL