Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.
描述包含在 ESRI shapefile 中的列的名称和类型。此系统功能需与空间功能一起使用。
sa_describe_shapefile( shp_filename , srid [, encoding ] )
shp_filename 标识 ESRI shapefile 位置的 VARCHAR(512) 参数。文件名必须包含扩展名 .shp,并且在相同目录中还必须有与相同基本名相关联的 .dbf 文件。
srid 标识 shapefile 中的几何的 SRID 的 INTEGER 参数。指定 NULL 以表明该列可以存储多个 SRID。指定 NULL 限制可以在几何值上执行的操作。
encoding 标识读取 shapefile 时使用的编码的 VARCHAR(50) 参数。缺省编码为 ISO-8859-1。
sa_describe_shapefile 系统过程用于说明 ESRI shapefile 中的列的名称和类型。该信息可用于创建表,以便使用 LOAD TABLE ... FORMAT SHAPEFILE 从 shapefile 装载数据。或者,可以通过为 OPENSTRING ... FORMAT SHAPEFILE 指定 WITH 子句来使用该系统过程读取 shapefile。
如果 -gl 数据库选项设置为 all,则所有用户都可以执行该系统过程。否则需要 DBA 或 READFILE 权限。
以下示例将创建一个可以使用 ESRI shapefile 数据装载的表:
SELECT 'create table esri_load( record_number int primary key, ' || (SELECT list( name || ' ' || domain_name_with_size, ', ' ORDER BY column_number ) FROM sa_describe_shapefile( 'c:\\esri\\shapefile.shp', 1000004326 ) WHERE column_number > 1 ) || ' )';