PL/SQL 的替代品?是否有任何其他编程语言/IDE 组合可以为 (Oracle) SQL 查询提供自动完成和语法验证?

发布于 2024-12-05 17:22:39 字数 331 浏览 2 评论 0原文

我正在寻找 PL/SQL 的替代方案。 PL/SQL 充其量只是平庸,但在编写以 Oracle 数据库为中心的脚本时,我还没有发现任何可以与它的生产力相媲美的东西。

那么,还有其他编程语言可以提供以下功能吗?

  • 本机处理 SQL 查询(SQL 被视为代码,而不是字符串)。
  • 表格和表格的自动完成列名称。
  • SQL 在编译时针对 DB 进行验证。

*编辑:我很了解并且使用提供自动完成功能的 SQL 和 PL/SQL IDE。我只是想知道是否存在任何其他编程语言可以让您以与 PL/SQL 类似的方式混合 SQL 和代码。

I'm looking for an alternative to PL/SQL. PL/SQL is mediocre at best but I haven't found anything that's even close to matching its productivity when writing Oracle database-centric scripts.

So, are there any other programming languages that offer any of the following features?

  • Natively handle SQL queries (SQL treated as code, not as a string).
  • Autocomplete for table & column names.
  • SQL is validated against DB at compile time.

*Edit: I'm well aware of, and use, IDEs for SQL and PL/SQL that offer autocomplete. I'm merely wondering if there exists any other programming language out there that lets you intermingle SQL and code in a similar way to PL/SQL.

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

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

发布评论

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

评论(3

沧桑㈠ 2024-12-12 17:22:40

“笨拙的异常处理,缺乏许多内置数据类型和
在大多数语言中你认为理所当然的功能,缺乏
任何类似于对多线程编程的适当支持的东西,
无法访问运行脚本的人的文件系统
(通过 SSH 访问产品数据库服务器通常是不可能的)
对于 OOP 来说很尴尬,处理包可能是一个 PITA,不尊重
基于角色的授权等...PL/SQL 在以下方面非常棒
与数据库集成,但除此之外它是一种相当糟糕的语言
一旦你超过了一定程度的复杂性。”

一一。

笨拙的异常处理
尴尬是情人眼里出西施,但我会给你一个。太多的事情留给了个人开发者。

缺乏许多内置数据类型......在大多数语言中您认为这是理所当然的
它具有与 SQL 相同的数据类型,以及 BOOLEAN。你还想要什么?

缺乏对多线程编程的适当支持
多线程是一个与多用户环境中的读取一致性相结合的棘手概念。 Aurora JVM 也不支持 Java 存储过程中的多线程 Java。这不是 PL/SQL 的限制。

无法访问运行脚本的人的文件系统
再次强调,这不是 PL/SQL 问题。请网络管理员将您电脑上的文件共享映射到网络。

对于 OOP 来说非常尴尬
是的,OOP 即将过时,现在每个人都对函数式编程感到失望。

处理包裹可能是 PITA
个人意见。我喜欢包裹。

不尊重基于角色的授予
再次强调,这不是 PL/SQL,而是数据库安全模型。视图也不尊重基于角色的授予。

一旦超过一定的复杂程度
用 Java 编写它并从 Java 存储过程调用 if。或者将其写在 C 上并从 extproc 中调用它。

"Awkward exception handling, a lack of many built-in datatypes and
functions that you take for granted in most languages, lack of
anything resembling proper support for multi-threaded programming,
inability to access the filesystem of the person running the script
(SSH access to prod DB servers is often out of the question), hugely
awkward for OOP, dealing with packages can be a PITA, doesn't respect
role-base grants, etc... PL/SQL is awesome when it comes to
integration with the DB, but beyond that it's a fairly poor language
once you go past a certain level of complexity."

One by one.

Awkward exception handling
Awkwardness is in the eye of the beholder but I'll give you that one. Too much is left up to the individual developer.

a lack of many built-in datatypes ... that you take for granted in most languages
It has the same datatypes as SQL, plus BOOLEAN. What more can you want?

lack of anything resembling proper support for multi-threaded programming
Multithreading is a tricky concept to combine with read-consistency in a multi-user environment. The Aurora JVM doesn't support mult-threaded Java in Java Stored Procedures either. It's not a limitation of PL/SQL.

inability to access the filesystem of the person running the script
Again, that's not a PL/SQL issue. Ask your network administrator to map a fileshare on your PC to the network.

hugely awkward for OOP
Yeah well, OOP is on its way out, everybody's down with functional programming these days.

dealing with packages can be a PITA
Personal opinion. I love packages.

doesn't respect role-base grants
Again, that's not PL/SQL, it's the database security model. Views don't respect role-based grants either.

once you go past a certain level of complexity
Write it in Java and call if from a Java Stored Procedure. Or write it on C and call it from an extproc.

ぃ弥猫深巷。 2024-12-12 17:22:40

我想有很多替代方案可以满足您的一系列要求。例如,查看:

I guess there is plenty of alternatives with various level of conformance to your set of requirements. Take a look e.g to:

一个人练习一个人 2024-12-12 17:22:40

TOAD 非常好——适用于 PL/SQL、TSQL 等。 http://www.quest.com/toad /

SQL Complete 是 SSMS (TSQL) 的插件:http://www.devart.com/dbforge/sql/sqlcomplete/

Redgate SQL 提示符:http://www.red-gate.com

上面这三个是相当主流的,很受欢迎,也很支持。但除此之外,只需选择您想要的 sql 方言,然后通过 google 进行搜索 - 即“tsql auto-complete”或“pl/sql auto-complete”即可找到更多信息。

你的问题还询问了一种好的语言...我不会完全称 pl/sql 平庸(除非我无论如何都想从我们的一个技术人员那里获得升职:-)。正如他们所说,TSQL 也很好,并且变得越来越“成熟”,尽管它仍然经常在“tsql 是否像 pl/sql 一样成熟......”的背景下与 pl/sql 进行比较。但无论您选择什么,“好”只是意味着它是否适合您的应用程序和技能。

TOAD is pretty good -- works for PL/SQL, TSQL etc. http://www.quest.com/toad/

SQL Complete is an add-in for SSMS (TSQL): http://www.devart.com/dbforge/sql/sqlcomplete/

Redgate SQL Prompt: http://www.red-gate.com

These 3 above are pretty main-stream, well-liked, well-supported. But otherwise, just pick your desired sql dialect, and google for it -- i.e. "tsql auto-complete" or "pl/sql auto-complete" to find more.

Your question also asks about a good language... I wouldn't exactly call pl/sql mediocre (unless I was trying to get a rise out of one of our tech guys anyway :-). TSQL is also good, and getting more and more 'mature', as they say, though it's still often compared to pl/sql in the context of "is tsql as mature as pl/sql yet...". But whatever you choose, "good" just means is it appropriate to your application and skillset more than anything.

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