1

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?

Nakilon
  • 34,866
  • 14
  • 107
  • 142
Zia
  • 11
  • 1
  • 1
  • 3

4 Answers4

2

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!

CRABOLO
  • 8,605
  • 39
  • 41
  • 68
Mordrekai
  • 51
  • 3
0
  • 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.

0

"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.

  1. The example source code is available in the Squirrel repository

    $ git clone git://git.code.sf.net/p/squirrel-sql/git squirrel-sql-git

  2. 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
    
  3. 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>
  1. Build it $ mvn clean compile package

  2. Copy the resulting db2example.jar in Squirrel plugins folder

    copy target\db2example-1.0.jar %Programfiles%\squirrel-sql-3.7.1\plugins\

  3. Launch Squirrel > connect to your DB > in object tree panel, right click on a view > select "(DB2) Script View"... and that's it

0

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:

enter image description here

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
hd84335
  • 8,815
  • 5
  • 34
  • 45