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 » Community » Newbie corner » ProgressIndicator & SQL
ProgressIndicator & SQL [message #37252] Wed, 12 September 2012 10:35 Go to next message
idkfa46 is currently offline  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 Go to previous message
idkfa46 is currently offline  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
Previous Topic: Writes to freed blocks detected
Next Topic: Skylark Compilation
Goto Forum:
  


Current Time: Thu Apr 25 09:26:18 CEST 2024

Total time taken to generate the page: 0.04072 seconds