SQL syntax error creating spatial network

I am trying to create a spatial network from a shapefile (representing street centerlines) imported into Oracle DB with FME Desktop. The CENTRELINES feature contains a GEOM column that I would like to use as a basis for network analysis to distribute ambulances (points) among nursing homes (points) based on the distance of the route as a cost attribute. Any recommendations on the methodology for solving this painful problem in Oracle Spatial could be welcomed, but the main problem is that I'm starting in SQL. I used the Oracle documentation to compile the following SQL statement:

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

The script outputs the following:

 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 

I understand that line 2 causes an error:

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

Given that half-columns are needed to complete the SQL query, why is this a problem?

EDIT: the following script created a network by adding a start / end:

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

Thank you for your help!

0
sql oracle networking spatial oracle-spatial
Mar 26 '13 at 23:56
source share
1 answer

As stated in the documentation , the SQL * Plus execute command should usually be entered on one line:

If your EXECUTE command cannot fit on one line due to PL / SQL, use the SQL * Plus continuation character (hyphen).

What he is actually trying to launch under the hood is a translation of how

 BEGIN SDO_NET.CREATE_LRS_NETWORK(; END; / 

... which (perhaps obviously when written) is invalid PL / SQL. Nothing to do with spatial calling. If you want to split it into multiple lines, you can just use explicit begin / end , rather than shorthand exec .

The second problem, perhaps, assumes that you have run the short version more than once, although this is not a feature that I am familiar with; but not related to the initial semicolonial error. (In addition, in order to complete the SQL statement, the need for a half-time is strictly required, but this detail at another time ...)

+3
Mar 27 '13 at 0:31
source share
— -



All Articles