Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> newbie passing parameters from Web page to Stored Procedure
I'm trying to pass "20060821" as myUserID from a web page.
The problem is that it does NOT find any records.
I think it is in my First SQL statement.
What I'm trying eventually to do is to LOCK QTY on hand and subtract
the amount the customer ordered. Example QTY on HAND is 100 and
user orders 5. I want to lock the QTY and replace it with 95 then
unlock it.
I'm using Oracle 9i.
Procedure open_join_cursor1 (myUserID IN VARCHAR2);
END pkgpending;
/
CREATE OR REPLACE PACKAGE BODY pkgpending IS
CURSOR io_cursor IS select P.sessionid,P.itemnumber,M.Ndesclow ,P.person,M.Qty,P.Origqty ,P.Qty AS MMQty FROM pending P, pub M WHERE ( P.Sessionid LIKE 'myUserID' AND P.Itemnumber=M.Itemnumber) for update of M.qty,M.Ndesclow;
Procedure open_join_cursor1 (myUserID IN VARCHAR2) IS
myqty pub.qty%TYPE:=1; newqty pub.qty%TYPE; Itemnumber pub.Itemnumber%TYPE; MMqty pub.qty%TYPE; hiqty pub.qty%TYPE; origqty pub.qty%TYPE:=0; lcItemnum VARCHAR2(100); lc2Out VARCHAR2(100); lnNEMPNO NUMBER; BEGIN OPEN io_cursor; lc2Out :='ABCDE'; LOOP FETCH io_cursor INTO ao_rec; EXIT WHEN io_cursor%NOTFOUND; lnNEMPNO := MMQty; lcItemnum := Itemnumber; hiqty := ao_rec.qty; newqty:=ao_rec.qty-lnNEMPNO; IF newqty>=0 THEN update pub set qty=newqty ,ndesclow=lc2Out where ( itemnumber like 'lcItemnum'); END IF; commit; END LOOP;
![]() |
![]() |