SAGA 9.4.2 | Tool Library Documentation

Execute SQL


Description

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 number, CMDPG_PORT-Minimum: 0 Default: 5432
Databasetext, CMDPG_DB--
Usertext, CMDPG_USER--
Passwordtext, CMDPG_PWD--
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 ] [-PG_PORT ] [-PG_DB ] [-PG_USER ] [-PG_PWD ] [-SQL ] [-TABLES ] [-OUTPUT ] [-STOP ]
  -PG_HOST:	Host
	text, CMD
	Default: 127.0.0.1
  -PG_PORT:	Port
	integer number, CMD
	Minimum: 0
	Default: 5432
  -PG_DB:  	Database
	text, CMD
  -PG_USER:	User
	text, CMD
  -PG_PWD: 	Password
	text, CMD
  -SQL:    	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: 	Tables
	table list, output
  -OUTPUT: 	Output
	choice
	Available Choices:
	[0] none
	[1] message window
	[2] tables
	Default: 2
  -STOP:   	Stop on Error
	boolean
	Default: 0