Invoking commands for setting up Db2 Spatial Extender and developing projects
Use the Db2 Spatial Extender command-line processor (CLP), called db2se, to set up Spatial Extender and create projects that use spatial data. This topic explains how to use db2se to run Db2 Spatial Extender commands.
Before you can issue db2se commands, you must be authorized to do so. To find out what authorization is required for a given command, see the Authorization section in each command.
Enter db2se commands from an operating system prompt.
- Type
db2se
ordb2se -h
; then press Enter. A list of db2se subcommands is displayed. - Type
db2se
and a command, ordb2se
and a command followed by -h parameter. Then press Enter. The syntax required for the subcommand is displayed. In this syntax:- Each parameter is preceded by a dash and followed by a placeholder for a parameter value.
- Parameters enclosed by brackets are optional. The other parameters are required.
To issue a db2se command, type db2se
. Then type a command, followed by
the parameters and parameter values that the db2se command requires. Finally, press Enter.
You might need to type the user ID and password that give you access to the database that you just specified. For example, type the user ID and password if you want to connect to the database as a user other than yourself. Always precede the user ID with the -userId parameter and precede the password with the -pw parameter. If you do not specify a user ID and password, your current user ID and password will be used by default.
Values that you enter are not case-sensitive by default. To make them case-sensitive, enclose them in double quotation marks. For example, to specify the lowercase table name mytable type "mytable".
You might have to escape the quotation marks to ensure they are not interpreted by the system prompt (shell), for example, specify \"mytable\" to refer to the table called mytable. If a case-sensitive value is qualified by another case-sensitive value, delimit the two values individually; for example, "myschema"."mytable" Enclose strings in double quotation marks, as follows: "select * from newtable"
Most of the db2se commands run a corresponding stored procedure on the Db2 server with the exception of the db2se shape_info command. This command runs on the client and might access coordinate and spatial reference system information from a spatially enabled database.
The db2se import_shape and db2se export_shape command can also run on the client. This is convenient as it allows access to local files on the client.