|
|
Collating seq of a table - copied from serverfault website
http://serverfault.com/questions/59899/how-to-change-the-collation-of-a-table-column
I know, there is the database configuration parameter "Database
collating sequence" for setting the collation in db2. But since this
effects the whole database and can only be set when creating it, I'm
looking for the possibility for setting this for a single table or
column. Alternatively, setting the collation in the SQL statement,
like you could do on Microsoft SQL Server:
SELECT * FROM table ORDER BY col1 COLLATE Latin1_General_CI_AS
Is this possible in DB2? How?
Secondly, how will changing the collation for either for the whole db,
a table, or within a query effect the performance?
I have copied the original question for easy readability. But plz
throw in some light on this.
|
|
0
|
|
|
|
Reply
|
arunrocks (9)
|
12/30/2009 6:25:45 AM |
|
Hi Arun,
>
> SELECT * FROM table ORDER BY col1 COLLATE Latin1_General_CI_AS
> Is this possible in DB2? How?
>
Try this:
SELECT * FROM table ORDER BY collation_key_bit(col1, 'UCA500R1_S2')
note that you can adjust the 2-nd parameter of this function according
to your needs.
For more info please read this:
http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/topic/com.ibm.db2.luw.admin.nls.doc/doc/r0050489.html
Regards,
Mark B.
|
|
0
|
|
|
|
Reply
|
MarkB
|
1/11/2010 7:31:38 AM
|
|
On Jan 11, 12:31=A0pm, MarkB <4.s...@mail.ru> wrote:
> Hi Arun,
>
>
>
> > SELECT * FROM table ORDER BY col1 COLLATE Latin1_General_CI_AS
> > Is this possible in DB2? How?
>
> Try this:
> SELECT * FROM table ORDER BY collation_key_bit(col1, 'UCA500R1_S2')
> note that you can adjust the 2-nd parameter of this function according
> to your needs.
> For more info please read this:http://publib.boulder.ibm.com/infocenter/d=
b2luw/v9r5/topic/com.ibm.db...
>
> Regards,
> Mark B.
Thank you loads.. that really helped me...
|
|
0
|
|
|
|
Reply
|
Arun
|
1/12/2010 4:38:18 AM
|
|
|
2 Replies
270 Views
(page loaded in 0.098 seconds)
Similiar Articles:7/15/2012 5:57:08 PM
|
|
|
|
|
|
|
|
|