Subject | INSERT INTO...SELECT...ORDER BY |
---|---|
Author | uwekeim |
Post date | 2004-01-22T08:17:12Z |
Hello,
I want to insert some ordered records into an empty table, but
Firebird seems not to support "ORDER BY" in an insert-clause (why
not???).
Is there any workaround?
Example:
INSERT INTO MANUFACTURER (manufacturer.name, manufacturer.id)
SELECT iSOURCE.MANUFACTURER_NAME, iSOURCE.MANUFACTURER_ID
FROM iSOURCE
GROUP BY iSOURCE.MANUFACTURER_NAME, iSOURCE.MANUFACTURER_ID
ORDER BY iSOURCE.MANUFACTURER_NAME
Invalid token.
Dynamic SQL Error.
SQL error code = -104.
Token unknown - line 5, char 1.
ORDER.
I tried this on Firebird 1.0, Dialect 3. The problem is caused by
the "ORDER BY"-clause, the query works without this line.
Thanks in advance
Uwe Keim
I want to insert some ordered records into an empty table, but
Firebird seems not to support "ORDER BY" in an insert-clause (why
not???).
Is there any workaround?
Example:
INSERT INTO MANUFACTURER (manufacturer.name, manufacturer.id)
SELECT iSOURCE.MANUFACTURER_NAME, iSOURCE.MANUFACTURER_ID
FROM iSOURCE
GROUP BY iSOURCE.MANUFACTURER_NAME, iSOURCE.MANUFACTURER_ID
ORDER BY iSOURCE.MANUFACTURER_NAME
Invalid token.
Dynamic SQL Error.
SQL error code = -104.
Token unknown - line 5, char 1.
ORDER.
I tried this on Firebird 1.0, Dialect 3. The problem is caused by
the "ORDER BY"-clause, the query works without this line.
Thanks in advance
Uwe Keim