sql command not properly ended for select statement - oracle : I have a pl/sql function and in that i have the following piece of code:

    execute immediate 'select ' || schemaname || '.' || value1 || '_seq.nextval from dual into cnpParmId';

for this line, am getting an error :
SQL Error: ORA-00933: SQL command not properly ended

In the above code am getting the value1 from the result of a select query. schemaname is the input of the function and cnpParmId is the return value of the function.

I tried different ways to solve this but still getting the error.