Home » SQL & PL/SQL » SQL & PL/SQL » pl/sql
pl/sql [message #4440] Tue, 10 December 2002 00:17 Go to next message
Dee
Messages: 11
Registered: September 1999
Junior Member
How do I declare variables named faculty_last_name, faculty_first_name,and faculty_phone. Assign the value ‘COX ‘ to faculty_last_name, ‘KIM’ to faculty_first_name, and ‘7155551234’ to faculty_phone. Write program commands so that the program displays the output exactly as follows;

Kim Cox’s phone number is (715) 555 -1234.
Re: pl/sql [message #4460 is a reply to message #4440] Wed, 11 December 2002 13:37 Go to previous messageGo to next message
Dhiren
Messages: 43
Registered: July 2002
Member
declare
faculty_last_name varchar2(50) := 'Cox';
faculty_first_name varchar2(50) := 'Kim';
faculty_phone varchar2(50) := '715551234';
begin
dbms_output.put_line(' ' || faculty_last_name || ' ' || faculty_first_name || 'phone no is ' ||'(' substr(faculty_phone,1,3) || ' )' || substr(faculty_phone,4,6) || '-' || substr(faculity_phone,7,10));
end;
Guess this should work
Dhiren
Re: pl/sql [message #4487 is a reply to message #4440] Sat, 14 December 2002 04:17 Go to previous message
Barbara Boehmer
Messages: 9094
Registered: November 2002
Location: California, USA
Senior Member
It looks like you and Billy are doing the same homework. Please see my previous response to the same question, by clicking on the link below.

Previous Topic: stored procedure with two input parameters using cursor
Next Topic: SQL Loader reformat non-numeric data to zeroes
Goto Forum:
  


Current Time: Thu May 16 08:02:19 CDT 2024