I created a very simple table:
CREATE TABLE TMP ("ID" VARCHAR2(20 BYTE));
Then tried to do this:
DECLARE whatever varchar2(20) := :bananas; BEGIN MERGE INTO tmp t USING (SELECT whatever AS this_id FROM DUAL) d ON (t.id = d.this_id) WHEN NOT MATCHED THEN INSERT (id) VALUES (d.this_id); END;
And then type binds

And get this error:
Error starting at line : 1 in command - DECLARE whatever varchar2(20) := :bananas; BEGIN MERGE INTO tmp2 t USING (SELECT whatever AS this_id FROM DUAL) d ON (t.id = d.this_id) WHEN NOT MATCHED THEN INSERT (id) VALUES (d.this_id); END; Error report - Missing defines
I could not figure out what he wants. If I replace ": bananas" with the value "a", this works, but not when I use the variable and bind its value. Does anyone know what happened to my request? Thanks.
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production PL/SQL Release 11.2.0.4.0 - Production "CORE 11.2.0.4.0 Production" TNS for IBM/AIX RISC System/6000: Version 11.2.0.4.0 - Production NLSRTL Version 11.2.0.4.0 - Production
edit: I just noticed that the error does not interfere with the proper data merging ... The error is still related to the fact that
sql oracle plsql oracle-sqldeveloper
this-mathieu
source share