oracle - SQL syntax error in creating spatial network -


i trying create spatial network shapefile (representing street centrelines) imported oracle db fme desktop. 'centrelines' spatial object contains geom column i'd use basis network analysis allocate ambulance facilities (points) among retirement homes (points) based on route distance cost attribute. advice on methodology approaching morbid problem in oracle spatial welcome, main issue beginner @ sql. i've used oracle's documentation compose following sql statement:

-- create 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 cost?   ); 

the script outputs following:

error starting @ line 2 in command: exec sdo_net.create_lrs_network( error report: ora-06550: line 1, column 34: pls-00103: encountered symbol ";" when expecting 1 of 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 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 character set specification> 06550. 00000 -  "line %s, column %s:\n%s" *cause:    pl/sql compilation error. *action:  ...  error starting @ line 9 in command: ) error report: unknown command 

i understand line 2 producing error:

pls-00103: encountered symbol ";" when expecting 1 of following... 

given semi-colons required end sql query, why problem?

edit: following script produced network adding begin/end:

begin sdo_net.create_lrs_network(   'lrs_net',    'centrelines',    'geom',    1,    false,    true); end; 

thank help!

as noted in documentation, sql*plus execute command has entered on 1 line:

if execute command cannot fit on 1 line because of pl/sql statement, use sql*plus continuation character (a hyphen).

what it's trying run under hood translation as

begin     sdo_net.create_lrs_network(; end; / 

... (maybe when written that) not valid pl/sql. nothing spatial call per se. if want split onto multiple lines, can use explicit begin/end rather shorthand exec.

the second problem maybe suggests you've run short version more once, though isn't feature i'm familiar with; not related initial semi-colon error. (also, semi-colon isn't strictly needed end sql statement, that's detail time...).


Comments