Value list should have option to put sql query

Discuss all feature requests you have for a new Servoy versions here. Make sure to be clear about what you want, provide an example and indicate how important the feature is for you

Value list should have option to put sql query

Postby pradiptab » Fri Apr 17, 2009 1:37 pm

Hi all,

Whilw creating value list, there should be option for putting sql query, to fetch data.
It is possible by creating value list at run time by fetching data through query.
But this facility of putting a complex query at the time of creation of the value list will save time and will be easy to use


Regards,
Pradipta
Pradipta
Mindfire Solutions
SAN Developer | Servoy Certified Developer
pradiptab
 
Posts: 59
Joined: Tue Mar 10, 2009 2:32 pm
Location: India, Orissa, Bhubaneswar

Re: Value list should have option to put sql query

Postby rgansevles » Tue Apr 21, 2009 9:37 pm

Pradipta,

Have a look at application.setValueListItems() in combination with databaseManager.getDataSetByQuery()

Rob
Rob Gansevles
Servoy
User avatar
rgansevles
 
Posts: 1894
Joined: Wed Nov 15, 2006 6:17 pm
Location: Amersfoort, NL

Re: Value list should have option to put sql query

Postby lwjwillemsen » Mon Sep 21, 2009 11:04 am

Rob,

Please read the request of Pradipta again. He says he knows you can do it at runtime.

Lambert.
Lambert Willemsen
Vision Development BV
lwjwillemsen
 
Posts: 626
Joined: Sat Mar 14, 2009 5:39 pm
Location: The Netherlands

Re: Value list should have option to put sql query

Postby ngervasi » Tue Sep 22, 2009 1:24 pm

Hmmm, usually a complex query requires parameters and in my experience most of the time the parameters are not constants but variables that need to be evaluated at runtime, how would you handle that in the VL definition dialog?
If all the parameters you need are constants you can already define the valuelist using relations and global relations in the dialog.
ngervasi
 
Posts: 1475
Joined: Tue Dec 21, 2004 12:47 pm
Location: Arezzo, Italy

Re: Value list should have option to put sql query

Postby ROCLASI » Tue Sep 22, 2009 1:57 pm

I guess what would be nice is to be able to set a filter (i.e. the WHERE clause) on a valuelist. This way you don't have to resort to using relations with globals.
Just a thought.
Robert Ivens
ROCLASI Software Solutions / JBS Group, Partner
SAN Developer / Servoy Valued Professional / Servoy Certified Developer
Twitter: @roclasi / @servoyforge
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5320
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Re: Value list should have option to put sql query

Postby jcompagner » Tue Sep 22, 2009 3:06 pm

you could always create a feature request in our support system
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8212
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Value list should have option to put sql query

Postby martinh » Tue Sep 22, 2009 3:27 pm

I'm afraid if you make valuelists by query, that it will affect your performance, because it would execute each time you use the valuelist.

I use queries to fill most of my valuelists, using a dataset

Code: Select all
var _id_array = _ds.getColumnAsArray(1)
var _desc_array = _ds.getColumnAsArray(2)

application.setValueListItems( 'myValuelist',  _desc_array, _id_array);


And I only refresh the valuelist in case that I think it is useful.
Data that is almost static , I load once using the onLoad of the form where it is needed. So during the time my application lives, this kind of valuelists are not reloaded again.

So even when it can be handy to have valuelists by query, I'm afraid from performance point of view, it would perhaps be better not to do it like this.
Martin
------------------------------------------------
Servoy Developer
Version 5.2.10/5.2.13
Java version 1.6 update 31
Database SQL Server 2008 R2
martinh
 
Posts: 857
Joined: Wed May 09, 2007 5:34 pm
Location: Belgium

Re: Value list should have option to put sql query

Postby ROCLASI » Tue Sep 22, 2009 4:30 pm

jcompagner wrote:you could always create a feature request in our support system

Feature request added under #244100 for the valuelist filter option.
Robert Ivens
ROCLASI Software Solutions / JBS Group, Partner
SAN Developer / Servoy Valued Professional / Servoy Certified Developer
Twitter: @roclasi / @servoyforge
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5320
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium


Return to Discuss Feature Requests

Who is online

Users browsing this forum: No registered users and 1 guest

cron