个人数据库与文件数据库在SQL WHERE子句写法的区别
-----------------------------------摘抄于ArcGIS10帮助 查询文件地理数据库所使用的 SQL WHERE 子句语法与查询 coverage、shapefile 及其他基于文件的数据源的语法相同,但增加了一些功能,例如支持子查询。因此,WHERE 子句语法是有别于个人地数据库的。A
-----------------------------------摘抄于ArcGIS10帮助
查询文件地理数据库所使用的 SQL WHERE 子句语法与查询 coverage、shapefile 及其他基于文件的数据源的语法相同,但增加了一些功能,例如支持子查询。因此,WHERE 子句语法是有别于个人地数据库的。ArcGIS 中用于创建 SQL 表达式的对话框可帮助您对要查询的数据使用正确的 WHERE 子句语法,因为它们利用适当的分隔符列出字段名称和值。而且还为您选择相关的关键字和运算符。然而,如果为个人地理数据库中的某个图层定义了一条 WHERE 子句,则一旦将此图层的源数据移动到文件地理数据库之后,这条子句可能不会对同一图层起作用。以下是 WHERE 子句不起作用的可能原因:
- 对于个人地理数据库,字段名称括在方括号中,但对于文件地理数据库,它们括在双引号中。
- 在个人地理数据库中,通配符 * 代表任意数量的字符,通配符 ? 代表一个字符。而文件地理数据库则分别使用 % 和 _。
- 个人地理数据库中的字符串搜索不区分大小写,但在文件地理数据库中则区分大小写。
- 个人地理数据库使用 UCASE 和 LCASE 转换字符串大小写,但文件地理数据库使用 UPPER 和 LOWER。
- 个人地理数据库中用 # 分隔日期和时间,但在文件地理数据库中它们则以单词 date 开头。
用于个人地理数据库的 WHERE 子句语法 |
用于文件地理数据库的等效语法 |
---|---|
[STATE_NAME] = 'California' |
"STATE_NAME" = 'California' |
[OWNER_NAME] LIKE '?atherine smith' |
"OWNER_NAME" LIKE '_atherine smith' |
[STATE_NAME] = 'california'(需要进行不区分大小写的搜索时) |
LOWER("STATE_NAME") = 'california' |
UCASE([LAST_NAME]) = 'JONES' |
UPPER("LAST_NAME") = 'JONES' |
[DATE_OF_BIRTH] = #06-13-2001 19:30:00# |
"DATE_OF_BIRTH" = date '2001-06-13 19:30:00' |
WHERE 子句不起作用的另一个原因是,文件地理数据库支持的运算符和函数比个人地理数据库支持的要少,而且文件地理数据库只对子查询提供有限的支持。然而,这不太可能是 WHERE 子句不起作用的原因。文件地理数据库支持大多数可能需要使用的 WHERE 子句功能。
----------------------------ArcObject开发-------------------------
如果您用 ArcObjects 编写了一个应用程序,并想要将该应用程序访问的数据从个人地理数据库切换到文件地理数据库,可考虑以下操作:
- 更新工作空间工厂,使该应用程序对新数据源进行操作。将工作空间工厂从 AccessWorkspaceFactory 更改为 FileGDBWorkspaceFactory,并将地理数据库扩展名从 .mdb 更改为 .gdb。
-
如果您的应用程序使用 SQL,则可能需要更新语法以使其对文件地理数据库起作用:
- 正如前文所述,文件地理数据库与个人地理数据库的 SQL WHERE 子句语法是有区别的。如果应用程序使用 QueryFilter 或 QueryDef,请参考前面对 WHERE 子句的讨论,以了解可能需要进行哪些更改。
- 文件地理数据库并不支持可对个人地理数据库使用的所有功能和函数。ArcGIS 9.2 中,文件地理数据库不支持的最常用的函数包括 DISTINCT、GROUP BY 和 ORDER BY,在子查询外不支持集合函数 AVG、COUNT、MIN、MAX 和 SUM。在将来的版本中有可能添加对其中某些函数的支持。
- 文件地理数据库只提供有限的 QueryDef 连接支持,子字段只能包含简单的列名称;不支持别名、表达式和函数。FROM 子句只能包含简单的表名。
-
文件地理数据库中对 INSERT 和 UPDATE 的 ExecuteSQL 支持被限制为只包含文本值的简单语句。在 INSERT 和 UPDATE 语句中,不支持复合表达式(如
)以及子查询。但 DELETE 语句不受限制;它支持文件地理数据库所支持的任何 WHERE 子句功能。
<span>SET RENTAL_PRICE = (RENTAL_PRICE - 1.00)</span>
Copy after login - 如果应用程序包含子查询,这些子查询可能对文件地理数据库不起作用,因为对它们的支持是受限制的。有关详细信息,请参阅 SQL 参考。
- 要最大化数据传输性能,请在要加载大量记录时,考虑使用只加载模式。有关详细信息,请参阅下面的“性能提示”。
除这些差异之外,ArcObjects 在文件地理数据库上的工作方式与在个人地理数据库上是相同的。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

