Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[dtp-dev] SQL Completion in DTP 1.6

I posted in the DTP user newsgroup about the state of the SQL
completion code in DTP 1.6 and didn't get much response, so I thought
I would ask about it here.

Environment: DTP 1.6 on Eclipse 3.4 (the Eclipse IDE for Java EE
Developers package) with DB2 8.2 and 9.x databases (I've also tested
with Derby)

The state of SQL code completion in the SQL editor is what I would
characterize as "usable, but very limited." Some of the behavior I
have observed:

* It does a good job at providing table name completion in the FROM
clause of a SELECT statement, but only if the user connects to the
database with a username that matches the schema he's working in.
There is currently no provision to define the current schema for use
by the SQL editor / code completion engine.
* It provides column name completion in the SELECT clause only if the
user provides the table name first. For example, if the user types

SELECT ^
FROM FOO

(cursor is located at ^) and presses CTRL+SPACE for completion, a list
of tables appears, but not the list of columns for FOO. If he types
FOO. then a list of columns appears for FOO. But prefixing each column
name with the table name is cumbersome.
* It cannot provide column name completion for queries where table
name aliases are defined in the FROM clause.

I did some analysis of the DTP source code. It appears that the code
completion engine does not take into account the entire query when
computing proposals. It attempts to parse the query to the point where
the cursor is located, and does not consider the remainder of the
statement. That would account for the behavior I have observed.

Are there plans to continue work on the SQL code completion engine? I
thought of investigating doing some work on it myself, but then I
noticed that the IBM Data Studio product, which is available from IBM
via a free download and appears to be based on the DTP code base, has
much better SQL completion features.  So I'm hesitant to volunteer
time to add features to DTP that have already been implemented by IBM
in a free Eclipse-based tool, and which might possibly be donated by
IBM back to the DTP project.

-- 
Stephen Schaub


Back to the top