哪些 SQL 实现具有类似 PSM 的功能?
尽管 Oracle 是最早创建存储过程 (PL/SQL) 的公司之一,但 Informix 与 (SPL) 除了 DB2 之外,还有哪些 RDBMS 产品在 1998 年之后实现了 SQL/PSM 或其子集?.. 哪些 RDBMS 可以支持类似的过程下面的例子?:
CREATE OR REPLACE FUNCTION foo1(a integer)
RETURNS void AS $$
CASE a
WHEN 1, 3, 5, 7, 9 THEN
PRINT a, 'is odd number';
WHEN 2, 4, 6, 8, 10 THEN
PRINT a. 'is odd number';
ELSE
PRINT a, 'isn't from range 1..10';
END CASE;
$$ LANGUAGE plpgpsm;
Although Oracle is one of the earliest to create stored procedures (PL/SQL) then Informix with (SPL) which RDBMS products besides DB2 have implemented SQL/PSM or a subset of it after 1998?.. Which RDBMS' can support procs like in the following example?:
CREATE OR REPLACE FUNCTION foo1(a integer)
RETURNS void AS $
CASE a
WHEN 1, 3, 5, 7, 9 THEN
PRINT a, 'is odd number';
WHEN 2, 4, 6, 8, 10 THEN
PRINT a. 'is odd number';
ELSE
PRINT a, 'isn't from range 1..10';
END CASE;
$ LANGUAGE plpgpsm;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
据我所知,只有 DB2 接近 PSM。 Sybase 很早就推出了 Transact-SQL;微软借用了这一点。值得关注的三匹黑马是 MySQL、PostgreSQL 和 Ingres。然而,当我查看他们的代码时,我不记得认为他们中的任何一个与 PSM 接近。
然而,Google 搜索“mysql psm”表明 MySQL 5.x 和 PostgreSQL 8.2 支持接近标准的 PSM 形式。 (搜索“ingres psm”表明 Ingres 中的 PSM 是一种“部分排序合并”连接技术。)
Only DB2 is close to PSM, AFAIK. Sybase had its Transact-SQL very early on; Microsoft borrowed that. Three dark horses that perhaps bear checking out are MySQL, PostgreSQL and Ingres. However, I don't recall thinking that any of them were close to PSM when I've looked at their code.
However, a Google search for 'mysql psm' suggests that MySQL 5.x and PostgreSQL 8.2 support a form of PSM close to the standard. (The search for 'ingres psm' shows that PSM in Ingres is a 'Partial Sort Merge' join technique.)
似乎每个产品都包含自己的存储模块实现,但大多数都非常相似。例如,您的示例可以用 Oracle 的 PL/SQL 重写如下:
分享并享受。
It seems that each product contains its own implementation of stored modules, but most are pretty similar. For instance, your example could be rewritten in Oracle's PL/SQL as follows:
Share and enjoy.