Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » SqlArray bad select?
SqlArray bad select? [message #14645] Wed, 05 March 2008 19:22 Go to next message
indiocolifa is currently offline  indiocolifa
Messages: 49
Registered: January 2008
Location: Argentina
Member
With this code for a SqlArray:

	userList.SetSession(*(G_STATE->GetPsqlSession()));
	userList.SetTable(OPERADOR);
	userList.AddKey(LOGIN);
	userList.SetOrderBy(LOGIN);
	userList.AddColumn(LOGIN,"Usuario de login");
	userList.AddColumn(NOMBRE,"Nombre operador");
	userList.AddColumn(CLASE,"Clase");
	userList.Query();	


I'm getting this SQL (in Log):

select LOGIN, LOGIN, NOMBRE, CLASE from OPERADOR order by LOGIN

Why two LOGIN fields in the query? Should be I think:

select LOGIN, NOMBRE, CLASE from OPERADOR order by LOGIN

I'm using U++ 2008.1 beta

Hernan
Re: SqlArray bad select? [message #14686 is a reply to message #14645] Sat, 08 March 2008 17:22 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Because you have AddKey(LOGIN) and then AddColumn(LOGIN).

The simplest way how to avoid that is to remove AddKey. First array index is always considered a key.

Mirek
Previous Topic: Bugfix: ArrayCtrl Black info popups
Next Topic: Deleting more than one selected records in ArrayCtrl
Goto Forum:
  


Current Time: Mon Apr 29 07:09:43 CEST 2024

Total time taken to generate the page: 0.90424 seconds