Re: [sqlite] Query runs in SQLite Database Browser but not in iPad app

2012-06-04 Thread Rolf Marsh
Hi Simon… project was cancelled… if it get's resurrected, and I still have the 
problem, I'll get back to you.  Thank you for your time…

Regards,
Rolf

On Jun 4, 2012, at 7:29 AM, Simon Slavin wrote:

> 
> On 4 Jun 2012, at 3:24pm, Rolf Marsh  wrote:
> 
>> "Could you possibly reduce your database to just a few records -- just 
>> enough that it correctly reproduces your problem ?  You can use the SQLite 
>> shell tool to .dump the database which will let you post a complete copy for 
>> our testing. "
>> 
>> Sorry, but I don't know how to do this… can you give me the syntax?
> 
> Make a copy of your database, and use the SQList shell tool (see the SQLite 
> download page) to delete TABLEs, VIEWs, INDEXes and rows from it until you 
> have a very small database (perhaps just a few rows) which still demonstrates 
> the problem you have.  Try and remove absolutely everything you can until the 
> problem goes away, then go back one step until you have a tiny database which 
> still demonstrates your problem.
> 
>> and where will the output go?  and do you want me to put the output on 
>> PasteBin?
> 
> You can use the '.dump' command from the SQList shell tool (see the SQLite 
> download page) to turn any SQLite database into SQL commands.  Then you can 
> include that text in a post to the list.
> 
> Simon.
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Query runs in SQLite Database Browser but not in iPad app

2012-06-04 Thread Simon Slavin

On 4 Jun 2012, at 3:24pm, Rolf Marsh  wrote:

> "Could you possibly reduce your database to just a few records -- just enough 
> that it correctly reproduces your problem ?  You can use the SQLite shell 
> tool to .dump the database which will let you post a complete copy for our 
> testing. "
> 
> Sorry, but I don't know how to do this… can you give me the syntax?

Make a copy of your database, and use the SQList shell tool (see the SQLite 
download page) to delete TABLEs, VIEWs, INDEXes and rows from it until you have 
a very small database (perhaps just a few rows) which still demonstrates the 
problem you have.  Try and remove absolutely everything you can until the 
problem goes away, then go back one step until you have a tiny database which 
still demonstrates your problem.

> and where will the output go?  and do you want me to put the output on 
> PasteBin?

You can use the '.dump' command from the SQList shell tool (see the SQLite 
download page) to turn any SQLite database into SQL commands.  Then you can 
include that text in a post to the list.

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Query runs in SQLite Database Browser but not in iPad app

2012-06-04 Thread Rolf Marsh
Simon… did you get my response to your last question?

"Could you possibly reduce your database to just a few records -- just enough 
that it correctly reproduces your problem ?  You can use the SQLite shell tool 
to .dump the database which will let you post a complete copy for our testing. "

 Sorry, but I don't know how to do this… can you give me the syntax?  and where 
will the output go?  and do you want me to put the output on PasteBin?

Rolf

On Jun 3, 2012, at 10:40 AM, Simon Slavin wrote:

> 
> On 3 Jun 2012, at 5:28pm, Rolf Marsh  wrote:
> 
>> Simon… what happened to my images and the attachment?  I can put them on 
>> Dropbox, or do you have somewhere else I can put them so you can access them?
> 
> Attachments don't work on this list.  We don't want everyone sending us their 
> homework.
> 
> Just type in the version numbers you get, and tell us what result the SQLite 
> shell tool gives.
> 
> Simon.
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Query runs in SQLite Database Browser but not in iPad app

2012-06-04 Thread Simon Slavin

On 4 Jun 2012, at 6:14am, YAN HONG YE  wrote:

> I have a sqlite db file in my pc, and now I wanna to copy my db file to my 
> ipad.

The format of SQLite databases is identical on every platform.  You can make a 
database on one platform and read it on another.

> I need open db files in ipad,but I don't know how to open the file.

You will need an iPad app which uses that database.  Or perhaps an iPad app 
which can read/write all SQLite databases.

> and where should I copy my db files to my ipad.

On iDevices, each application has access only to its own files.  There's no 
'user filespace' which all applications can access.  You can

