Hi

I have written a procedure in PL/SQL to get values from user and then I am updating the same in a table. This worked fine 1st time but its just not showing the new values inserted by the user. The field which should be updated with the user value is still showing blank. I have pasted the PL/SQL code below.

CREATE OR REPLACE PROCEDURE input_clpi1599 AS

A number := #

BEGIN

UPDATE CLPI_1599_FINAL_KS_3 set renewal_lite = NULL;

UPDATE CLPI_1599_FINAL_KS_3 b
set renewal_lite =
(SELECT A FROM CLPI_1599_FINAL_KS_3 c
WHERE b.pol_no = c.pol_no
)
WHERE pol_no = &polno
;

COMMIT;

END;
/

I am passing value for A as 25 and for &pol_no its 2560001. For the given policy the record in renewal_lite should be updated as 25 but it shows blank. Please can anyone help me out in this?

Thanks
Yash
COMMIT;

First off, asking Daniweb to answer your homework questions is bad form. You're supposed to be learning in class, not cheating by having other people answer your exam questions.

But as its been two months, I assume your final is over in CLPI 1599, and I don't see any harm in trying to answer the question.

First, when your stored procedure begins, it sets CLPI_1599_FINAL_KS_3.renewal_lite to NULL for all records.

Is that what you wanted to do?

The second UPDATE statement is even more confusing. It would help to know what the structure of CLPI_1599_FINAL_KS_3 was, because I don't think you're using A in the way you think you're using it as.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.