Please help me correct the following query:
SQL = \"insert into tblContract (Empid, Start1, Finish1, Store1, \" & _
\"Start2, Finish2, St
If anything is going to work, you will have to embed the sub-query inside an extra layer of parentheses:
INSERT INTO SomeTable(Col1, Col2, Col3)
VALUES(val1, (SELECT MAX(testid) FROM tbltesting), val3);
Be aware that you are vulnerable to SQL Injection attacks.
Using IBM Informix Dynamic Server 11.50 in a database with a 'table of elements', the following works:
create temp table t(i integer, j integer, k integer);
insert into t values(1, (select max(atomic_number) from elements), 2);
select * from t;
1 118 2
This is correct given the current data in the table of elements.