Skip to content

Instantly share code, notes, and snippets.

@myleftboot
Created September 13, 2012 15:35
Show Gist options
  • Save myleftboot/3715129 to your computer and use it in GitHub Desktop.
Save myleftboot/3715129 to your computer and use it in GitHub Desktop.
Standard emp to dept select
DECLARE
l_row dept%ROWTYPE;
BEGIN
BEGIN
SELECT d.*
INTO l_row
FROM dept d
WHERE dname = 'Accounts';
EXCEPTION
WHEN no_data_found THEN
pk_error.raise_error('department not found');
END;
/* Do something with the value you have retrieved in l_row */
END;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment