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 » sqlarray and sqlite (Trying to use sqlite example but...)
Re: sqlarray and sqlite [message #54859 is a reply to message #54819] Tue, 22 September 2020 20:41 Go to previous messageGo to previous message
jimlef is currently offline  jimlef
Messages: 90
Registered: September 2020
Location: US
Member
----------------------------------
Thread: 1


----------------------------------
Thread: 2

../sysdeps/unix/sysv/linux/poll.c:29
/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
g_main_context_iteration () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
start_thread (arg=<optimized out>) at pthread_create.c:477
clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

----------------------------------
Thread: 3

../sysdeps/unix/sysv/linux/poll.c:29
/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
g_main_loop_run () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
/usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
start_thread (arg=<optimized out>) at pthread_create.c:477
clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

----------------------------------
Thread: 4

futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0xe82d60 <Upp::CoWork::GetPool()::pool+114848>) at ../sysdeps/nptl/futex-internal.h:183
pthread_cond_wait.c:508
pthread_cond_wait.c:638
Upp::ConditionVariable::Wait (this=0xe82d38 <Upp::CoWork::GetPool()::pool+114808>, m=..., timeout_ms=-1) at Mt.cpp:624
Upp::CoWork::Pool::ThreadRun (tno=0) at CoWork.cpp:155
Upp::CoWork::Pool::InitThreads(int)::$_21::operator()() const (this=0x7ffff4de58ec) at CoWork.cpp:31
Upp::Function<void ()>::Wrapper<Upp::CoWork::Pool::InitThreads(int)::$_21>::Execute() (this=0x7ffff4de58e0) at Function.h:17
Upp::Function<void ()>::operator()() const (this=0x7ffff4de5920) at /home/james/upp/uppsrc/Core/Function.h:76
Upp::sThreadRoutine (arg=0x7ffff4de5920) at Mt.cpp:91
start_thread (arg=<optimized out>) at pthread_create.c:477
clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

----------------------------------
Thread: 5

futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0xe82d60 <Upp::CoWork::GetPool()::pool+114848>) at ../sysdeps/nptl/futex-internal.h:183
pthread_cond_wait.c:508
pthread_cond_wait.c:638
Upp::ConditionVariable::Wait (this=0xe82d38 <Upp::CoWork::GetPool()::pool+114808>, m=..., timeout_ms=-1) at Mt.cpp:624
Upp::CoWork::Pool::ThreadRun (tno=1) at CoWork.cpp:155
Upp::CoWork::Pool::InitThreads(int)::$_21::operator()() const (this=0x7ffff4de59ac) at CoWork.cpp:31
Upp::Function<void ()>::Wrapper<Upp::CoWork::Pool::InitThreads(int)::$_21>::Execute() (this=0x7ffff4de59a0) at Function.h:17
Upp::Function<void ()>::operator()() const (this=0x7ffff4de59e0) at /home/james/upp/uppsrc/Core/Function.h:76
Upp::sThreadRoutine (arg=0x7ffff4de59e0) at Mt.cpp:91
start_thread (arg=<optimized out>) at pthread_create.c:477
clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

----------------------------------
Thread: 6

futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0xe82d60 <Upp::CoWork::GetPool()::pool+114848>) at ../sysdeps/nptl/futex-internal.h:183
pthread_cond_wait.c:508
pthread_cond_wait.c:638
Upp::ConditionVariable::Wait (this=0xe82d38 <Upp::CoWork::GetPool()::pool+114808>, m=..., timeout_ms=-1) at Mt.cpp:624
Upp::CoWork::Pool::ThreadRun (tno=2) at CoWork.cpp:155
Upp::CoWork::Pool::InitThreads(int)::$_21::operator()() const (this=0x7ffff4de5a6c) at CoWork.cpp:31
Upp::Function<void ()>::Wrapper<Upp::CoWork::Pool::InitThreads(int)::$_21>::Execute() (this=0x7ffff4de5a60) at Function.h:17
Upp::Function<void ()>::operator()() const (this=0x7ffff4de5aa0) at /home/james/upp/uppsrc/Core/Function.h:76
Upp::sThreadRoutine (arg=0x7ffff4de5aa0) at Mt.cpp:91
start_thread (arg=<optimized out>) at pthread_create.c:477
clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

----------------------------------
Thread: 7

futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0xe82d60 <Upp::CoWork::GetPool()::pool+114848>) at ../sysdeps/nptl/futex-internal.h:183
pthread_cond_wait.c:508
pthread_cond_wait.c:638
Upp::ConditionVariable::Wait (this=0xe82d38 <Upp::CoWork::GetPool()::pool+114808>, m=..., timeout_ms=-1) at Mt.cpp:624
Upp::CoWork::Pool::ThreadRun (tno=3) at CoWork.cpp:155
Upp::CoWork::Pool::InitThreads(int)::$_21::operator()() const (this=0x7ffff4de58ac) at CoWork.cpp:31
Upp::Function<void ()>::Wrapper<Upp::CoWork::Pool::InitThreads(int)::$_21>::Execute() (this=0x7ffff4de58a0) at Function.h:17
Upp::Function<void ()>::operator()() const (this=0x7ffff4de5b20) at /home/james/upp/uppsrc/Core/Function.h:76
Upp::sThreadRoutine (arg=0x7ffff4de5b20) at Mt.cpp:91
start_thread (arg=<optimized out>) at pthread_create.c:477
clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

----------------------------------
Thread: 8

futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0xe82d60 <Upp::CoWork::GetPool()::pool+114848>) at ../sysdeps/nptl/futex-internal.h:183
pthread_cond_wait.c:508
pthread_cond_wait.c:638
Upp::ConditionVariable::Wait (this=0xe82d38 <Upp::CoWork::GetPool()::pool+114808>, m=..., timeout_ms=-1) at Mt.cpp:624
Upp::CoWork::Pool::ThreadRun (tno=4) at CoWork.cpp:155
Upp::CoWork::Pool::InitThreads(int)::$_21::operator()() const (this=0x7ffff4de5bac) at CoWork.cpp:31
Upp::Function<void ()>::Wrapper<Upp::CoWork::Pool::InitThreads(int)::$_21>::Execute() (this=0x7ffff4de5ba0) at Function.h:17
Upp::Function<void ()>::operator()() const (this=0x7ffff4de5be0) at /home/james/upp/uppsrc/Core/Function.h:76
Upp::sThreadRoutine (arg=0x7ffff4de5be0) at Mt.cpp:91
start_thread (arg=<optimized out>) at pthread_create.c:477
clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

----------------------------------
Thread: 9

futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0xe82d60 <Upp::CoWork::GetPool()::pool+114848>) at ../sysdeps/nptl/futex-internal.h:183
pthread_cond_wait.c:508
pthread_cond_wait.c:638
Upp::ConditionVariable::Wait (this=0xe82d38 <Upp::CoWork::GetPool()::pool+114808>, m=..., timeout_ms=-1) at Mt.cpp:624
Upp::CoWork::Pool::ThreadRun (tno=5) at CoWork.cpp:155
Upp::CoWork::Pool::InitThreads(int)::$_21::operator()() const (this=0x7ffff4de5c6c) at CoWork.cpp:31
Upp::Function<void ()>::Wrapper<Upp::CoWork::Pool::InitThreads(int)::$_21>::Execute() (this=0x7ffff4de5c60) at Function.h:17
Upp::Function<void ()>::operator()() const (this=0x7ffff4de5ca0) at /home/james/upp/uppsrc/Core/Function.h:76
Upp::sThreadRoutine (arg=0x7ffff4de5ca0) at Mt.cpp:91
start_thread (arg=<optimized out>) at pthread_create.c:477
clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

The code:
CustomersWindow::CustomersWindow() {


	CtrlLayout(*this, "Customers");
	
	btnAddCustomer << [=] { btnAddCustomerClick(); }; // THISBACK is not needed in c++11 world and could be replaced with lambda.
	btnSearchCustomer << [=] { btnSearchCustomerClick(); }; // assisted by forum user Klugier
	btnUpdateCustomer << [=] { btnUpdateCustomerClick(); };
	
	btnFake << [=] { FakeStub(); };
	
	if(FileExists(configfile))
	{
        VectorMap<String, String> cfg = LoadIniFile(configfile);
        DBFile = cfg.Get("DBFile", Null);
	}
	else {
		DBFile = SelectDB();
	}
	SQL;
	Sqlite3Session sqlite3;
	if(!sqlite3.Open(DBFile)) {
		Exclamation("Can't create or open database file\n");
		return;
	}
	SQL = sqlite3;
	Sql sql;
	CustArray.SetTable(CUSTOMERS, CUST_ID);
		
	// CustArray.Join(BOOK_ID, book); // joins id from other db to this id
	CustArray.AddColumn(CUSTNAME, "Name"); // .SetConvert(DateIntConvert());
	CustArray.AddColumn(EMAIL, "Email"); // .SetConvert(DateIntConvert());
	CustArray.AddColumn(CONTACT, "Phone");
	CustArray.AddColumn(ADDRESS, "Address");
	CustArray.AddColumn(CITY, "City");
	CustArray.AddColumn(STATE, "State");
	CustArray.AddColumn(ZIP, "Zip");
	CustArray.AddColumn(TAXABLE, "Taxable?");
	CustArray.ColumnWidths("40 40 20 50 20 15 10 5");
	CustArray.SetOrderBy(CUST_ID);
	
	// sql.Execute("select * from CUSTOMERS");
	sql * SelectAll().From(CUSTOMERS);
	
	// while(sql.Fetch()) 	CustArray.Add(sql);
	CustArray.Query();
	
	// CustArray.WhenBar
	CustArray.WhenLeftDouble = [=] { EditRow(); };
	
	// CustArray.GoEndPostQuery();

}


 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Friends? Cousins? Half-siblings?
Next Topic: how to make an editfield accept only number or date? have any examples in the documentation?
Goto Forum:
  


Current Time: Mon Jul 07 18:21:32 CEST 2025

Total time taken to generate the page: 0.04571 seconds