Solved

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

Posted on 2010-09-24
8
1,610 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
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…

685 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