Hi, I am after a little help with an insert statement which is giving me an error of 'Subqueries are not allowed in this context. Only scalar expressions are allowed.'
I am not that clued up on scalar expressions and after hours of google search I am none the wiser.
Bascialy I am trying to insert 2 column entries into a table, incomekey and flightkey. However the income key field is defined as a char (8) not null, no auto increment has been built in. so as a work around, I am trying to do a search to find the last used number in the field and add 1 to that value hence the select MAX statement
insert into sbsincome (incomekey,flightkey) values ((select MAX(incomekey)+1 from sbsincome),116040)
If i just run the select statement without the insert it works fine. How can I get the increment value to work on my insert statement?
thank you in advance