tags:

views:

37

answers:

0

hi all,

i use sqlite as db for my iphone project. i wanted to execute below 4 sql statements at 1 shot using a single prepare statement (like a batch of multiple sql queries) but it seems only the first statement in the batch works

what is the best way for me to sort this out (except for using multiple statements within a transaction)

below are my sql statements:

CREATE TEMP TABLE "ProductTemp" ("ProductCode" TEXT NOT NULL, PRIMARY KEY ("ProductCode"));

INSERT INTO ProductTemp SELECT PC.ProductCode FROM ProductCategory AS PC WHERE PC.CategoryCode = '157669372' ORDER BY PC.SortKey LIMIT -1,-1;

SELECT PT.ProductCode FROM ProductTemp AS PT;

DROP TABLE ProductTemp;