[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1714
  • Last Modified:

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

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
mindwarpltd
Asked:
mindwarpltd
  • 5
  • 3
1 Solution
 
Kevin CrossChief Technology OfficerCommented:
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
 
Kevin CrossChief Technology OfficerCommented:
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
 
mindwarpltdAuthor Commented:
Its on the iphone.

Can we put the word alias in there, isn't what we have short hand ?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
mindwarpltdAuthor Commented:
Yes your right the id has changed some how :)

thanks
0
 
Kevin CrossChief Technology OfficerCommented:
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
 
Kevin CrossChief Technology OfficerCommented:
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
 
mindwarpltdAuthor Commented:
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
 
Kevin CrossChief Technology OfficerCommented:
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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now