ORA-01422 for a primary key lookup? Your PL/SQL parameter has the same name as the column
The employee ID is the primary key, so the lookup can only ever find one row. And yet SELECT ... INTO fails with ORA-01422: exact fetch returned more than the requested number of rows. The cause: the parameter has the same name as the column. I reproduced it on Oracle AI Database 26ai Free (23.26.3) and ran the check and the fix. All output below is real SQL*Plus output. Reproduce Three employees, and a function that returns a name for an ID. The parameter is called emp_id, same as the column.…
Publicado no Notice. Categoria: Programação.
Leia também
Mais recentes em Programação
- ProgramaçãoDev.to
The most-starred Codex and Claude plugins for security (Dec 2026)