A) include the database file as part of the application you want to open it, or
B) put the file in that application's filespace, or
C) if the application is correctly written, you can use the Apps pane in iTunes 
to copy its data files between your computer and your iDevice.

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Query runs in SQLite Database Browser but not in iPad app

2012-06-03 Thread Rolf Marsh

On Jun 2, 2012, at 6:18 PM, Simon Slavin wrote:

> 
> On 3 Jun 2012, at 12:11am, Rolf Marsh  wrote:
> 
>> I have this select statement which returns the correct results (count = 2) 
>> when run in SQL Database Browser, but not in my Objective-c iPad app (count 
>> = 0).
>> 
>> select count(orderdata.order_id) from orderdata, custdata, orderinfo 
>>  where custdata.customer_id = orderinfo.cust_id and
>>  orderdata.order_id = orderinfo.cust_id and 
>>  custdata.Bus_name = 'Albertsons'
> 
> In your iPad app, are you using SQLite C functions to call SQLite, or are you 
> using s different API ?  I was using FMDB; got the error and switched to 
> native SQLite3… same results, so it's not FMDB...
> 
> 
> Please execute the following in SQL Database Browser (shows 3.6.1.8) and in 
> your iPad app: 3.7.7  Shell tool: 3.7.7
> 
> SELECT sqlite_version()
> 
> It's okay that the results from the two pieces of software are different, but 
> knowing what they are might help us figure out what's going on.
> 
> Please also copy the database to your computer, and use the SQLite shell tool 
> to execute the same query.  The shell tool is as close to canonical as 
> anything is: whatever result that gets is the 'right' result.  shell tool 
> gives the correct value: 2
> 
> Could you possibly reduce your database to just a few records -- just enough 
> that it correctly reproduces your problem ?  You can use the SQLite shell 
> tool to .dump the database which will let you post a complete copy for our 
> testing.  Sorry, but I don't know how to do this… can you give me the syntax? 
>  and where will the output go?  and do you want me to put the output on 
> PasteBin?

Rolf
> 
> Simon.
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Query runs in SQLite Database Browser but not in iPad app

2012-06-03 Thread Simon Slavin

On 3 Jun 2012, at 5:28pm, Rolf Marsh  wrote:

> Simon… what happened to my images and the attachment?  I can put them on 
> Dropbox, or do you have somewhere else I can put them so you can access them?

Attachments don't work on this list.  We don't want everyone sending us their 
homework.

Just type in the version numbers you get, and tell us what result the SQLite 
shell tool gives.

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Query runs in SQLite Database Browser but not in iPad app

2012-06-03 Thread Rolf Marsh
Simon… what happened to my images and the attachment?  I can put them on 
Dropbox, or do you have somewhere else I can put them so you can access them?

Rolf

On Jun 3, 2012, at 7:13 AM, Rolf Marsh wrote:

> Simon… please see my responses below…
> 
> Regards,
> Rolf
> 
> On Jun 2, 2012, at 6:18 PM, Simon Slavin wrote:
> 
>> 
>> On 3 Jun 2012, at 12:11am, Rolf Marsh  wrote:
>> 
>>> I have this select statement which returns the correct results (count = 2) 
>>> when run in SQL Database Browser, but not in my Objective-c iPad app (count 
>>> = 0).
>>> 
>>> select count(orderdata.order_id) from orderdata, custdata, orderinfo 
>>> where custdata.customer_id = orderinfo.cust_id and
>>> orderdata.order_id = orderinfo.cust_id and 
>>> custdata.Bus_name = 'Albertsons'
>> 
>> In your iPad app, are you using SQLite C functions to call SQLite, or are 
>> you using s different API ?  I was using FMDB; got the error and switched to 
>> native SQLite3… same results, so it's not FMDB...
>> 
>> Please execute the following in SQL Database Browser and in your iPad app:
>> 
> 
>> SELECT sqlite_version()
> This is from SQLite Database Browser:
> 
> This is from the program
> 
>> 
>> It's okay that the results from the two pieces of software are different, 
>> but knowing what they are might help us figure out what's going on.
>> 
>> Please also copy the database to your computer, and use the SQLite shell 
>> tool to execute the same query.  The shell tool is as close to canonical as 
>> anything is: whatever result that gets is the 'right' result.  yes, it got 
>> the correct result
> 
>> 
>> Could you possibly reduce your database to just a few records -- just enough 
>> that it correctly reproduces your problem ?  You can use the SQLite shell 
>> tool to .dump the database which will let you post a complete copy for our 
>> testing.this d/b is the same one I'm getting the error on… very small...
>> 
>> Simon.
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> 
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Query runs in SQLite Database Browser but not in iPad app

