SAGA-GIS Tool Library Documentation (v9.0.1)

Tool Execute SQL

Execute SQL commands on a connected PostgreSQL source. Separate different commands with a semicolon (';').

Parameters

 NameTypeIdentifierDescriptionConstraints
OutputTablesTable list, outputTABLES--
OptionsHostText, CMDPG_HOST-Default: 127.0.0.1
PortInteger, CMDPG_PORT-Minimum: 0
Default: 5432
DatabaseText, CMDPG_NAME--
UserText, CMDPG_USER--
PasswordText, CMDPG_PWD--
ConnectionsChoice, GUICONNECTION-Available Choices:
Default: 0
SQL StatementLong textSQL-Default: CREATE TABLE myTable1 (Col1 VARCHAR(255) PRIMARY KEY, Col2 INTEGER);
INSERT INTO myTable1 (Col1, Col2) VALUES('First Value', 1);
DROP TABLE myTable1;
OutputChoiceOUTPUT-Available Choices:
[0] none
[1] message window
[2] tables
Default: 2
Stop on ErrorBooleanSTOP-Default: 0

Command-line

Usage: saga_cmd db_pgsql 6 [-PG_HOST <str>] [-PG_PORT <num>] [-PG_NAME <str>] [-PG_USER <str>] [-PG_PWD <str>] [-SQL <str>] [-TABLES <str>] [-OUTPUT <str>] [-STOP <str>]
  -PG_HOST:<str>	Host
	Text, CMD
	Default: 127.0.0.1
  -PG_PORT:<num>	Port
	Integer, CMD
	Minimum: 0
	Default: 5432
  -PG_NAME:<str>	Database
	Text, CMD
  -PG_USER:<str>	User
	Text, CMD
  -PG_PWD:<str> 	Password
	Text, CMD
  -SQL:<str>    	SQL Statement
	Long text
	Default: CREATE TABLE myTable1 (Col1 VARCHAR(255) PRIMARY KEY, Col2 INTEGER);
INSERT INTO myTable1 (Col1, Col2) VALUES('First Value', 1);
DROP TABLE myTable1;

  -TABLES:<str> 	Tables
	Table list, output
  -OUTPUT:<str> 	Output
	Choice
	Available Choices:
	[0] none
	[1] message window
	[2] tables
	Default: 2
  -STOP:<str>   	Stop on Error
	Boolean
	Default: 0