G'Day!
On Thu, 14 Sep 2006, at 6:22:41, Charles Calvert wrote:
On 9/12/2006 6:46 PM, Ben Blake wrote:
I am having trouble with inserting rows using INSERT INTO, all I ever
get is 5 rows added!
I have created my tables and indexes (REAL SQL Database):
db.SQLExecute("create table Summary(Grp string, Cat string, Year
Integer, Month Integer, Tot Double)")
db.SQLExecute("create index Summary_idx on Summary(Grp, Cat, Year)")
db.SQLExecute("create table Category_List(Grp string, Type string,
Cat
string, SortPriority Integer)")
Now I need to initialise the summary with zeros for each of the
Categories and Groups (makes it easier so my updating code doesn't
have
to check if the item exists or not). Using the following code
(Category_List table contains 50-60 rows) only ever insert 5 rows!
db.SQLExecute("INSERT INTO Summary select Grp, Cat, 8, 1, 0 from
Category_List")
Try:
INSERT INTO Summary (Grp, Cat, Year, Month, Tot)
SELECT Grp, Cat, 8, 1, 0 FROM Category_List
Also, what happens if you run just the selection:
"SELECT Grp, Cat, 8, 1, 0 FROM Category_List"
How many rows are returned?
I tried this and I get the same result as before, 5 rows. As for
running the select query I get 84 rows.
cya
Ben
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>