2012-06-03 Thread Rolf Marsh
Simon… please see my responses below…

Regards,
Rolf

On Jun 2, 2012, at 6:18 PM, Simon Slavin wrote:

> 
> On 3 Jun 2012, at 12:11am, Rolf Marsh  wrote:
> 
>> I have this select statement which returns the correct results (count = 2) 
>> when run in SQL Database Browser, but not in my Objective-c iPad app (count 
>> = 0).
>> 
>> select count(orderdata.order_id) from orderdata, custdata, orderinfo 
>>  where custdata.customer_id = orderinfo.cust_id and
>>  orderdata.order_id = orderinfo.cust_id and 
>>  custdata.Bus_name = 'Albertsons'
> 
> In your iPad app, are you using SQLite C functions to call SQLite, or are you 
> using s different API ?  I was using FMDB; got the error and switched to 
> native SQLite3… same results, so it's not FMDB...
> 
> Please execute the following in SQL Database Browser and in your iPad app:
> 

> SELECT sqlite_version()
This is from SQLite Database Browser:

This is from the program

> 
> It's okay that the results from the two pieces of software are different, but 
> knowing what they are might help us figure out what's going on.
> 
> Please also copy the database to your computer, and use the SQLite shell tool 
> to execute the same query.  The shell tool is as close to canonical as 
> anything is: whatever result that gets is the 'right' result.  yes, it got 
> the correct result

> 
> Could you possibly reduce your database to just a few records -- just enough 
> that it correctly reproduces your problem ?  You can use the SQLite shell 
> tool to .dump the database which will let you post a complete copy for our 
> testing.this d/b is the same one I'm getting the error on… very small...
> 
> Simon.
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Query runs in SQLite Database Browser but not in iPad app

2012-06-03 Thread Rolf Marsh
Hi Tom… by "schema", I'm assuming you are looking for the code to define the 
tables?  If so, here it is; if not, let me know what you are looking for… 


//  create the tables
[db executeUpdate:@"CREATE TABLE IF NOT EXISTS CustData ("  //  
one-to-many
 "Customer_ID INTEGER PRIMARY KEY, "  //  maps to OrderInfo.Cust_ID 
(auto-increment)
 "BUS_NAME TEXT, "
 "EMAIL TEXT, "
 "PHONE TEXT, "
 "SHOP_NAME TEXT, "
 "SHOP_ADDR1 TEXT, "
 "SHOP_ADDR2 TEXT, "
 "SHOP_CITY_STATE TEXT, "
 "SHOP_ZIP TEXT, "
 "SHIP_NAME TEXT, "
 "SHIP_ADDR1 TEXT, "
 "SHIP_ADDR2 TEXT, "
 "SHIP_CITY_STATE TEXT, "
 "SHIP_ZIP TEXT, "
 "SALES_NAME TEXT, "
 "NOTES TEXT)"];

if([db hadError])  
NSLog(@"Err %d : %@", [db lastErrorCode], [db lastErrorMessage]);


[db executeUpdate:@"CREATE TABLE IF NOT EXISTS OrderInfo ("  //  
many-to-one
 "Order_ID INT PRIMARY KEY, "  //  'INT' will not autoincrement
 "CUST_ID INT, "  //  maps to CustData.Customer_ID
 "ORDER_NBR TEXT, "  //  maps to OrderData.Order_ID
 "ORDER_DATE TEXT, "
 "ORDER_DEL_INST TEXT, "
 "ORDER_NOTES TEXT, "
 "ORDER_TERMS TEXT, "
 "ORDER_VIA TEXT, "
 "FOREIGN KEY(Cust_ID) REFERENCES CustData(Customer_ID))"];

if([db hadError])  
NSLog(@"Err %d : %@", [db lastErrorCode], [db lastErrorMessage]);

[db executeUpdate:@"CREATE TABLE IF NOT EXISTS OrderData ("  //  
many-to-one
 "Order_ID INT, "  //  maps to OrderInfo.Order_Nbr
 "LINE_ITEM_NBR INTEGER PRIMARY KEY, "  //  auto-increment
 "BOLTS TEXT, "
 "COLOR TEXT, "
 "STYLE TEXT, "
 "PRICE DECIMAL, "  //  really want decimal  ???  TODO
 "ITEM_DEL_INST TEXT, "
 "FOREIGN KEY(Order_ID) REFERENCES OrderInfo(Cust_ID))"];

if([db hadError])  
NSLog(@"Err %d : %@", [db lastErrorCode], [db lastErrorMessage]);

Here are images of the data:






As I indicated, if this is not what you are looking for, let me know… I 
appreciate your help… :D

Regards,
Rolf


On Jun 2, 2012, at 4:26 PM, BareFeetWare wrote:

> Hi Rolf,
> 
> There's nothing inherently different about SQLite execution in Objective-C or 
> on iPad.
> 
> Please post a full (though brief) sample schema, including data, that 
> demonstrates the issue, so we can test.
> 
> Thanks,
> Tom
> 
> Tom Brodhurst-Hill
> BareFeetWare
> 
> --
> iPhone/iPad/iPod and Mac software development, specialising in databases
> develo...@barefeetware.com
> --
> Follow us on Twitter: http://twitter.com/barefeetware/
> Like us on Facebook: http://www.facebook.com/BareFeetWare
> 
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Query runs in SQLite Database Browser but not in iPad app

2012-06-03 Thread Rolf Marsh
databasePath:  dbpath: /Users/rolfmarsh/Library/Application Support/iPhone 
Simulator/5.1/Applications/361A7A76-FEAB-4E67-8F71-C1B291404BA5/Documents/r54.sdb

Regards,
Rolf


On Jun 3, 2012, at 6:07 AM, Black, Michael (IS) wrote:

> Not necessarily...you could have another copy with the same tables unless 
> you're creating this thing from scratch every time.  If you're opening an 
> exisiting database we've seen a number of people with similar problems who 
> found an "oops" and were opening another copy without data or different data.
> 
> 
> 
> Are you using an absolute or relative path name?
> 
> 
> 
> Michael D. Black
> 
> Senior Scientist
> 
> Advanced Analytics Directorate
> 
> Advanced GEOINT Solutions Operating Unit
> 
> Northrop Grumman Information Systems
> 
> 
> From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on 
> behalf of Rolf Marsh [rmma...@fastmail.us]
> Sent: Sunday, June 03, 2012 7:55 AM
> To: General Discussion of SQLite Database
> Subject: EXT :Re: [sqlite] Query runs in SQLite Database Browser but not in 
> iPad app
> 
> Hello Michael… yes, there is only one copy of that particular database with 
> that name… if it were a different d/b, it would error out on column names 
> being nonexistent, right?
> 
> Regards,
> Rolf (SpokaneDude)
> 
> On Jun 3, 2012, at 5:34 AM, Black, Michael (IS) wrote:
> 
>> My first suspiciion would be that you're pointing to 2 different databases.  
>> Are you SURE the DB is the same between the 2 apps?
>> 
>> 
>> 
>> 
>> 
>> Michael D. Black
>> 
>> Senior Scientist
>> 
>> Advanced Analytics Directorate
>> 
>> Advanced GEOINT Solutions Operating Unit
>> 
>> Northrop Grumman Information Systems
>> 
>> 
>> From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on 
>> behalf of Rolf Marsh [rmma...@fastmail.us]
>> Sent: Saturday, June 02, 2012 6:11 PM
>> To: sqlite-users@sqlite.org
>> Subject: EXT :[sqlite] Query runs in SQLite Database Browser but not in iPad 
>> app
>> 
>> I have this select statement which returns the correct results (count = 2) 
>> when run in SQL Database Browser, but not in my Objective-c iPad app (count 
>> = 0).
>> 
>> select count(orderdata.order_id) from orderdata, custdata, orderinfo
>>  where custdata.customer_id = orderinfo.cust_id and
>>  orderdata.order_id = orderinfo.cust_id and
>>  custdata.Bus_name = 'Albertsons'
>> 
>> I have also tried it this way using JOINs, but get the same results…
>> 
>> select count(orderdata.order_id) from orderdata
>>  join custdata on custdata.customer_id = orderinfo.cust_id "
>>  join orderinfo on orderdata.order_id = orderinfo.order_id "
>>  where custdata.Bus_name = 'Albertsons'
>> 
>> Any ideas why?
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> 
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Query runs in SQLite Database Browser but not in iPad app

