HELPLIB.HLB  —  RDML72  Statements  ROLLBACK  Examples  C Example
    #include <stdio.h>
    DATABASE PERS = FILENAME "PERSONNEL";

    extern void pad_string();

    main()
    {
    int SAL_INCREASE = 0;

    READY PERS;
    START_TRANSACTION (TRANSACTION_HANDLE SAL_INCREASE) READ_WRITE;

    STORE (TRANSACTION_HANDLE SAL_INCREASE) J IN JOBS USING
       pad_string ("TYPS", J.JOB_CODE, sizeof(J.JOB_CODE));
       pad_string ("1", J.WAGE_CLASS, sizeof(J.WAGE_CLASS));
       pad_string ("TYPIST", J.JOB_TITLE, sizeof(J.JOB_TITLE));
       J.MINIMUM_SALARY = 10000;
       J.MAXIMUM_SALARY = 17000;
    END_STORE;

    ROLLBACK (TRANSACTION_HANDLE SAL_INCREASE);
    FINISH;
    }
Close Help