Forum

Write a PLSQL Progr...
 
Notifications
Clear all

Write a PLSQL Program to Display Product Information for the Given Product ID


Sam EDU
Posts: 4
Topic starter
(@testuser)
New Member
Joined: 3 months ago

Write a program to display the information of the product for
the given product id?

1 Reply
KV Kumar
Posts: 27
Admin
(@vinodkrsetty)
Member
Joined: 2 years ago

PLSQL procedure to display the product information for the given product id.

	declare
	vprodid   prod_dtls.prod_code%type;
	p_rec  prod_dtls%rowtype;
					
	begin
	vprodid:='&vrodpid';
	select * into p_rec 
	from prod_dtls 
	where prod_code=vprodid;
	dbms_output.put_line
	(' Information of prodid: '||vprodid);
	dbms_output.put_line
	(chr(10)||'prod name:   '||p_rec.prod_name||'	'||
	'Price:   '||p_rec.cost||'	'||
	'Mfg date:  '||p_rec.mfg||'	'||
	'Warrenty:   '||p_rec.warrenty||' '||
	'company code:   '||p_rec.comp_code);
	end;
Reply
Share: