wxSqlite3 and Creating Virtual tables...

Talk here about issues with one of the components hosted at wxCode, or suggest features for it.
ouch67
Earned some good credits
Earned some good credits
Posts: 134
Joined: Sun Mar 23, 2008 12:09 am

wxSqlite3 and Creating Virtual tables...

Postby ouch67 » Thu Jul 26, 2018 9:39 am

What is the best way to create a table that say consists of 3 columns:

Name char, Price real, Qty real

I don't see where this could be done using wxSqlite3 unless I'm missing something.

(I probably am, ;) )

I just want to create a table that I can use but doesn't actually get saved. Is there a better way than virtual tables?

User avatar
doublemax
Moderator
Moderator
Posts: 12822
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxSqlite3 and Creating Virtual tables...

Postby doublemax » Thu Jul 26, 2018 11:47 am

sqlite supports ":memory:" as a special filename, this will create an in-memory database. I suppose it also works with wxSQlite3.
Use the source, Luke!

utelle
Moderator
Moderator
Posts: 830
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: wxSqlite3 and Creating Virtual tables...

Postby utelle » Thu Jul 26, 2018 11:50 am

ouch67 wrote:What is the best way to create a table that say consists of 3 columns:

Name char, Price real, Qty real

I don't see where this could be done using wxSqlite3 unless I'm missing something.

(I probably am, ;) )

If you are actually referring to SQLite's virtual tables based on the virtual table mechanism, then you haven't missed anything, since wxSQLite3 has no special support for implementing such virtual tables. This would be way beyond the scope of wxSQLite3.

However, from your below comment I get the impression that ...
ouch67 wrote:I just want to create a table that I can use but doesn't actually get saved. Is there a better way than virtual tables?

... what you really want to have, are temporary tables which can be created using the SQL command CREATE TEMPORARY TABLE.

Temporary tables are only visible to the database connection in which they were created, and temporary tables are always automatically deleted when the database connection is closed.

Regards,

Ulrich

ouch67
Earned some good credits
Earned some good credits
Posts: 134
Joined: Sun Mar 23, 2008 12:09 am

Re: wxSqlite3 and Creating Virtual tables...

Postby ouch67 » Thu Jul 26, 2018 6:37 pm

Ah, I see. Thanks to you both.


Return to “wxCode”

Who is online

Users browsing this forum: No registered users and 1 guest