HELPLIB.HLB  —  RDML72  Statements  STORE Statement, Examples  C Example
    DATABASE PERS = FILENAME "PERSONNEL";

    extern void read_string();
    static DEFINE_TYPE coll_code SAME AS COLLEGES.COLLEGE_CODE;
    static DEFINE_TYPE coll_name SAME AS COLLEGES.COLLEGE_NAME;
    static DEFINE_TYPE coll_city SAME AS COLLEGES.CITY;
    static DEFINE_TYPE coll_state SAME AS COLLEGES.STATE;
    static DEFINE_TYPE post_code SAME AS COLLEGES.POSTAL_CODE;
    static DEFINE_TYPE my_db_key SAME AS COLLEGES.RDB$DB_KEY;

    main()
    {
    read_string ("Enter College Code: ", coll_code, sizeof(coll_code));
    read_string ("Enter College Name: ", coll_name, sizeof(coll_name));
    read_string ("Enter College City: ", coll_city, sizeof(coll_city));
    read_string ("Enter College State: ",coll_state, sizeof(coll_state));
    read_string ("Enter Postal Code: ", post_code, sizeof(post_code));

    READY PERS;
    START_TRANSACTION READ_WRITE;

    STORE C IN COLLEGES USING
       strcpy (C.COLLEGE_CODE, coll_code);
       strcpy (C.COLLEGE_NAME, coll_name);
       strcpy (C.CITY, coll_city);
       strcpy (C.STATE, coll_state);
       strcpy (C.POSTAL_CODE, post_code);
       GET
          my_db_key = C.RDB$DB_KEY;
       END_GET;
    END_STORE;

    COMMIT;
    FINISH;
    }
Close Help