I want to write a sqlj program that will prompt the user for an old zipcode value and a new zip values and that will change all occurrences of the old zipcode value in the tables of the mail database to the new zipcode value. I have figured out the code for pl/sql, but I don't know how to go about putting it in sqlj. Here is what I have so far:
ACCEPT oldZip PROMPT 'Enter old zipcode: '
ACCEPT newZip PROMPT 'Enter new zipcode: '
declare
aCity ZIPCODES.CITY%TYPE;
begin
select CITY into aCity from ZIPCODES where ZIP = &oldZip;
insert into ZIPCODES values(&newZip, aCity);
update CUSTOMERS set ZIP = &newZip
where ZIP = &oldZip;
update EMPLOYEES set ZIP = &newZip
where ZIP = &oldZip;
delete from ZIPCODES where ZIP = &oldZip;
end;
/