Re: [sqlite] Can I dynamically select a table?

2011-05-12 Thread Igor Tandetnik
On 5/12/2011 10:20 PM, John wrote: > These are the names of actual views in this example. Let me rename them: > >> insert into rules_table values (1, view10); >> insert into rules_table values (2, view20); >> insert into rules_table values (3, view30); >> insert into rules_table values (4, view40);

Re: [sqlite] Can I dynamically select a table?

2011-05-12 Thread John
These are the names of actual views in this example. Let me rename them: > insert into rules_table values (1, view10); > insert into rules_table values (2, view20); > insert into rules_table values (3, view30); > insert into rules_table values (4, view40); On Thu, May 12, 2011 at 7:45 AM, Igor Ta

Re: [sqlite] Can I dynamically select a table?

2011-05-12 Thread Igor Tandetnik
John wrote: > I don't see how that helps. Let's say I have table with rules which > determine from which view to select: > > create rules_table > (condition integer, myview integer); > > insert into rules_table values (1,10); > insert into rules_table values (2,20); > insert into rules_table val

Re: [sqlite] Can I dynamically select a table?

2011-05-11 Thread John
I don't see how that helps. Let's say I have table with rules which determine from which view to select: create rules_table (condition integer, myview integer); insert into rules_table values (1,10); insert into rules_table values (2,20); insert into rules_table values (3,30); insert into rules_t

Re: [sqlite] Can I dynamically select a table?

2011-05-11 Thread Igor Tandetnik
John wrote: > So now I know that case can return column names. But is there a way to tell > it from which table to select. > Earlier I assumed that it is not possible. But know I requestioning > everything. > This, at least, has not worked: > > create table t1 (col integer); > create table t2 (co

Re: [sqlite] Can I dynamically select a table ?

2011-05-11 Thread John
I meant to attach some language that would give me more flexibility than straight sql. On Wed, May 11, 2011 at 10:35 PM, John wrote: > I've developed a mobile app that I want on all smartpnones (that means at > least 4 different platformorms/languages). I've managed to put 80% of logic > in sqli

Re: [sqlite] Can I dynamically select a table ?

2011-05-11 Thread John
I've developed a mobile app that I want on all smartpnones (that means at least 4 different platformorms/languages). I've managed to put 80% of logic in sqlite db (which is on all smartphones). The idea is that the more I can put in sqlite the less I have to explain to four different programmer - l

Re: [sqlite] Can I dynamically select a table ?

2011-05-11 Thread Pavel Ivanov
> I can't trully construct sql statement piece by piece with SQL > db as I did with Oracle. Just wanted to confirm. Why do you need to construct SQL specifically with db's tools? Why can't you do that in your host language? Oracle needs dynamic SQL feature because it will work much faster than the

Re: [sqlite] Can I dynamically select a table ?

2011-05-11 Thread John
To be fair, I asked a theoritical question and created a very simple example for it. The real situation involves choosing dynamically from which view to select. I have very complicated db logic. I ended up asking the application developer to do just what you suggesting: implement a little piece of

Re: [sqlite] Can I dynamically select a table ?

2011-05-11 Thread Nico Williams
On Wed, May 11, 2011 at 9:03 PM, John wrote: > Yes, I could. But considering that I'm applying tons of logic and not just > selected this would be a real mess. Not even sure I could pull it. > Normalization was something I lacked with regard to previous post. But in > this case, I don't think it h

Re: [sqlite] Can I dynamically select a table ?

2011-05-11 Thread John
Yes, I could. But considering that I'm applying tons of logic and not just selected this would be a real mess. Not even sure I could pull it. Normalization was something I lacked with regard to previous post. But in this case, I don't think it has anything to do with it. It's just alack of dynamic

Re: [sqlite] Can I dynamically select a table ?

2011-05-11 Thread Nico Williams
On Wed, May 11, 2011 at 8:47 PM, John wrote: > That would work if I needed to select a single column from a table. But if I > need to select multiple values (c1, c2), then it wouldn't work. Can't have > subquery with more than one column selected, in general, I think. You can do one case for each

Re: [sqlite] Can I dynamically select a table ?

2011-05-11 Thread John
e) > Connected by MOTOBLURâ„¢ on T-Mobile > > -Original message- > From: John > To: General Discussion of SQLite Database > Sent: Wed, May 11, 2011 18:17:14 PDT > Subject: [sqlite] Can I dynamically select a table? > > So now I know that case can return column names. But is there

Re: [sqlite] Can I dynamically select a table ?

2011-05-11 Thread Woody & Yuni Ho
ed, May 11, 2011 18:17:14 PDT Subject: [sqlite] Can I dynamically select a table? So now I know that case can return column names. But is there a way to tell it from which table to select. Earlier I assumed that it is not possible. But know I requestioning everything. This, at least, has not worked: cr

[sqlite] Can I dynamically select a table?

2011-05-11 Thread John
So now I know that case can return column names. But is there a way to tell it from which table to select. Earlier I assumed that it is not possible. But know I requestioning everything. This, at least, has not worked: create table t1 (col integer); create table t2 (col integer); select * from (s