views:

24

answers:

0

The sql statement is:

SELECT 'customer_address'._id, 'address'.Descriptor AS Name FROM 'customer_address' INNER JOIN 'address' ON 'customer_address'.AddressID='address'._id WHERE 'customer_address'.CustomerID=4 ORDER BY Name

When I examine the db using the adb sqlite shell, it reports that the schema for the address table is:

CREATE TABLE address (
  _id INTEGER PRIMARY KEY AUTOINCREMENT,
  EntityID INTEGER NOT NULL,
  TypeID INTEGER NOT NULL,
  Address VARCHAR(256) DEFAULT NULL,
  City VARCHAR(32) NOT NULL,
  Region VARCHAR(24) DEFAULT NULL,
  PostalCode VARCHAR(12) DEFAULT NULL,
  Country VARCHAR(30) NOT NULL,
  Descriptor VARCHAR(512) NOT NULL,
  Memo VARCHAR(1024) DEFAULT NULL,
  `Profile` VARCHAR(64) DEFAULT NULL,
  TofP DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP)

and for the customer_address view is:

CREATE VIEW customer_address AS select address._id AS _id,corporation.CustomerID AS CustomerID,address._id AS AddressID from (corporation join address on((corporation.EntityID = address.EntityID))) where (corporation.CustomerID is not null)

Can anyone see the error?

thnx