SQL 我如何编译sql?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5736343/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-01 10:14:03  来源:igfitidea点击:

How do I compile sql?

sql

提问by Sebastian Paaske T?rholm

I am learning SQL but I have not been able to figure out what is used to compile and run SQL code.

我正在学习 SQL,但我一直无法弄清楚用于编译和运行 SQL 代码的内容。

回答by Sebastian Paaske T?rholm

SQL isn't compiled into an executable.

SQL 未编译为可执行文件。

SQL is designed to query information from a database, so in order to use it, you need a DBMSyou can query.

SQL 旨在从数据库中查询信息,因此为了使用它,您需要一个可以查询的DBMS

An example of such a system could be PostgreSQL, MySQLor SQLite.

这种系统的一个例子可能是PostgreSQLMySQLSQLite

The simplest in way of installation would probably be SQLite.

最简单的安装方式可能是SQLite

In order to then use the system, you could either open a console and do a query manually or, more likely, use a database driver in a programming language of your choice and perform a query through that, letting your program work on the data automatically.

为了使用该系统,您可以打开控制台并手动执行查询,或者更有可能使用您选择的编程语言的数据库驱动程序并通过它执行查询,让您的程序自动处理数据.

For instance, in Java you have JDBC, in PHP you have PDO, and so forth.

例如,在 Java 中有JDBC,在 PHP 中有PDO,等等。

回答by David

Try SQLite, it requires no installation and is very easy to get started with. The documentationis also very easy to follow. You cannot compile SQL it is a query language and is understood by a database.

试试SQLite,它不需要安装并且非常容易上手。该文档也很容易遵循。您无法编译 SQL,它是一种查询语言并且可以被数据库理解。

回答by Randy

usually you do not compile sql.

通常你不编译sql。

it is a command line scripting language

它是一种命令行脚本语言

tools like sqlplus for oracle are the interface

像 sqlplus for oracle 这样的工具是接口

回答by Phil Whittington

This question is not as daft as most responders seem to think it is.

这个问题并不像大多数回答者认为的那样愚蠢。

With technologies such as Linq in .Net, it is not unreasonable to want something that takes a SQL expression and emits ILor its equivalent.

使用 .Net 中的 Linq 等技术,想要采用 SQL 表达式并发出IL或其等效物的东西并非没有道理。

A user-configurable query that can hook in, at runtime, to the power of Linq would be tremendously valuable. Kind of the opposite of Linq To SQL

一个用户可配置的查询,可以在运行时挂钩到 Linq 的强大功能将是非常有价值的。与Linq To SQL相反的种类

回答by James

usually the database systems have a console where you can type your sql code or commands. Some have more polished editors where it helps you to create the sql code. It depends on which database you use but each usually has different tools to enter code.

通常,数据库系统有一个控制台,您可以在其中键入 sql 代码或命令。有些有更完善的编辑器,它可以帮助您创建 sql 代码。这取决于您使用的数据库,但每个数据库通常都有不同的工具来输入代码。

回答by AutocadNinja

In PostgreSQL you use a command line window. Type i\ along with the script file location and file name and then hit enter.

在 PostgreSQL 中,您使用命令行窗口。键入 i\ 以及脚本文件位置和文件名,然后按 Enter。

回答by Developer Marius ?il?nas

You don't have to compile SQL query, it is interpreted on the database management system (dbms) side. When you send your SQL statement to the dbms the query will be run. For learning purposes you can use online service to run SQL queries.

您不必编译 SQL 查询,它在数据库管理系统 (dbms) 端进行解释。当您将 SQL 语句发送到 dbms 时,将运行查询。出于学习目的,您可以使用在线服务来运行 SQL 查询。

There is a stack exchange service @ http://data.stackexchange.com/stackoverflow/querieswhere you can see SQL queries.

有一个堆栈交换服务@ http://data.stackexchange.com/stackoverflow/queries,您可以在其中查看 SQL 查询。

Let's take a look at the SQL query http://data.stackexchange.com/stackoverflow/query/163779. You can see it is in plain text (not compiled).

我们来看看 SQL 查询http://data.stackexchange.com/stackoverflow/query/163779。您可以看到它是纯文本(未编译)。

回答by AutocadNinja

........ I think the answer would be Microsoft Visual Studio or AutoCAD for you...based on your profile. AutoCAD uses VBA to communicate with SQL Server natively. The file format would be .dvb and that is a compiled file. Visual Studio supports VB.NET , where you can not write .NET applications inside AutoCAD using the VBAIDE command at this time....Visual Studio allows you to write in C# or VB.NET. Both languages can compile your SQL Server requests into .dll files. You would then need to load them into AutoCAD using the NETLOAD command. If you have code from VB 6.0, you will need to export your modules out of AutoCAD so that Visual Studio can read the file.....in other words VS can not read a .dvb file.

........我认为答案是 Microsoft Visual Studio 或 AutoCAD 适合您...根据您的个人资料。AutoCAD 使用 VBA 与 SQL Server 本地通信。文件格式为 .dvb,这是一个编译文件。Visual Studio 支持 VB.NET ,此时您无法使用 VBAIDE 命令在 AutoCAD 内部编写 .NET 应用程序....Visual Studio 允许您使用 C# 或 VB.NET 编写。这两种语言都可以将您的 SQL Server 请求编译为 .dll 文件。然后,您需要使用 NETLOAD 命令将它们加载到 AutoCAD 中。如果您有来自 VB 6.0 的代码,您将需要将您的模块从 AutoCAD 中导出,以便 Visual Studio 可以读取该文件......换句话说,VS 无法读取 .dvb 文件。

VBAIDE command will only handle COM. It can not handle managed VB programming.

VBAIDE 命令只会处理 COM。它不能处理托管 VB 编程。