Basically I want to modify the existing view in DB2 database. We are using quirrel client 3.4.0 to access the Database. How to get source SQL queries for the views in squirrel client 3.4.0?
4 Answers
This is an extract from the English paper description of SQLSquirrel found here
Many applications make use of Views or Stored Procedures. Views and Stored Procedures may be executed in SQuirreL, but there is no SQL standard for storing them. Since the method for reading and editing them is product dependent, you will need a product-specific plugin to provide that ability. Several of these exist, but you may need to create one for your database engine. We will show how easy that is in the ‘Programming plugins’ section.
The citated "Programming plugins" section starts at page 16 of the given paper. Good luck!
- Click on the view in the browser nav on the left.
- Select the Objects Tab.
- Select the Source tab (you might have to use the arrow keys to the right of 'Info, Content, Row Count...' tabs)
Although a late reply, hope this helps in some way.

- 11
- 2
"Programming plugins"... I tested it successfully with DB2. All the example code was ready for use for DB2. It was pretty much a matter of building it.
The example source code is available in the Squirrel repository
$ git clone git://git.code.sf.net/p/squirrel-sql/git squirrel-sql-git
Take copy of the example source (look in folder squirrel-sql-git/sql12/plugins/example/src)
src/main/java/net/sourceforge/squirrel_sql/plugins/example/
ExampleExceptionFormatter.java ExamplePlugin.java ExampleSqlExecutionListener.java ScriptDB2ProcedureAction.java ScriptDB2ViewAction.java
src/main/resources/net/sourceforge/squirrel_sql/plugins/example/
example.properties
pom.xml used :
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>net.sourceforge.squirrel_sql.plugins.example</groupId>
<artifactId>db2example</artifactId>
<packaging>jar</packaging>
<version>1.0</version>
<name>db2example</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.sf.squirrel-sql</groupId>
<artifactId>squirrel-sql</artifactId>
<version>3.5.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
Build it $ mvn clean compile package
Copy the resulting db2example.jar in Squirrel plugins folder
copy target\db2example-1.0.jar %Programfiles%\squirrel-sql-3.7.1\plugins\
Launch Squirrel > connect to your DB > in object tree panel, right click on a view > select "(DB2) Script View"... and that's it
You must install DB2
plugin which already exists as an optional plugin within the squirrel-sql installation. So just make sure you select it during the installation:
Once installed:
- Go the the views folder in the left menu
- Select a view: details with tabs on the view will be shown in the main pane
- Then go the source tab to check the script

- 8,815
- 5
- 34
- 45