Solved

sqlite3 error no such column: a.ID, Its fine in the SQLite manager

Posted on 2010-09-24
8
1,603 Views
Last Modified: 2012-05-10
I'm just getting round to implementing this code..

create table tmp as select id, desc, startdate as due, price from billsndeposits where (intervaltype = 'once' or interval = 0) union all select a.ID, a.desc, date(a.startdate, '+'||(b.n*a.interval)||' '||a.intervaltype) as due, a.[price] from billsndeposits a inner join util_nums b on date(a.startdate, '+'||(b.n*a.interval)||' '||a.intervaltype) < date('2011-01-01') where not (intervaltype = 'once' or interval = 0) order by due, id;

Gives me an error.

no such column: a.ID

Its fine in the SQLite manager but not on the device.

Any ideas ?
0
Comment
Question by:mindwarpltd
  • 5
  • 3
8 Comments
 
LVL 59

Expert Comment

by:Kevin Cross
ID: 33753488
Hi mindwarpltd,

I copied the code above and it ran on my system without the error you specified above, so you may want to double check the structure of billsndeposits includes the ID column expected by the code.

Kevin
0
 
LVL 59

Accepted Solution

by:
Kevin Cross earned 500 total points
ID: 33753502
Ah, I see now, you said it worked for you also in SQLite Manager but not on the device.  I tried this at the command line and it worked, so please clarify what you mean by not on the device.  Is this through a remote application or are you speaking of the command line interface?
0
 

Author Comment

by:mindwarpltd
ID: 33753539
Its on the iphone.

Can we put the word alias in there, isn't what we have short hand ?
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

Author Closing Comment

by:mindwarpltd
ID: 33753569
Yes your right the id has changed some how :)

thanks
0
 
LVL 59

Expert Comment

by:Kevin Cross
ID: 33753581
Yes, you can try that by doing "billsndeposits as a" and ensure it is not a case issue by using "a.id" since you didn't get an error on id in the first part of the union.  

However, remember why we used this tmp table was so that the iPhone App would have a simple :

select * from tmp;

Type of query!
0
 
LVL 59

Expert Comment

by:Kevin Cross
ID: 33753602
AH, cool, glad you found that -- but see my last note -- just remember we were setting up a view on the SQLite end so that the app calls would be simpler and perform better from the static table versus having to handle the larger processing associated with building the events out ...

Thanks for the accepted solution by the way.

Best regards and happy coding,

Kevin
0
 

Author Comment

by:mindwarpltd
ID: 33753735
I thought the last solution was...

create billndesposts table and add some data

Create util_ums table and populate

drop tmp table is already exists
populate

and query tmp table.

I think the view was from an earlier attempt ?
0
 
LVL 59

Expert Comment

by:Kevin Cross
ID: 33754558
You have it correct in your last post.  View was incorrect word on my part.  I just wanted to make sure you were querying the tmp table on the iPhone App -- with the error you were getting I was just making sure, you were just running the drop tmp and populate on the database end which it sounds like you understand.

Good deal and good luck!
0

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Connection to multiple databases 13 25
Optimize the query 5 43
query question 12 32
RAISERROR WITH NOWAIT 2 17
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
As technology users and professionals, we’re always learning. Our universal interest in advancing our knowledge of the trade is unmatched by most industries. It’s a curiosity that makes sense, given the climate of change. Within that, there lies a…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question