I created an insert statement, inside that insert statement I would like to pull data from another column in another table. I wrote the following script and get an error.
I wrote the actual select statement and it worked by itself, here is the script:
SELECT job_id
FROM JOBS
WHERE job_id IN ('AD_CMMS')
The problem occurs when I try to incorporate the insert into statement with the select statement, below is the complete script including the select statement:
INSERT INTO Employees
VALUES (242, 'Anouar', 'seljouki', '[email protected]', '0662777081', date19-May-12,
SELECT job_id FROM JOBS WHERE job_id IN ('AD_CMMS'),
16000, NULL, NULL, NULL);
When I run the script above, I get this error:
Error starting at line : 26 in command -
INSERT INTO Employees VALUES (242,'Anouar','seljouki','[email protected]','0662777081',date19-May-12, SELECT job_id from JOBS where job_id in('AD_CMMS'),16000,NULL,NULL,Null)
Error at Command Line : 28 Column : 1
Error report -
SQL Error: ORA-00936: missing expression
00936. 00000 - "missing expression"