In: Computer Science
Create Procedure in (PL/SQL)
called Make_Account (v_first, v_last, v_email, v_errormsg)
Add a new user to the Account table. If the new user cannot be added, return a error message.
Table Account (this is the table I need to add data using PROCEDURE)
Account_no (PK)
Email (VARCHAR2)
first (VARCHAR2)
last (VARCHAR2)
Table created usiing identity as your question specified to insert except account number as Make_Account (v_first, v_last, v_email, v_errormsg)
Note : Stored proecduere created. But your question says to insert v_errormsg in call (Make_Account (v_first, v_last, v_email, v_errormsg)) I can not understand the logic behind it passing v_errormsg . how we know the error before insert as user who inserts value . Anyway i did as you reqqueted but i display the oracle's SQLERRM when error occurs.
successful insert showing procedure code ouptut
Failed insert ouptut as i mssed one parameter to demonstrate how error handling works
I used value_error for example . You can use others in exception