From: | Thorsten Mauch <mauch(at)imkenberg(dot)de> |
---|---|
To: | "'pgsql-novice(at)postgresql(dot)org'" <pgsql-novice(at)postgresql(dot)org> |
Subject: | AW: Re: AW: case insensitive database ? |
Date: | 2001-04-25 00:00:17 |
Message-ID: | E5A63F34D141D111A6F4080009D70ACA0A38A0@imkedv_pdc |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
Thanks
No i can't use views dirctly, because in the
framwork ervery class maps to one table.
But i found that i can call stored precedures.
Maybe i can call the view in a stored procedure ?
does postgres allow this ?
here is a small sniplet of the castor doc:
The is also a special form of query that
gives a possibility to call stored procedures:
oql = db.getOQLQuery( "CALL sp_something($) AS myapp.Product" );
Here sp_something is a stored procedure returning one or
more ResultSets with the same sequence of fields as Castor-generated
SELECT for the OQL query "SELECT p FROM myapp.Product p"
(for objects without relations the sequence is: identity, then all
other fields in the same order as in mapping.xml).
-----Ursprüngliche Nachricht-----
Von: Joel Burton [mailto:jburton(at)scw(dot)org]
Gesendet: Mittwoch, 25. April 2001 01:03
An: Thorsten Mauch
Cc: 'pgsql-novice(at)postgresql(dot)org'
Betreff: [NOVICE] Re: AW: case insensitive database ?
On Wed, 25 Apr 2001, Thorsten Mauch wrote:
> Thanks for the answers.
> My prob is that i don't query the database
> directly. I use the CASTOR as a persitence-Framework.
> I create QOL-queries that are translated into
> SQL-Queries by the framework.
> So i can't use ILIKE or UPPER(expr) :(
> I also can't force the use of a special index.
> Howerver, i have to maintain a second field with upper
> letters, that i query instead of the orginal field
could you create a view and query that?
CREATE TABLE pers (fname);
INSERT INTO pers VALUES ('Joel');
CREATE VIEW pers_use_me AS SELECT fname, lower(fname) as lower_fname
FROM pers;
SELECT * FROM pers WHERE lower_fname = 'joel';
HTH,
--
Joel Burton <jburton(at)scw(dot)org>
Director of Information Systems, Support Center of Washington
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
message can get through to the mailing list cleanly
From | Date | Subject | |
---|---|---|---|
Next Message | Paul Tomblin | 2001-04-25 00:27:37 | Re: Re: BETWEEN clause |
Previous Message | Joel Burton | 2001-04-24 23:03:19 | Re: AW: case insensitive database ? |