demasi@paisano.UUCP (Michael C. De Masi) (08/05/87)
Hello again! To get away from Informix for a minute (Lord, would I love to get away from Informix for a minute) I was bascially wondering if this group is as empty as it seems to be? Although I seem to be getting a full feed from most of the net.groups, the most I ever seem to get is an article or two per day from this one. I heard a while ago that one of the most attractive (from a marketing viewpoint, anyway) sales points of the kind of small to medium sized systems that occupy the bulk of the hosts on this net is the ability to run small database applications, so I would assume that this group should at least be moderately popular. So I'm just wondering if there's a problem with my feed. If you see a great deal more activity in this group than I'm indicating, please give me a yell so that I can look into it. Now, in answer to a posting a little while ago regarding a question I had posted regarding 'begin/commit/rollback work' structures in Informix esql/c, the poster (is that a word?) seemed to be wondering if I had the correct notion of the use of these structures. He apparently thought that I was using them in the form: { $ begin work; $ some sql statement; if( bad return code from above statement ) $rollback work; else $commit work; $ begin work; $ next sql statement; if( bad return code from next statement ) $rollback work; else $commit work; .... and so on, ad nauseum } in reality, the structure was more like: { flag rcode; $ begin work; $ first sql statement; rcode = return from above statement; if( rcode acceptable) { $next sql statement; rcode = return from above statement; if( rcode acceptable ) { $next sql statement; rcode = return from above statement; if( rcode acceptable ) { ...... } } } if ( rcode acceptable ) commit work; else { rollback work; notify user of problem, do other cleanup, etc; } } This, I believe, is in keeping with the concept around which these statements were created. Since all of the statements in this structure together comprise one 'transaction' from the user standpoint, they must either all execute without error, or be rolled back together with the database left in its origional state. (Whether or not you like the flag itself, or the way the structure is built, of course, is a matter of programming style. I had a prof in college who would fail you for goto's.) Anyway, I hope I got my point across & until next time, Keep posting! -- Michael C. De Masi - AT&T Communications (For whom I work and not speak) 3702 Pender Drive, Fairfax, Virginia 22030 Phone: 703-246-9555 UUCP: seismo!decuac!grebyn!paisano!demasi "Life. Don't tell me about life." - Marvin, the paranoid android