Hi,
I've run into a weird situation where SQLite seems to not like in-line comments
depending on where they are placed. I'm using the following:
DOS CLP 3.3.6
Best to show via an example:
If I have the following DDL/DML:
--------------------------------------------------
BEGIN TRANSACTION; -- Begin transaction including table creation and data
population.
CREATE TABLE General_Postal_Reference (
PK INTEGER PRIMARY KEY, -- Primary Key
Postal_Code TEXT NOT NULL,
State TEXT NOT NULL,
City TEXT NOT NULL,
County TEXT NOT NULL,
Sequence_Number INTEGER NOT NULL, -- 1=primary city for that zip
(based on population. counts), 2 is secondary, etc.
USPS_Code TEXT NOT NULL, -- P=primary city, A=acceptable
city, N=not acceptable
Latitude REAL NOT NULL,
Longitude REAL NOT NULL,
USPS_Type TEXT NOT NULL, -- g=general delivery (could be
PO Box), b=business/government private zip code,
-- e=PO Box only, m=military only
Last_Modified_Time INTEGER NOT NULL -- Seconds since Unix epoch,
let's us know how old each record is.
);
INSERT INTO General_Postal_Reference (Postal_Code, State, City, County,
Sequence_Number, USPS_Code, Latitude, Longitude, USPS_Type, Last_Modified_Time)
VALUES ("00501", "NY", "Holtsville", "Suffolk", 1, "P", 40.81518,
-73.0455, "b", 1153966130);
COMMIT;
------------------------------------------------------
Everything works fine. But, if I have a comment immediately after the COMMIT
statement:
COMMIT; -- End transaction.
... it doesn't:
This will give the following in the DOS CLP output:
Incomplete SQL: COMMIT; -- End transaction.
Not sure if this is a bug, but thought I should point it out.
Thanks,
- Jeff