排序主键 [英] Sorting primary key

查看:92
本文介绍了排序主键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


是否可以在DB / 2中创建排序主键,如果是,那么

SQL脚本语法是什么那个?


我需要它将Topspeed(Clarion)数据库转换成DB / 2:它们使用

排序的主键。我编写了一个工具,可以导入Clarion

字典并使其与DB / 2兼容。它还会生成一个SQL脚本,以便
重新创建数据库。我还写了一个复制数据库程序,通过ODBC从Topspeed到DB / 2复制

日期。


有兴趣吗?


Groeten


Joost Kraaijeveld

Askesis BV

Molukkenstraat 14

6524NB Nijmegen

电话:024-3888063 / 06-51855277

传真:024-3608416

电子邮件: J。*********** @ Askesis.nl

web: www.askesis.nl

解决方案

您需要创建一个群集唯一索引,并在此基础上建立主键

。但是,在SELECT语句中使用ORDER BY子句之前,关系数据库中的任何内容都不会真正100%排序



Joost Kraaijeveld写道:

大家好,

是否可以在DB / 2中创建一个已排序的主键,如果是,那么该脚本的语法是什么?我需要它将Topspeed(Clarion)数据库转换为DB / 2:它们使用
排序的主键。我编写了一个工具,可以导入Clarion
字典并使其与DB / 2兼容。它还会生成一个SQL脚本来重新创建数据库。我还写了一个复制数据库程序,通过ODBC从Topspeed复制到DB / 2的日期。

有兴趣的人吗?

Groeten
Joost Kraaijeveld
Askesis BV
Molukkenstraat 14
6524NB Nijmegen
电话:024-3888063 / 06-51855277
传真:024-3608416 电子邮件: J。*********** @ Askesis.nl
网站: www.askesis.nl



" Joost Kraaijeveld" < J。*********** @ Askesis.nl>在消息中写道

新闻:x5 ***************** @ amsnews02.chello.com ...

大家好,是否有可能在DB / 2中创建一个已排序的主键,如果是这样,那么
的SQL脚本语法是什么?

我需要它将Topspeed(Clarion)数据库转换为DB / 2:它们使用
排序的主键。我编写了一个工具,可以导入Clarion
字典并使其与DB / 2兼容。它还会生成一个SQL脚本来重新创建数据库。我还写了一个复制数据库程序,通过ODBC从Topspeed复制
日期到DB / 2)。

有兴趣的人吗?

Groeten
Joost Kraaijeveld




你在谈论IBM的DB2(不是DB / 2)吗?偶尔我们会在这里得到一些Dbase

的问题。


如果是这样,只需在select子句中指定ORDER BY就可以得到结果

以特定顺序返回。如果在表上定义主要的b $ b键(或唯一索引)并且索引被更改为

是聚簇索引,则可以提高性能(请参阅alter index) 。将表和索引重新编号为

,适用于表格上的插入,更新和删除。


嗨Blair,


" Blair Adamache" < BA ******* @ 2muchspam.yahoo.com>在消息中写道

新闻:cc ********** @ hanover.torolab.ibm.com ...

你需要创建一个独特的群集索引,并基于你的主键

你如何使用DB2 7.2 Linux / W2K(根据Alter table或

" Create index")?

但是,在SELECT语句中使用ORDER BY子句之前,关系数据库中没有任何内容真正100%排序。



据我所知/告知这是克拉丽安的问题。但是再次b / b
,这就是我对整个转换的想法;-)


谢谢,


Joost


Hi all,

Is it possible to create a sorted primary key in DB/2 and if so, what is the
SQL script syntax for that?

I need it to convert a Topspeed (Clarion) database into DB/2: they use
sorted primary keys. I have written a tool that imports the Clarion
dictionary and makes it DB/2 compatible. It also generates a SQL script to
recreate the databse. I also have writen a copy-database program to copy the
date through ODBC from Topspeed to DB/2).

Anyone interested?

Groeten

Joost Kraaijeveld
Askesis B.V.
Molukkenstraat 14
6524NB Nijmegen
tel: 024-3888063 / 06-51855277
fax: 024-3608416
e-mail: J.***********@Askesis.nl
web: www.askesis.nl

解决方案

You need to create a clustered unique index, and base your primary key
on this. However, nothing in a relational database is truly 100% sorted
until you use an ORDER BY clause in a SELECT statement.

Joost Kraaijeveld wrote:

Hi all,

Is it possible to create a sorted primary key in DB/2 and if so, what is the
SQL script syntax for that?

I need it to convert a Topspeed (Clarion) database into DB/2: they use
sorted primary keys. I have written a tool that imports the Clarion
dictionary and makes it DB/2 compatible. It also generates a SQL script to
recreate the databse. I also have writen a copy-database program to copy the
date through ODBC from Topspeed to DB/2).

Anyone interested?

Groeten

Joost Kraaijeveld
Askesis B.V.
Molukkenstraat 14
6524NB Nijmegen
tel: 024-3888063 / 06-51855277
fax: 024-3608416
e-mail: J.***********@Askesis.nl
web: www.askesis.nl




"Joost Kraaijeveld" <J.***********@Askesis.nl> wrote in message
news:x5*****************@amsnews02.chello.com...

Hi all,

Is it possible to create a sorted primary key in DB/2 and if so, what is the SQL script syntax for that?

I need it to convert a Topspeed (Clarion) database into DB/2: they use
sorted primary keys. I have written a tool that imports the Clarion
dictionary and makes it DB/2 compatible. It also generates a SQL script to
recreate the databse. I also have writen a copy-database program to copy the date through ODBC from Topspeed to DB/2).

Anyone interested?

Groeten

Joost Kraaijeveld



Are you talking about IBM''s DB2 (not DB/2)? Occasionally we get some Dbase
questions here.

If so, just specify ORDER BY in the select clause when you want the result
set returned in a particular order. Performance may be improved if a primary
key is defined on the table (or a unique index) and the index is altered to
be the clustered index (see alter index). Reorg the table and indexes as
appropriate for inserts, updates, and deletes on the table.


Hi Blair,

"Blair Adamache" <ba*******@2muchspam.yahoo.com> wrote in message
news:cc**********@hanover.torolab.ibm.com...

You need to create a clustered unique index, and base your primary key
on this. And how do you do that with DB2 7.2 Linux/W2K (in terms of "Alter table" or
"Create index")?
However, nothing in a relational database is truly 100% sorted
until you use an ORDER BY clause in a SELECT statement.


As far as I am concerned / told that is the problem of Clarion. But han
again, that''s what I thought of the whole conversion ;-)

Thanks,

Joost


这篇关于排序主键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