2012-06-03 Thread Black, Michael (IS)
Not necessarily...you could have another copy with the same tables unless 
you're creating this thing from scratch every time.  If you're opening an 
exisiting database we've seen a number of people with similar problems who 
found an "oops" and were opening another copy without data or different data.



Are you using an absolute or relative path name?



Michael D. Black

Senior Scientist

Advanced Analytics Directorate

Advanced GEOINT Solutions Operating Unit

Northrop Grumman Information Systems


From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on 
behalf of Rolf Marsh [rmma...@fastmail.us]
Sent: Sunday, June 03, 2012 7:55 AM
To: General Discussion of SQLite Database
Subject: EXT :Re: [sqlite] Query runs in SQLite Database Browser but not in 
iPad app

Hello Michael… yes, there is only one copy of that particular database with 
that name… if it were a different d/b, it would error out on column names being 
nonexistent, right?

Regards,
Rolf (SpokaneDude)

On Jun 3, 2012, at 5:34 AM, Black, Michael (IS) wrote:

> My first suspiciion would be that you're pointing to 2 different databases.  
> Are you SURE the DB is the same between the 2 apps?
>
>
>
>
>
> Michael D. Black
>
> Senior Scientist
>
> Advanced Analytics Directorate
>
> Advanced GEOINT Solutions Operating Unit
>
> Northrop Grumman Information Systems
>
> 
> From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on 
> behalf of Rolf Marsh [rmma...@fastmail.us]
> Sent: Saturday, June 02, 2012 6:11 PM
> To: sqlite-users@sqlite.org
> Subject: EXT :[sqlite] Query runs in SQLite Database Browser but not in iPad 
> app
>
> I have this select statement which returns the correct results (count = 2) 
> when run in SQL Database Browser, but not in my Objective-c iPad app (count = 
> 0).
>
> select count(orderdata.order_id) from orderdata, custdata, orderinfo
>   where custdata.customer_id = orderinfo.cust_id and
>   orderdata.order_id = orderinfo.cust_id and
>   custdata.Bus_name = 'Albertsons'
>
> I have also tried it this way using JOINs, but get the same results…
>
> select count(orderdata.order_id) from orderdata
>   join custdata on custdata.customer_id = orderinfo.cust_id "
>   join orderinfo on orderdata.order_id = orderinfo.order_id "
>   where custdata.Bus_name = 'Albertsons'
>
> Any ideas why?
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Query runs in SQLite Database Browser but not in iPad app

2012-06-03 Thread Rolf Marsh
Hello Michael… yes, there is only one copy of that particular database with 
that name… if it were a different d/b, it would error out on column names being 
nonexistent, right?

Regards,
Rolf (SpokaneDude)

On Jun 3, 2012, at 5:34 AM, Black, Michael (IS) wrote:

