<%@ page language="PL/SQL" errorPage="error.psp"%> <%@ plsql procedure="commit_cust" %> <%@ plsql parameter="cust_id" type="number" %> <%@ plsql parameter="firstname" type="varchar2" %> <%@ plsql parameter="lastname" type="varchar2" %> <%@ plsql parameter="housename" type="varchar2" %> <%@ plsql parameter="address1" type="varchar2" %> <%@ plsql parameter="address2" type="varchar2" %> <%@ plsql parameter="town" type="varchar2" %> <%@ plsql parameter="region" type="varchar2" %> <%@ plsql parameter="zip" type="varchar2" %> <%@ plsql parameter="country_id" type="number" %> <% /**************************************************/ /* The commit_cust psp is used to save customer */ /* details either from the register process or */ /* the amend details process. */ /* */ /* Upon sucessfully saving the details the user */ /* will get a success message with their details */ /* displayed */ /**************************************************/ %> <%! local_cust_id number(5); %> <% if cust_id is null then select seq_cust.nextval into local_cust_id from dual; insert into cust(id, firstname, lastname, housename, address1, address2, town, region, zip, country_id) values (local_cust_id, firstname, lastname, housename, address1, address2, town, region, zip, country_id); commit; else update cust set firstname = firstname, lastname = lastname, housename = housename, address1 = address1, address2 = address2, town = town, region = region, zip = zip, country_id = country_id where id = cust_id; commit; end if; %> The Big Shop The Big Shop <% if cust_id is null then %>

Success

<%= firstname %> <%= lastname %>, your account has been registered

Your Customer Number is: <%= local_cust_id %>

 

Continue

<% else %>

Success

<%= firstname %> <%= lastname %>, your details have been amended

 

Continue

<% end if; %>