MySQL is an open source relational database management system. 1) Create database and tables: Use the CREATEDATABASE and CREATETABLE commands. 2) Basic operations: INSERT, UPDATE, DELETE and SELECT. 3) Advanced operations: JOIN, subquery and transaction processing. 4) Debugging skills: Check syntax, data type and permissions. 5) Optimization suggestions: Use indexes, avoid SELECT* and use transactions.

MySQL is an open source relational database management system, mainly used to store and retrieve data quickly and reliably. Its working principle includes client requests, query resolution, execution of queries and return results. Examples of usage include creating tables, inserting and querying data, and advanced features such as JOIN operations. Common errors involve SQL syntax, data types, and permissions, and optimization suggestions include the use of indexes, optimized queries, and partitioning of tables.

MySQL is chosen for its performance, reliability, ease of use, and community support. 1.MySQL provides efficient data storage and retrieval functions, supporting multiple data types and advanced query operations. 2. Adopt client-server architecture and multiple storage engines to support transaction and query optimization. 3. Easy to use, supports a variety of operating systems and programming languages. 4. Have strong community support and provide rich resources and solutions.

The key differences between CentOS and Ubuntu are: origin (CentOS originates from Red Hat, for enterprises; Ubuntu originates from Debian, for individuals), package management (CentOS uses yum, focusing on stability; Ubuntu uses apt, for high update frequency), support cycle (CentOS provides 10 years of support, Ubuntu provides 5 years of LTS support), community support (CentOS focuses on stability, Ubuntu provides a wide range of tutorials and documents), uses (CentOS is biased towards servers, Ubuntu is suitable for servers and desktops), other differences include installation simplicity (CentOS is thin)

不同数据库系统添加列的语法为:MySQL:ALTER TABLE table_name ADD column_name data_type;PostgreSQL:ALTER TABLE table_name ADD COLUMN column_name data_type;Oracle:ALTER TABLE table_name ADD (column_name data_type);SQL Server:ALTER TABLE table_name ADD column_name data_

Oracle is not only a database company, but also a leader in cloud computing and ERP systems. 1. Oracle provides comprehensive solutions from database to cloud services and ERP systems. 2. OracleCloud challenges AWS and Azure, providing IaaS, PaaS and SaaS services. 3. Oracle's ERP systems such as E-BusinessSuite and FusionApplications help enterprises optimize operations.

MySQL is suitable for web applications and content management systems and is popular for its open source, high performance and ease of use. 1) Compared with PostgreSQL, MySQL performs better in simple queries and high concurrent read operations. 2) Compared with Oracle, MySQL is more popular among small and medium-sized enterprises because of its open source and low cost. 3) Compared with Microsoft SQL Server, MySQL is more suitable for cross-platform applications. 4) Unlike MongoDB, MySQL is more suitable for structured data and transaction processing.

MySQL and SQL are essential skills for developers. 1.MySQL is an open source relational database management system, and SQL is the standard language used to manage and operate databases. 2.MySQL supports multiple storage engines through efficient data storage and retrieval functions, and SQL completes complex data operations through simple statements. 3. Examples of usage include basic queries and advanced queries, such as filtering and sorting by condition. 4. Common errors include syntax errors and performance issues, which can be optimized by checking SQL statements and using EXPLAIN commands. 5. Performance optimization techniques include using indexes, avoiding full table scanning, optimizing JOIN operations and improving code readability.
