The script below returns an error when running it in the Toad editor:
DROP TABLE json_documents PURGE;
CREATE TABLE json_documents (id NUMBER, data VARCHAR2(4000), CONSTRAINT json_documents_is_json CHECK (data IS JSON));
INSERT INTO json_documents (id, data) SELECT rownum, JSON_OBJECT( 'EMPNO' : empno, 'ENAME' : ename, 'JOB' : job ) FROM emp;
The error is
>> INSERT INTO json_documents (id, data)
SELECT rownum, JSON_OBJECT( 'EMPNO' : empno, 'ENAME' : ename, 'JOB' : job ) FROM emp
Error at line 10
ORA-01006: bind variable does not exist
WORKAROUND
Use
INSERT INTO json_documents (id, data) SELECT rownum, JSON_OBJECT( 'EMPNO' value EMPNO, 'ENAME' value ename, 'JOB' value job ) FROM EMP;
instead of
INSERT INTO json_documents (id, data) SELECT rownum, JSON_OBJECT( 'EMPNO' : empno, 'ENAME' : ename, 'JOB' : job ) FROM emp;
STATUS
Waiting for fix in a future release of Toad for Oracle
© 2025 Quest Software Inc. ALL RIGHTS RESERVED. Terms of Use Privacy Cookie Preference Center