home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / VSCPPv8.zip / VACPP / IBMCPP / samples / DATABASE / STOCK / CSETPP / RECEIVEV.BND (.txt) < prev    next >
DB2 Bind  |  1995-06-09  |  3KB  |  48 lines

  1. RECEIVEVuAiJLJGLUSERID  0
  2. INCLUDE SQLCA
  3. INCLUDE SQLDA
  4. BEGIN DECLARE SECTION
  5. END DECLARE SECTION
  6. WHENEVER NOT FOUND GO TO error
  7. WHENEVER SQLERROR GO TO error
  8. INSERT INTO USERID.RECEIVEDORDER (POSTEDFLAG, PRODNUMBER, RECEIVEDDATE, RECEIVEDNUMBER, RECEIVEDQUANTITY, TOTALCOST)             VALUES ( :POSTEDFLAG:POSTEDFLAGIND , :PRODNUMBER:PRODNUMBERIND , :RECEIVEDDATE:RECEIVEDDATEIND , :RECEIVEDNUMBER, :RECEIVEDQUANTITY:RECEIVEDQUANTITYIND , :TOTALCOST:TOTALCOSTIND )
  9. WHENEVER SQLERROR CONTINUE
  10. WHENEVER NOT FOUND GO TO error
  11. WHENEVER SQLERROR GO TO error
  12. UPDATE USERID.RECEIVEDORDER SET              POSTEDFLAG = :POSTEDFLAG:POSTEDFLAGIND,             PRODNUMBER = :PRODNUMBER:PRODNUMBERIND,             RECEIVEDDATE = :RECEIVEDDATE:RECEIVEDDATEIND,             RECEIVEDQUANTITY = :RECEIVEDQUANTITY:RECEIVEDQUANTITYIND,             TOTALCOST = :TOTALCOST:TOTALCOSTIND             WHERE RECEIVEDNUMBER = :RECEIVEDNUMBER
  13. WHENEVER SQLERROR CONTINUE
  14. WHENEVER NOT FOUND GO TO error
  15. WHENEVER SQLERROR GO TO error
  16. DELETE FROM USERID.RECEIVEDORDER              WHERE RECEIVEDNUMBER = :RECEIVEDNUMBER
  17. WHENEVER SQLERROR CONTINUE
  18. WHENEVER NOT FOUND GO TO error
  19. WHENEVER SQLERROR GO TO error
  20. SELECT POSTEDFLAG, PRODNUMBER, RECEIVEDDATE, RECEIVEDNUMBER, RECEIVEDQUANTITY, TOTALCOST             INTO :POSTEDFLAG:POSTEDFLAGIND , :PRODNUMBER:PRODNUMBERIND , :RECEIVEDDATE:RECEIVEDDATEIND , :RECEIVEDNUMBER, :RECEIVEDQUANTITY:RECEIVEDQUANTITYIND , :TOTALCOST:TOTALCOSTIND              FROM USERID.RECEIVEDORDER             WHERE RECEIVEDNUMBER = :RECEIVEDNUMBER
  21. WHENEVER SQLERROR CONTINUE
  22. WHENEVER NOT FOUND GO TO notfound
  23. WHENEVER SQLERROR GO TO error
  24. DECLARE c1 CURSOR FOR           SELECT POSTEDFLAG, PRODNUMBER, RECEIVEDDATE, RECEIVEDNUMBER, RECEIVEDQUANTITY, TOTALCOST           FROM USERID.RECEIVEDORDER
  25. OPEN c1
  26. FETCH c1 INTO :POSTEDFLAG:POSTEDFLAGIND , :PRODNUMBER:PRODNUMBERIND , :RECEIVEDDATE:RECEIVEDDATEIND , :RECEIVEDNUMBER, :RECEIVEDQUANTITY:RECEIVEDQUANTITYIND , :TOTALCOST:TOTALCOSTIND 
  27. CLOSE c1
  28. WHENEVER SQLERROR CONTINUE
  29. WHENEVER NOT FOUND GO TO notfound
  30. WHENEVER SQLERROR GO TO error
  31. PREPARE s1 FROM :_buf
  32. DECLARE c2 CURSOR FOR s1
  33. OPEN c2
  34. FETCH c2 INTO :POSTEDFLAG:POSTEDFLAGIND , :PRODNUMBER:PRODNUMBERIND , :RECEIVEDDATE:RECEIVEDDATEIND , :RECEIVEDNUMBER, :RECEIVEDQUANTITY:RECEIVEDQUANTITYIND , :TOTALCOST:TOTALCOSTIND 
  35. CLOSE c2
  36. WHENEVER SQLERROR CONTINUE
  37. POSTEDFLAG
  38. POSTEDFLAGIND
  39. PRODNUMBER
  40. PRODNUMBERIND
  41. RECEIVEDDATE
  42. RECEIVEDDATEIND
  43. RECEIVEDNUMBER
  44. RECEIVEDQUANTITY
  45. RECEIVEDQUANTITYIND
  46. TOTALCOST
  47. TOTALCOSTIND
  48.