Browse Prior Art Database

Technique for representing a model element as a tree element or a table element

IP.com Disclosure Number: IPCOM000031981D
Original Publication Date: 2004-Oct-18
Included in the Prior Art Database: 2004-Oct-18
Document File: 3 page(s) / 63K

Publishing Venue

IBM

Abstract

Disclosed is a technique for representing a model element as a tree element or table element for purposes of viewing the information contained in the model element. A key part of this technique is the fact that the model element is independent of the GUI elements - a tree or table element. Another key part of the technique is that it operates on a "model" of the syntactic structure of a SQL statement, which will be herein referred to as the "Query Model". This technique is used with the Query Model elements created either through SQL parsing of a SQL statement, or through using the GUI to build a SQL Statement. This technique was implemented in the tool SQLAssist for DB2 V8.1.

This text was extracted from a PDF file.
At least one non-text object (such as an image or picture) has been suppressed.
This is the abbreviated version, containing approximately 47% of the total text.

Page 1 of 3

Technique for representing a model element as a tree element or a table element

After a Query Model element is created, GUI-related objects, such as tree elements and/or table elements are created to "wrap" or encapsulate each model element. Each Query Model element contains information not only about itself, but also about its relationship to other Query Model elements. The GUI-related objects maintain this relationships with the corresponding GUI-related object as well.

When the tool is handed a SQL statement string, an SQL parser is used to handle the syntactic aspect of parsing this string into Query Model elements. For example, the SQL statement,

SELECT EMPNO, LASTNAME, SALARY FROM EMPLOYEE WHERE SALARY > 30000

can be represented in model form as:

SQLQueryStatement

SQLSelectClause

SQLExpressionColumn(name:EMPNO)

SQLExpressionColumn(name:LASTNAME)

SQLExpressionColumn(name:SALARY)

SQLFromClause

SQLTableReference(name: EMPLOYEE)

SQLSearchCondition (value: SALARY > 30000)

SQLExpressionColumn(name: SALARY)

SQLExpressionOperator(operator: >)

SQLExpressionLiteral(value: 30000)

Each of the named item above represents a Query Model element and the indentation indicates a "contains" relationship. This "contains" relationship can be represented with a string using indentations for each "clause". Another way is to represent it as a tree structure as shown in Figure 1 below. Each higher level query Model element object (e.g SQLQueryStatement itself, the SQLSelectClause, SQLFromClause and SQLSearchCondition) is encapsulated in a GUI object, called a tree node.

Figure 1. Tree structure outline of a SQL Statement

Aside from the Query Model elements represented in Figure 1, other Query Model elements are involved in the statement. Continuing with our example, the query Model element for the table EMPLOYEE used in the SQLFromClause, is of a type SQLTableReference, and is represented in subsequent panels of the tool as both a tree element and a table element. In the right panel of Figure 2, the SQLTableReference for EMPLOYEE, is wrapped as a table cell entry under the heading "Table" in the "Selected source tables" table. This model element has an attribute called an "alias" and this attribute is displayed as another table cell entry in the "Selected source tables" table, under the heading "Name".

1

[This page contains 1 picture or other non-text object]

Page 2 of 3

Figure 2. Available Tables tree structure and Selected Source Tables table structure

The same SQLTableReference element EMPLOYEE, contains within it, references to other Query Model elements of type SQLExpressionColumn. This relationship is represented as a tree structure, as shown in the left panel of Figure 3. All SQLExpressionColumn elements belong to the SQLTableReference element EMPLOYEE, are shown as child tree nodes of the tree node "MARICHU.EMPLOYEE". The SQLExpressionColumn model elements participating in the query are called "Result columns" and are represented as table ce...