|
|
Home » U++ Library support » U++ SQL » How to display fields from different tables in one SQLArray
Re: How to display fields from different tables in one SQLArray [message #20493 is a reply to message #19154] |
Fri, 20 March 2009 17:06 |
|
I went on the road, proposed in a previous message, and came across an odd job VectorMap. Here is a piece of code.
Value ConvNomencl::Format(const Value& q) const
{
static VectorMap<int, String> nom;
static Time lastcleartime;
if(GetSysTime()-lastcleartime > 60){
nom.Clear();
lastcleartime=GetSysTime();
}
if(nom.GetCount()==0) nom.Add(0, " "); // <==adding empty entry there.
int q1=q;
int f = nom.Find(q1);
if(f > 0){
String s;
s = nom.Get(q1);
return s;
} else {
Sql sql;
sql * SqlSelect(NOM_ID,NOM_NAME).From(NOMENCL).Where(NOM_ID == q);
String nomencl;
if(sql.Fetch()) {
int sid = sql[NOM_ID];
nom.Add(sid, sql[NOM_NAME]);
nomencl = sql[NOM_NAME];
} else {
nomencl = "";
}
return nomencl;
}
}
After creating or cleaning object VectorMap, the first added item can not be found by .Find() method, and therefore the number of elements corresponding to the first element is continuously growing.
However, if you add the first empty element - then all the rest are working properly. This is well intended, or is it wrong?
SergeyNikitin<U++>( linux, wine )
{
under( Ubuntu || Debian || Raspbian );
}
|
|
|
|
|
How to display fields from different tables in one SQLArray
|
|
|
Re: How to display fields from different tables in one SQLArray
By: zsolt on Mon, 20 October 2008 14:20
|
|
|
Re: How to display fields from different tables in one SQLArray
|
|
|
Re: How to display fields from different tables in one SQLArray
|
|
|
Re: How to display fields from different tables in one SQLArray
By: zsolt on Mon, 20 October 2008 22:51
|
|
|
Re: How to display fields from different tables in one SQLArray
|
|
|
Re: How to display fields from different tables in one SQLArray
|
|
|
Re: How to display fields from different tables in one SQLArray
|
|
|
Re: How to display fields from different tables in one SQLArray
By: mirek on Sun, 02 November 2008 16:47
|
|
|
Re: How to display fields from different tables in one SQLArray
|
|
|
Re: How to display fields from different tables in one SQLArray
By: unodgs on Sun, 02 November 2008 19:09
|
|
|
Re: How to display fields from different tables in one SQLArray
|
|
|
Re: How to display fields from different tables in one SQLArray
By: unodgs on Sun, 02 November 2008 20:44
|
|
|
Re: How to display fields from different tables in one SQLArray
|
|
|
Re: How to display fields from different tables in one SQLArray
|
|
|
Re: How to display fields from different tables in one SQLArray
By: mirek on Sun, 02 November 2008 22:01
|
|
|
Re: How to display fields from different tables in one SQLArray
By: mirek on Sun, 02 November 2008 21:59
|
|
|
Re: How to display fields from different tables in one SQLArray
|
|
|
Re: How to display fields from different tables in one SQLArray
By: mirek on Wed, 12 November 2008 22:23
|
|
|
Re: How to display fields from different tables in one SQLArray
|
|
|
Re: How to display fields from different tables in one SQLArray
By: mirek on Sat, 15 November 2008 15:02
|
|
|
Re: How to display fields from different tables in one SQLArray
|
|
|
Re: How to display fields from different tables in one SQLArray
|
|
|
Re: How to display fields from different tables in one SQLArray
By: mirek on Sun, 02 November 2008 21:55
|
|
|
Re: How to display fields from different tables in one SQLArray
By: mr_ped on Fri, 20 March 2009 21:37
|
|
|
Re: How to display fields from different tables in one SQLArray
|
|
|
Re: How to display fields from different tables in one SQLArray
|
|
|
template + convert problem
|
|
|
Re: template + convert problem
By: Zbych on Sat, 19 September 2009 19:30
|
|
|
Re: template + convert problem
|
|
|
Re: template + convert problem
|
|
|
Re: template + convert problem
|
|
|
Re: template + convert problem
By: Zbych on Sun, 20 September 2009 15:47
|
|
|
Re: template + convert problem
|
|
|
Re: template + convert problem
|
Goto Forum:
Current Time: Sat May 11 18:37:08 CEST 2024
Total time taken to generate the page: 0.02858 seconds
|
|
|