Error: "Auto-generated keys were not requested, or the SQL was not a simple INSERT statement" (ColdFusion)
Issue
When you run a SQL query in Adobe ColdFusion, you may receive this error message:
- 'Auto-generated keys were not requested, or the SQL was not a simple INSERT statement.'
This error may persist even if you have already installed the patch from "Patch Available to Disable Auto-generatedkeys in Datasources (ColdFusion 8.0, 8.0.1)" (TechNote kb403432).
Reason
If you have installed the patch from "Patch Available to Disable Auto-generatedkeys in Datasources (ColdFusion 8.0, 8.0.1)" (TechNotekb403432) and this error persists, it is almost certain that your SQL is an INSERT, and that it is not a simple INSERT as is required.
A simple SQL INSERT statement follows this syntax:
INSERT INTO table
(column-1, column-2, ... column-n)
VALUES
(value-1, value-2, ... value-n);
Solution
To resolve this issue. you may have to change the way that you are interacting with your database.
For example, if your query originally included a nested SELECT statement to return the results of the query, you will need to separate this into two database operations.
Additional Information
Patch Available to Disable Auto-generatedkeys in Datasources (ColdFusion 8.0, 8.0.1) (TechNotekb403432)
This content requires Flash
To view this content, JavaScript must be enabled, and you need the latest version of the Adobe Flash Player.
Download the free Flash Player now!
