Sybase 表有多个别名吗?

发布于 2024-10-21 18:09:01 字数 328 浏览 6 评论 0原文

我所在的团队正在尝试逐步淘汰遗留系统。由于这是一个相当大的系统,具有多个集成,因此即使在替换旧系统之后,数据库也将继续存在。

现在的问题是,数据库中的所有表名都有数字名称:“RT001”、“RT002”、“RT003”等。对于超过 100 个表,了解每个表是什么以及如何修改变得更加困难。加入以获取特定数据。

有没有办法在sybase中定义全局表别名,以便sybase知道SQL“select * from Order, OrderItems where ...”引用表RT035和RT036?这样我可以将原始表名称保留为 RT035,同时使用“Order”之类的别名,甚至“RT035_Order”来引用它。

I am working on a team trying to phase out a legacy system. As this is a rather large system with multiple integrations, the database will live on, even after the legacy system is replaced.

Now, the problem is that all the table names in the database have numerical names: "RT001", "RT002", "RT003", etc. With well over 100 tables it gets harder to know what each table is, and how can be joined to get hold of specific data.

Is there a way to define a global table alias in sybase so that sybase knows that the SQL"select * from Order, OrderItems where ..." is referring to tables RT035 and RT036 ? This way I can keep the original table names as RT035, while having an alias like "Order", or even "RT035_Order" refer to it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

半岛未凉 2024-10-28 18:09:01

据我所知,Sybase ASE 中不存在“同义词”(Oracle 数据库中的称呼)。但您仍然可以使用简单视图来做基本相同的事情:

CREATE VIEW Order AS SELECT * FROM RT035;

As far as I know there is no such thing as a "synonym" (that's what it's called in an Oracle database) in Sybase ASE. But you could still use simple view to do basically the same thing:

CREATE VIEW Order AS SELECT * FROM RT035;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文