home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
VSCPPv8.zip
/
VACPP
/
IBMCPP
/
samples
/
DATABASE
/
STOCK
/
CSETPP
/
PRCLISTV.BND
(
.txt
)
< prev
next >
Wrap
DB2 Bind
|
1995-06-09
|
2KB
|
42 lines
PRCLISTVcBKJLJGLUSERID 0
INCLUDE SQLCA
INCLUDE SQLDA
BEGIN DECLARE SECTION
END DECLARE SECTION
WHENEVER NOT FOUND GO TO error
WHENEVER SQLERROR GO TO error
INSERT INTO USERID.INVENTORY (LISTINGPRICE, PRODDESCRIPTION, PRODNUMBER) VALUES ( :LISTINGPRICE:LISTINGPRICEIND , :PRODDESCRIPTION:PRODDESCRIPTIONIND , :PRODNUMBER)
WHENEVER SQLERROR CONTINUE
WHENEVER NOT FOUND GO TO error
WHENEVER SQLERROR GO TO error
UPDATE USERID.INVENTORY SET LISTINGPRICE = :LISTINGPRICE:LISTINGPRICEIND, PRODDESCRIPTION = :PRODDESCRIPTION:PRODDESCRIPTIONIND WHERE PRODNUMBER = :PRODNUMBER
WHENEVER SQLERROR CONTINUE
WHENEVER NOT FOUND GO TO error
WHENEVER SQLERROR GO TO error
DELETE FROM USERID.INVENTORY WHERE PRODNUMBER = :PRODNUMBER
WHENEVER SQLERROR CONTINUE
WHENEVER NOT FOUND GO TO error
WHENEVER SQLERROR GO TO error
SELECT LISTINGPRICE, PRODDESCRIPTION, PRODNUMBER INTO :LISTINGPRICE:LISTINGPRICEIND , :PRODDESCRIPTION:PRODDESCRIPTIONIND , :PRODNUMBER FROM USERID.INVENTORY WHERE PRODNUMBER = :PRODNUMBER
WHENEVER SQLERROR CONTINUE
WHENEVER NOT FOUND GO TO notfound
WHENEVER SQLERROR GO TO error
DECLARE c1 CURSOR FOR SELECT LISTINGPRICE, PRODDESCRIPTION, PRODNUMBER FROM USERID.INVENTORY
OPEN c1
FETCH c1 INTO :LISTINGPRICE:LISTINGPRICEIND , :PRODDESCRIPTION:PRODDESCRIPTIONIND , :PRODNUMBER
CLOSE c1
WHENEVER SQLERROR CONTINUE
WHENEVER NOT FOUND GO TO notfound
WHENEVER SQLERROR GO TO error
PREPARE s1 FROM :_buf
DECLARE c2 CURSOR FOR s1
OPEN c2
FETCH c2 INTO :LISTINGPRICE:LISTINGPRICEIND , :PRODDESCRIPTION:PRODDESCRIPTIONIND , :PRODNUMBER
CLOSE c2
WHENEVER SQLERROR CONTINUE
LISTINGPRICE
LISTINGPRICEIND
PRODDESCRIPTION
PRODDESCRIPTIONIND
PRODNUMBER