Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » Lookupservice (How to combine fixed sql with lookup)
Lookupservice [message #783235] Wed, 25 January 2012 10:30 Go to next message
Bertin Kiekebosch is currently offline Bertin Kiekebosch
Messages: 303
Registered: August 2011
Senior Member
Hi,

I have a sql lookUpService like below that works fine

  @Override
  public String getConfiguredSqlSelect() {
    return "SELECT bestandsnaam, bestandsnaam " +
        " FROM geluid " +
        " <key>where bestandsnaam = :key</key>  " +
        " <text>where upper(bestandsnaam) LIKE CONCAT(UPPER(:text), '%')</text>";
  }


but now I want to combine this with some fixed SQL like "where obsolete = 0". Whatever I do I always get an SQL error.

So can I combine a fixed sql part with a lookup service and if yes, how should I do it.

Regards Bertin

Re: Lookupservice [message #783273 is a reply to message #783235] Wed, 25 January 2012 11:58 Go to previous messageGo to next message
Bruno  Köferli is currently offline Bruno Köferli
Messages: 9
Registered: January 2012
Junior Member
Hi Bertin

You have to move your WHERE keyword out of the special tags.

  @Override
  public String getConfiguredSqlSelect() {
    return "SELECT bestandsnaam, bestandsnaam " +
        " FROM geluid " +
        " WHERE obsolete = 0 " +
        " <key>AND bestandsnaam = :key</key>  " +
        " <text>AND upper(bestandsnaam) LIKE CONCAT(UPPER(:text), '%')</text>";
  }

Regards
Bruno
Re: Lookupservice [message #783292 is a reply to message #783273] Wed, 25 January 2012 12:44 Go to previous messageGo to next message
Bertin Kiekebosch is currently offline Bertin Kiekebosch
Messages: 303
Registered: August 2011
Senior Member
Works, thanks for the quick reply.

Regards Bertin
Re: Lookupservice [message #783366 is a reply to message #783292] Wed, 25 January 2012 15:39 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie Bresson
Messages: 118
Registered: November 2010
Senior Member
Is there a need to change or to clarify the documentation :
http://wiki.eclipse.org/Scout/Concepts/Sql_Lookup_Service
?
Re: Lookupservice [message #783385 is a reply to message #783366] Wed, 25 January 2012 16:14 Go to previous messageGo to next message
Bertin Kiekebosch is currently offline Bertin Kiekebosch
Messages: 303
Registered: August 2011
Senior Member
The documentation is too little, it does not tell everything, so a litlle more info would be welcome or some more complex examples.

I can change the documentation with whatever I know.
Re: Lookupservice [message #783391 is a reply to message #783385] Wed, 25 January 2012 16:25 Go to previous messageGo to next message
Bruno  Köferli is currently offline Bruno Köferli
Messages: 9
Registered: January 2012
Junior Member
Indeed, we will update the documentation to clarify this - especially by providing some more examples.
Re: Lookupservice [message #783393 is a reply to message #783391] Wed, 25 January 2012 16:29 Go to previous message
Bertin Kiekebosch is currently offline Bertin Kiekebosch
Messages: 303
Registered: August 2011
Senior Member
I just noticed that the example I needed in the minicrm tutorial. But you only get there when you run through that example, not by looking at the concept pages.
Previous Topic:CalenderField
Next Topic:Server /process HTML page
Goto Forum:
  


Current Time: Mon Sep 22 22:28:22 GMT 2014

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

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