Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » DTP » extending SQL Builder
extending SQL Builder [message #596366] Mon, 07 September 2009 07:41 Go to next message
Satish Kuncha is currently offline Satish KunchaFriend
Messages: 2
Registered: July 2009
Junior Member
Hello,

We are trying extending the SQL Builder dialog of the SQL data tools for providing our project specific functionality.

Our requirements are

1. To have the SQLBuilder and Parser detect our own host variable
a. The syntax for our host variable is %var%.
e.g. %id% is the host variable in the following select query: Select cust_id, cust_name from customer where cust_id = %id%

2. To extend the SQLBuilder GUI for supporting host variable with new syntax.
a. One view is an additional option where we find P_BUILD_Expression(Build Expression...)
b. OR a custom page in 'Expression Builder' wizard.

The following are the problems we faced while trying to tailor SQL data tools code for our needs

About the host variable parsing/recognition:
SQLQuerySourceFormat class only provides a way to set the host variable prefix character. But in our scenario, the variable is delimited by a prefix and a suffix, i.e. '%'. The SQLQueryParserFactory's createVariableExpression() method also handles only the prefix.

About extending the SQL Builder GUI: most classes have the fields declared in default (package level) scope
a. Is there a provision to add something like P_INPUT_EXPRESSION where it presently shows P_BUILD_EXPRESSION/ P_EDIT_EXPRESSION/ P_REPLACE_EXPRESSION for launching our own expression builder
b. OR is there a way to contribute a new page to the 'Expression Builder wizard' e.g. through some sort of extension?

Thanks for your help in advance.
Re: extending SQL Builder [message #596926 is a reply to message #596366] Fri, 11 December 2009 23:34 Go to previous message
Brian Payton is currently offline Brian PaytonFriend
Messages: 154
Registered: July 2009
Senior Member
You are correct that there is a built-in assumption that host variables
have only a prefix character. You will have to do some sub-classing at
appropriate places to handle the suffix. You will have to tweak both
the Query parser and the SQLQuerySourceWriter to handle the suffix.

I suggest launching your own expression builder rather than extending
the existing one. The expression builder in the SQB isn't easy to
extend and is very hard to use. If you come up fix that allows an
extender to add to or change the expression builder launch menu items,
please submit a patch in a bug.

Satish Kuncha wrote:
> Hello,
>
> We are trying extending the SQL Builder dialog of the SQL data tools for
> providing our project specific functionality.
>
> Our requirements are
>
> 1. To have the SQLBuilder and Parser detect our own host variable
> a. The syntax for our host variable is %var%.
> e.g. %id% is the host variable in the following select query: Select
> cust_id, cust_name from customer where cust_id = %id%
>
> 2. To extend the SQLBuilder GUI for supporting host variable with new
> syntax.
> a. One view is an additional option where we find
> P_BUILD_Expression(Build Expression...)
> b. OR a custom page in 'Expression Builder' wizard.
>
> The following are the problems we faced while trying to tailor SQL data
> tools code for our needs
> About the host variable parsing/recognition: SQLQuerySourceFormat class
> only provides a way to set the host variable prefix character. But in
> our scenario, the variable is delimited by a prefix and a suffix, i.e.
> '%'. The SQLQueryParserFactory's createVariableExpression() method also
> handles only the prefix.
> About extending the SQL Builder GUI: most classes have the fields
> declared in default (package level) scope
> a. Is there a provision to add something like P_INPUT_EXPRESSION
> where it presently shows P_BUILD_EXPRESSION/ P_EDIT_EXPRESSION/
> P_REPLACE_EXPRESSION for launching our own expression builder b. OR
> is there a way to contribute a new page to the 'Expression Builder
> wizard' e.g. through some sort of extension?
>
> Thanks for your help in advance.
>
Previous Topic:extending SQL Builder
Next Topic:unable to build Stored procedures
Goto Forum:
  


Current Time: Thu Apr 18 05:09:34 GMT 2024

Powered by FUDForum. Page generated in 0.02094 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top