I have the following query which is giving me an ORA-00935 missing expression error, but I can’t figure out what I’ve messed up for the life of me. I’ve tried running just about every part of the query separately, and they all work apart, but together I get only errors. I’ve read that SQL is buggy around missing expression errors, but there has to be some better way to write this query so that it actually works.
Insert into V1144ENGINE.T_EDGES (EDGE_ID, VERSION, NODE1_ID, NODE2_ID, EDGE_TYPE_ID, CREATED_AT, WEIGHT, DELETED_AT)
VALUES(V1144ENGINE.S_PK_EDGES.NEXTVAL,0,
select NODE_ID from V1144ENGINE.T_NODES where NODE_NAME = 'Understand composition of an element',
select NODE_ID from V1144ENGINE.T_NODES where NODE_NAME = 'Understand atoms as smallest units of matter', 3, SYSDATE, 1, NULL);
I ran parts of the query independently, all of which returned the result I wanted. For instance;
select V1144ENGINE.S_PK_EDGES.NEXTVAL from dual;
select NODE_ID from V1144ENGINE.T_NODES where NODE_NAME = 'Understand composition of an element'
I am using Oracle 11g if that makes a difference.
I guess that you need brackets around the subqueries.