Get A Unique # More Info
Posted in 1996
Topics: Stored Procedures & SPL, Connectivity: ESQL/C, 4GL & Embedded SQL
--=====================_826562608==_ Content-Type: text/plain; charset="us-ascii" --=====================_826562608==_ Content-Type: text/plain; charset="us-ascii" Content-Disposition: attachment; filename="Q2" I have 100+ UNIX users using a Informix application. there are always some users who dont exit the main menu of the informix. some leave their terminals in add or query mode. our repeated requests became futile. since we do daily bcheck on our database. some of the tables are not getting bcheck-ed. Is there any way I can force the users to exit from the menu. users .profile line has exec c4gl_program Informix: SE and c4gl Appreciate your response and help. Basheer Thanks for all of you who replied to Get A Unique #. Here I have given more info for the same problem. call_list table columns: num_800 CHAR (10) UNIQUE NOT NULL, called SMALLINT DUP Index NOT NULL The function Is: -------------------------------------------------------------------------------} FUNCTION get_num ( tbl_name, user_name, phone_col ) DEFINE tbl_name CHAR(15), user_name CHAR(8), phone_col CHAR(15), ref_stmt CHAR(1000), upd_stmt CHAR(1000), phone_num CHAR(10), called_val SMALLINT LET phone_num = NULL LET called_val = 0 DISPLAY "PL Wait Getting Next Number From The Call List: " AT 10,2 ATTRIBUTE(reverse) LET ref_stmt = "SELECT ", phone_col CLIPPED, " FROM ", tbl_name CLIPPED, " WHERE called = 1 " PREPARE s_3 FROM ref_stmt DECLARE ref_curs CURSOR FOR s_3 OPEN ref_curs FETCH ref_curs INTO phone_num IF status = NOTFOUND THEN LET phone_num = NULL ELSE LET upd_stmt = "UPDATE ", tbl_name CLIPPED, " SET ( called, num_user ) = (", called_val USING "&", ",\\"", user_name CLIPPED, "\\")", " WHERE num_800 = ", "\\"",phone_num, "\\"" PREPARE upd_table FROM upd_stmt EXECUTE upd_table FREE upd_table END IF CLOSE ref_curs DISPLAY "" AT 10,2 RETURN phone_num END FUNCTION -------------------------------------------------------------------------------- --=====================_826562608==_--