2013-03-26 94 views
0

我正尝试从FME Desktop中导入到Oracle DB中的shapefile(表示街道中心线)创建空间网络。 'CENTRELINES'空间对象包含一个GEOM专栏,我想用它作为网络分析的基础,根据路线距离作为成本属性来分配养老院(点)中的救护车设施(点)。任何关于解决Oracle Spatial中病态问题的方法建议都会受到欢迎,但主要问题是我是SQL初学者。我使用Oracle的documentation组成以下SQL语句:创建空间网络时出现SQL语法错误

-- create an LRS geometry network 
EXEC SDO_NET.CREATE_LRS_NETWORK(
    'LRS_net', -- network name 
    'CENTRELINES', -- LRS geometry table name 
    'GEOM', -- LRS geometry column name 
    1, -- number of hierarchy levels 
    FALSE, -- directed link? 
    TRUE -- node with cost? 
); 

的脚本输出如下:

Error starting at line 2 in command: 
EXEC SDO_NET.CREATE_LRS_NETWORK(
Error report: 
ORA-06550: line 1, column 34: 
PLS-00103: Encountered the symbol ";" when expecting one of the following: 

    () - + case mod new not null <an identifier> 
    <a double-quoted delimited-identifier> <a bind variable> 
    table continue avg count current exists max min prior sql 
    stddev sum variance execute multiset the both leading 
    trailing forall merge year month day hour minute second 
    timezone_hour timezone_minute timezone_region timezone_abbr 
    time timestamp interval date 
    <a string literal with character set specification> 
06550. 00000 - "line %s, column %s:\n%s" 
*Cause: Usually a PL/SQL compilation error. 
*Action: 

... 

Error starting at line 9 in command: 
) 
Error report: 
Unknown Command 

据我了解,2号线正在生产的错误:

PLS-00103: Encountered the symbol ";" when expecting one of the following... 

鉴于需要分号才能结束SQL查询,为什么这是一个问题?

编辑:下面的脚本通过将开始/结束产生的网络:

begin 
SDO_NET.CREATE_LRS_NETWORK(
    'LRS_net', 
    'CENTRELINES', 
    'GEOM', 
    1, 
    FALSE, 
    TRUE); 
end; 

谢谢您的帮助!

+0

我加入了开始/结束语法: – user2109092 2013-03-27 02:52:18

+1

您需要添加一个分号排队8.改变'TRUE)''到TRUE);'。 – 2013-03-27 03:57:43

回答

3

正如documentation指出,SQL * Plus的execute命令通常必须在一行中输入:

If your EXECUTE command cannot fit on one line because of the PL/SQL statement, use the SQL*Plus continuation character (a hyphen).

什么它实际上是试图在引擎盖下运行是一个翻译为

BEGIN 
    SDO_NET.CREATE_LRS_NETWORK(; 
END; 
/

...这是(也许很明显,当这样写)无效的PL/SQL。与空间调用本身无关。如果您确实想将其拆分为多行,则只需使用明确的begin/end而不是简写exec

第二个问题,也许表明您已经运行了短版不止一次,但它不是一个功能,我很熟悉;但与初始分号错误无关。 (另外,分号并不是严格需要来结束SQL语句,但这是另一次的细节...)。