Skip site navigation (1) Skip section navigation (2)

Re: [JDBC] MS Access to PostgreSQL

From: "Brian Gunning" <brian(dot)gunning(at)3touch(dot)com>
To: "'Shelby Cain'" <alyandon(at)yahoo(dot)com>,<pgsql-novice(at)postgresql(dot)org>, <pgsql-general(at)postgresql(dot)org>,<pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: [JDBC] MS Access to PostgreSQL
Date: 2005-03-11 17:52:28
Message-ID: !~!UENERkVCMDkAAQACAAAAAAAAAAAAAAAAABgAAAAAAAAArT90Qljg9UiAIBoNHno+SsKAAAAQAAAA6XQNoYyDik2zpG13jnCSAwEAAAAA@3touch.com (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-jdbcpgsql-novice
Hi Shelby,

I don't think the problem isn't with the backslashes. They are escaped and
seem to be working fine e.g. to insert a backslash in Access I had to use
one escape character ('\\') whereas in PostgreSQL four backslashes ('\\\\')
are required. The line that inserts the % is as follows...

      String aPath = group.getPath() + aOldGroupName + "\\%";

It just doesn't seem to be having the same effect in PostgreSQL as in
Access.



B

-----Original Message-----
From: pgsql-jdbc-owner(at)postgresql(dot)org
[mailto:pgsql-jdbc-owner(at)postgresql(dot)org] On Behalf Of Shelby Cain
Sent: 11 March 2005 17:32
To: William Shatner; pgsql-novice(at)postgresql(dot)org;
pgsql-general(at)postgresql(dot)org; pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [JDBC] [GENERAL] MS Access to PostgreSQL

--- William Shatner <shatner(dot)william(at)gmail(dot)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/ 

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend



In response to

Responses

pgsql-novice by date

Next:From: Sean DavisDate: 2005-03-11 17:53:06
Subject: Re: complex queries
Previous:From: Michael FuhrDate: 2005-03-11 17:47:10
Subject: Re: MS Access to PostgreSQL

pgsql-jdbc by date

Next:From: Oliver JowettDate: 2005-03-11 21:13:37
Subject: Re: [BUGS] BUG #1523: precision column value returned from
Previous:From: Michael FuhrDate: 2005-03-11 17:47:10
Subject: Re: MS Access to PostgreSQL

pgsql-general by date

Next:From: Andrew SullivanDate: 2005-03-11 18:08:50
Subject: Re: Slony uninstall info/warning
Previous:From: Michael FuhrDate: 2005-03-11 17:47:10
Subject: Re: MS Access to PostgreSQL

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group