Status/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Lincoln Milner / Lincoln Milner (Lincoln Milner)
Created: 09/26/2012
Components: Database
Versions: 9.0.1
Failure Type: Non Functioning
Found In Build/Fixed In Build: 9.0.1 /
Priority/Frequency: Critical / All users will encounter
Locale/System: English / Windows 7
Vote Count: 0
Problem Description:
When trying to use the RETURNING clause off an INSERT statement the above is returned.
Steps to Reproduce:
CREATE SEQUENCE ID_SEQ
MAXVALUE 99999999999
MINVALUE 1
NOCYCLE
CACHE 20
NOORDER;
CREATE TABLE USERS
(
ID NUMBER(11) NOT NULL,
NAME VARCHAR2(100 BYTE),
EMAIL VARCHAR2(255 BYTE),
PASSWORD
CREATE UNIQUE INDEX USERS_PK ON USERS
(ID);
CREATE OR REPLACE TRIGGER users_bir_trg
BEFORE INSERT ON USERS
FOR EACH ROW
DECLARE
l_max_id PLS_INTEGER;
l_cur_seq PLS_INTEGER;
BEGIN
IF :new.id IS NULL
THEN
-- No ID sent in from the app, generate one
SELECT id_seq.NEXTVAL INTO :new.id
FROM dual;
ELSE
-- ID passed in from the app, use it and reset the sequence
SELECT GREATEST(NVL(MAX(id), 0), :new.id) INTO l_max_id
FROM users;
SELECT id_seq.NEXTVAL INTO l_cur_seq
FROM dual;
WHILE l_cur_seq < l_max_id
LOOP
SELECT id_seq.NEXTVAL INTO l_cur_seq
FROM dual;
END LOOP;
END IF;
END;
/
ALTER TABLE USERS ADD (
CONSTRAINT USERS_PK
PRIMARY KEY
(ID)
USING INDEX USERS_PK
ENABLE VALIDATE);
<cfset test = ""/>
<cfquery name="qtest" datasource="db">
INSERT INTO users(name, email, password)
VALUES('johndoe', 'me@privacy.net', 'test3434')
RETURNING id INTO <cfqueryparam cfsqltype="cf_sql_varchar" value="#test#"/>
</cfquery>
Actual Result:
ORA-00439: feature not enabled: RETURNING clause from this client type
Expected Result:
According to DataDirect's information on their JDBC drivers, the RETURNING clause has been supported since v3.7. CF 9 appears to have v4.0sp1 installed so it should still be supported.
Any Workarounds:
None that I'm aware of short of removing the trigger and doing the "auto-increment" functionality either in a stored procedure in the DB or using multiple queries in the app.
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3337409
External Customer Info:
External Company:
External Customer Name: Milner
External Customer Email:
External Test Config: My Hardware and Environment details:
Oracle 10gR2 database
Adobe CF 9.0.2 on Windows 7 workstation
IIS web server connected to CF 9 instance
Attachments:
Comments: