Home » Community » Newbie corner » ProgressIndicator & SQL
ProgressIndicator & SQL [message #37252] |
Wed, 12 September 2012 10:35  |
idkfa46
Messages: 155 Registered: December 2011
|
Experienced Member |
|
|
Hi guys,
how can i add a ProgressIndicator to a SQL query ?!
for example, in a query like this one
VectorMap<String, Vector<double> > m;
m.Add("a") <<0<<0<<0<<0<<0;
m.Add("b") <<1<<1<<1<<1<<1;
m.Add("c") <<2<<2<<2<<2<<2;
m.Add("d") <<3<<3<<3<<3<<3;
m.Add("e") <<4<<4<<4<<4<<4;
m.Add("f") <<5<<5<<5<<5<<5;
m.Add("g") <<6<<6<<6<<6<<6;
for(int i=0; i < m.GetCount(); i++)
{
Vector<double> const &v =m[i];
try
{
SQL & Insert(PIPPO) (DT, m.GetKey(i))
(CATa, v[0])
(CATb, v[1])
(CATc, v[2])
(CATd, v[3])
(CATe, v[4])
;
}
catch(SqlExc &e)
{
Exclamation("[* " + DeQtfLf(e) + "]");
}
}
PromptOK(t_("Default values restored"));
how can i add a
...
Progress p;
p.SetText(t_("Creating database"));
...
???
Regards,
Matteo
|
|
|
Re: ProgressIndicator & SQL [message #37255 is a reply to message #37252] |
Wed, 12 September 2012 14:57  |
idkfa46
Messages: 155 Registered: December 2011
|
Experienced Member |
|
|
SOLVED
VectorMap<String, Vector<double> > m;
m.Add("a") <<0<<0<<0<<0<<0;
m.Add("b") <<1<<1<<1<<1<<1;
m.Add("c") <<2<<2<<2<<2<<2;
m.Add("d") <<3<<3<<3<<3<<3;
m.Add("e") <<4<<4<<4<<4<<4;
m.Add("f") <<5<<5<<5<<5<<5;
m.Add("g") <<6<<6<<6<<6<<6;
Progress p;
p.Set(0,m.GetCount());
p.SetText(t_("Creating database"));
for(int i=0; i < m.GetCount(); i++)
{
Vector<double> const &v =m[i];
try
{
SQL & Insert(PIPPO) (DT, m.GetKey(i))
(CATa, v[0])
(CATb, v[1])
(CATc, v[2])
(CATd, v[3])
(CATe, v[4])
;
}
catch(SqlExc &e)
{
Exclamation("[* " + DeQtfLf(e) + "]");
}
p.SetPos(i);
}
PromptOK(t_("Default values restored"));
Regards,
Matteo
|
|
|
Goto Forum:
Current Time: Sat Apr 26 14:40:27 CEST 2025
Total time taken to generate the page: 0.00850 seconds
|