> My first suspiciion would be that you're pointing to 2 different databases.  
> Are you SURE the DB is the same between the 2 apps?
> 
> 
> 
> 
> 
> Michael D. Black
> 
> Senior Scientist
> 
> Advanced Analytics Directorate
> 
> Advanced GEOINT Solutions Operating Unit
> 
> Northrop Grumman Information Systems
> 
> 
> From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on 
> behalf of Rolf Marsh [rmma...@fastmail.us]
> Sent: Saturday, June 02, 2012 6:11 PM
> To: sqlite-users@sqlite.org
> Subject: EXT :[sqlite] Query runs in SQLite Database Browser but not in iPad 
> app
> 
> I have this select statement which returns the correct results (count = 2) 
> when run in SQL Database Browser, but not in my Objective-c iPad app (count = 
> 0).
> 
> select count(orderdata.order_id) from orderdata, custdata, orderinfo
>   where custdata.customer_id = orderinfo.cust_id and
>   orderdata.order_id = orderinfo.cust_id and
>   custdata.Bus_name = 'Albertsons'
> 
> I have also tried it this way using JOINs, but get the same results…
> 
> select count(orderdata.order_id) from orderdata
>   join custdata on custdata.customer_id = orderinfo.cust_id "
>   join orderinfo on orderdata.order_id = orderinfo.order_id "
>   where custdata.Bus_name = 'Albertsons'
> 
> Any ideas why?
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Query runs in SQLite Database Browser but not in iPad app

2012-06-03 Thread Black, Michael (IS)
My first suspiciion would be that you're pointing to 2 different databases.  
Are you SURE the DB is the same between the 2 apps?





Michael D. Black

Senior Scientist

Advanced Analytics Directorate

Advanced GEOINT Solutions Operating Unit

Northrop Grumman Information Systems


From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on 
behalf of Rolf Marsh [rmma...@fastmail.us]
Sent: Saturday, June 02, 2012 6:11 PM
To: sqlite-users@sqlite.org
Subject: EXT :[sqlite] Query runs in SQLite Database Browser but not in iPad app

I have this select statement which returns the correct results (count = 2) when 
run in SQL Database Browser, but not in my Objective-c iPad app (count = 0).

select count(orderdata.order_id) from orderdata, custdata, orderinfo
   where custdata.customer_id = orderinfo.cust_id and
   orderdata.order_id = orderinfo.cust_id and
   custdata.Bus_name = 'Albertsons'

I have also tried it this way using JOINs, but get the same results…

select count(orderdata.order_id) from orderdata
   join custdata on custdata.customer_id = orderinfo.cust_id "
   join orderinfo on orderdata.order_id = orderinfo.order_id "
   where custdata.Bus_name = 'Albertsons'

Any ideas why?
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Query runs in SQLite Database Browser but not in iPad app

2012-06-02 Thread Simon Slavin

On 3 Jun 2012, at 12:11am, Rolf Marsh  wrote:

> I have this select statement which returns the correct results (count = 2) 
> when run in SQL Database Browser, but not in my Objective-c iPad app (count = 
> 0).
> 
> select count(orderdata.order_id) from orderdata, custdata, orderinfo 
>   where custdata.customer_id = orderinfo.cust_id and
>   orderdata.order_id = orderinfo.cust_id and 
>   custdata.Bus_name = 'Albertsons'

In your iPad app, are you using SQLite C functions to call SQLite, or are you 
using s different API ?

Please execute the following in SQL Database Browser and in your iPad app:

SELECT sqlite_version()

It's okay that the results from the two pieces of software are different, but 
knowing what they are might help us figure out what's going on.

Please also copy the database to your computer, and use the SQLite shell tool 
to execute the same query.  The shell tool is as close to canonical as anything 
is: whatever result that gets is the 'right' result.

Could you possibly reduce your database to just a few records -- just enough 
that it correctly reproduces your problem ?  You can use the SQLite shell tool 
to .dump the database which will let you post a complete copy for our testing.

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Query runs in SQLite Database Browser but not in iPad app

2012-06-02 Thread BareFeetWare
Hi Rolf,

There's nothing inherently different about SQLite execution in Objective-C or 
on iPad.

Please post a full (though brief) sample schema, including data, that 
demonstrates the issue, so we can test.

Thanks,
Tom

Tom Brodhurst-Hill
BareFeetWare

--
iPhone/iPad/iPod and Mac software development, specialising in databases
develo...@barefeetware.com
--
Follow us on Twitter: http://twitter.com/barefeetware/
Like us on Facebook: http://www.facebook.com/BareFeetWare

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users