Accept plateno PROMPT 'Please enter a plate number to see its problems: ';

CREATE GLOBAL TEMPORARY TABLE TempTable 
(
	ID NUMBER(9),
	PlateNo VARCHAR2(10),
	Description CLOB 
);

INSERT INTO TempTable
SELECT RPAD(Vehicle.ID, 9) As "VehicleID",
RPAD(CarPlateNo, 10) As "PlateNo",
TO_LOB(Description) As "Problem"
FROM Vehicle, V_m, Mech_problems
WHERE Vehicle.ID = VehID
      AND MecID =  Mech_problems.ID
      AND CarPlateNo = '&plateno';

SELECT RPAD(ID, 9) As "VehicleID", PlateNo As "PlateNo", 
RPAD(TO_CHAR(Description), 30) As "Problme"
FROM TempTable;

DROP TABLE TempTable;
