个人数据库与文件数据库在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 子句功能。
1
<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.

H5. The main difference between mini programs and APP is: technical architecture: H5 is based on web technology, and mini programs and APP are independent applications. Experience and functions: H5 is light and easy to use, with limited functions; mini programs are lightweight and have good interactiveness; APPs are powerful and have smooth experience. Compatibility: H5 is cross-platform compatible, applets and APPs are restricted by the platform. Development cost: H5 has low development cost, medium mini programs, and highest APP. Applicable scenarios: H5 is suitable for information display, applets are suitable for lightweight applications, and APPs are suitable for complex functions.

Export password-protected PDF in Photoshop: Open the image file. Click "File"> "Export"> "Export as PDF". Set the "Security" option and enter the same password twice. Click "Export" to generate a PDF file.

The necessity of registering VueRouter in the index.js file under the router folder When developing Vue applications, you often encounter problems with routing configuration. Special...

Detailed explanation of XPath search method under DOM nodes In JavaScript, we often need to find specific nodes from the DOM tree based on XPath expressions. If you need to...

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.

There are differences in the promotion methods of H5 and mini programs: platform dependence: H5 depends on the browser, and mini programs rely on specific platforms (such as WeChat). User experience: The H5 experience is poor, and the mini program provides a smooth experience similar to native applications. Communication method: H5 is spread through links, and mini programs are shared or searched through the platform. H5 promotion methods: social sharing, email marketing, QR code, SEO, paid advertising. Mini program promotion methods: platform promotion, social sharing, offline promotion, ASO, cooperation with other platforms.

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.
