Subject | RE: [firebird-support] Using computed fields in indexes |
---|---|
Author | Svein Erling Tysvær |
Post date | 2007-10-15T13:44:42Z |
I don't know Fb2, but trailing blanks to me sounds like the difference between VARCHAR and CHAR. So I'd try something like:
CREATE INDEX IX01 ON TABLE1 COMPUTED BY (UPPER(CAST(FIELD1 as CHAR(xx))||CAST(FIELD2 as CHAR(xx))));
HTH,
Set
-----Original Message-----
From: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com] On Behalf Of rogervellacott
Sent: 15. oktober 2007 12:05
To: firebird-support@yahoogroups.com
Subject: [firebird-support] Using computed fields in indexes
Using Computed fields in triggers
I want to use the FB2 feature alowing use of expressions in indexes,
so
that all my indexes are upper case.
I can do this for single-field indexes, e.g.
CREATE INDEX IX01 ON TABLE1 COMPUTED BY (UPPER(FIELD1));
but I can't find the right syntax for an index with two or more
fields.
If I use ||, presumably the trailing spaces on the first field will be
trimmed, and results will be incorrect. e.g. AAA,BBB should come
before AAAA, BBB, but AAABBB will come after AAAABBB.
What is the correct syntax for this?
Roger Vellacott
Passfield Data Systems Ltd
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Visit http://www.firebirdsql.org and click the Resources item
on the main (top) menu. Try Knowledgebase and FAQ links !
Also search the knowledgebases at http://www.ibphoenix.com
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Yahoo! Groups Links
CREATE INDEX IX01 ON TABLE1 COMPUTED BY (UPPER(CAST(FIELD1 as CHAR(xx))||CAST(FIELD2 as CHAR(xx))));
HTH,
Set
-----Original Message-----
From: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com] On Behalf Of rogervellacott
Sent: 15. oktober 2007 12:05
To: firebird-support@yahoogroups.com
Subject: [firebird-support] Using computed fields in indexes
Using Computed fields in triggers
I want to use the FB2 feature alowing use of expressions in indexes,
so
that all my indexes are upper case.
I can do this for single-field indexes, e.g.
CREATE INDEX IX01 ON TABLE1 COMPUTED BY (UPPER(FIELD1));
but I can't find the right syntax for an index with two or more
fields.
If I use ||, presumably the trailing spaces on the first field will be
trimmed, and results will be incorrect. e.g. AAA,BBB should come
before AAAA, BBB, but AAABBB will come after AAAABBB.
What is the correct syntax for this?
Roger Vellacott
Passfield Data Systems Ltd
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Visit http://www.firebirdsql.org and click the Resources item
on the main (top) menu. Try Knowledgebase and FAQ links !
Also search the knowledgebases at http://www.ibphoenix.com
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Yahoo! Groups Links