Solved

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

Posted on 2010-09-24
8
1,630 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
8 Comments
 
LVL 60

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 60

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
Quiz: What Do These Organizations Have In Common?

Hint: Their teams ended up taking quizzes, too.

 

Author Closing Comment

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

thanks
0
 
LVL 60

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 60

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 60

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

Webinar: MariaDB® Server 10.2: The Complete Guide

Join Percona’s Chief Evangelist, Colin Charles as he presents MariaDB Server 10.2: The Complete Guide on Tuesday, June 27, 2017 at 7:00 am PDT / 10:00 am EDT (UTC-7).

Question has a verified solution.

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

This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
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…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

724 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