Re: A programming problem
Posted in 1991
Quoting John Baker Depot Sys Mgt Br... > > I would like to know if any of you have coded a 4GL program that operates > like the SQL product's PERFORM menu, letting your users update records in the > current list and add new records to the current list. The 4GL menu would look > like this: Sample_menu: Query Next Previous Add Update Remove > > Are you new to the list (no flame intended)? If you are, that would explain how you missed my recent posting, read on... << Specifications for a 4GL based Perform screen deleted >> > *** QUESTIONS *** > What's causing the 'Open' cursor or the 'Fetch' statement to run so slowly? > Should I code an UPDATE STATISTICS statement before reopening the cursor? > What exactly does the Update Statistics statement do? Should I use an index > on the select statement that I prepare from the CONSTRUCT statement? > Well from what I've experienced, scrolling cursors are slow as h**l. Doing an update statistics would be like pouring gas on the fire. Your best bet is to call the engine only when necessary and only ask for what you need at that moment. Don't make the engine do any weird stuff like math, it'll slow down your queries. > Have you coded a program that gives your users PERFORM-like capabilities, > including the ability to 'Add' records to the current list? > Yes, I have created a program that meets your requirements to the letter. I even went as far as to take that code and make a program generator for it. Enclosed is db4glgen-2.3; run it, do a "make", and then run the 4GL program that was just created and let me know what you think. Have fun... BTW, if you don't have uudecode and/or compress, you can get a larger, un-compressed version from "das13". You can reach "das13" through the archive-server or ANONUUCP (ANONFTP is out of the question on an AT&T 3B1), the info you need follows... ANONUUCP: Create one or more of the following entries in your Systems (or L.sys) file: das13 Any;1 FAST 9600 1-2154614007 "" \\r\\c in:-\\r-in: anonuucp das13 Any;1 ACU 2400 1-2154614007 "" \\r\\d\\r\\c in:-\\r-in: anonuucp das13 Any;1 ACU 1200 1-2154614007 "" \\r\\d\\r\\d\\r\\c in:-\\r-in: anonuucp The first file you'll need is: das13!~/ls-lR.Z BTW, this is a call to Philadelphia, PA USA ARCHIVE-SERVER: To access the archive-server send mail to: archive-server@das13.snide.com In the Subject: put the word "help" (w/o the quotes). Leave the rest of your mail blank since it'll be ignored anyway. You will receive mail back explaining in detail what the archive-server is and how to use it. Any problems or questions should be mailed to: dave@das13.snide.com Here --------- Snip Here --------- Snip Here --------- Snip Here --------- Snip #!/bin/sh # This is a shell archive (produced by shar 3.49) # To extract the files from this archive, save it to a file, remove # everything above the "!/bin/sh" line above, and type "sh file_name". # # made 10/17/1991 00:38 UTC by dave@das13.snide.com # Source directory /u/dave/tmp # # existing files will NOT be overwritten unless -c is specified # # This shar contains: # length mode name # ------ ---------- ------------------------------------------ # 2561 -rw-rw-r-- README # 48848 -rwxrwxr-x db4glgen # # ============= README ============== if test -f 'README' -a X"$1" != X"-c"; then echo 'x - skipping README (File already exists)' else echo 'x - extracting README (Compressed)' sed 's/^X//' << 'SHAR_EOF' | uudecode && begin 600 _shar_cmp_.tmp M'YV,"@*"&`B"B!`:1Y@<*>($18P4!"-*G$BQHL6*!A$J9.@P14`%$9T$:5)$ M00(R8FB<87.FC!L0+4"T=%-&3A@Z9>:`4,D&Q)@W9,J`,/-&#H@P(,2$F9-F M#`@1<>K4S--"#-4R>,*T@<.FC`@0<\\;(*>/R8\\0I69P\\@3(ER120%%'RG`F3 M#`B4;K0*;4$'!)TP8O*V$;JE*@@C28HP(1(#IIC#B1?+Z`*BL!G*<.2\\.2.X MC%F"1(I,&2(E"10J29XX,2E"[LJ97V?6O)D31!(W1.6T28.GA4:?0,NP`#$$ M>-#A8=S81=HDS)HR9M)T-4GG3=(ZTI<G7=H41-2I5:]FW=H5K%BR;EP,I()F MK]TW<.BD>?,RC<XZ<\\J0H6Y]#IPR8Z1A1AY'W7438$N5H1X([.W5%WSRT0>" M?2#@IY]?_?T7X(!^M4<=8.7=@493:'0H5%ACN03"'=+U])T<!(9Q1AAIN#$' M'0MFMEEG$^I$1WL@=&;2&V:8.)1T0OUXTXHM`N?&7S4:^=L<;]0AQQA"_134 M@@V"`.%\\>;%A4@M%FL&&C$RRT5-N6'II1TTMW"%'&O*Y<8:716961@M8V5?G MG5HJN)Z'"7Q)7Q@]&6:FC#JQJ.:$-M;4EPAB:'9'?E\\%"BF3/QHIFTTX[9?` M;X$NF$21KK&D8G3*^0AD=.61D(031CPA11-)8$%$$E*\\($:-+YB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ZT2')86R@*0)BG%"$@10SH+9Q`O$6(@6,#B22DZSD)3/9T3M\\82P_ MD0/J5("X(!B!>%*`C`V/5`8VD"$&B(L(/BGY40(1=&U%)9E)0:#/D_:SJ"`X M:BT#RCH1$.$)5W!"0QD$42=(E*)IBTA3Y[FNDB3@K/P$`52E^K&#)K0*4-CJ M0R,*5N!%1`A5.,);$I"%.L!A.`[CEXZ4(@8VK/)$;Q@,,\\?)V,8Z]K'-C`@T 56P("&;#SLA3!YIRT:1=N>A.<XOP( ` end SHAR_EOF echo 'uncompressing file README' && compress -d < _shar_cmp_.tmp > 'README' && rm -f _shar_cmp_.tmp && chmod 0664 README || echo 'restore of README failed' Wc_c="`wc -c < 'README'`" test 2561 -eq "$Wc_c" || echo 'README: original size 2561, current size' "$Wc_c" fi # ============= db4glgen ============== if test -f 'db4glgen' -a X"$1" != X"-c"; then echo 'x - skipping db4glgen (File already exists)' else echo 'x - extracting db4glgen (Compressed)' sed 's/^X//' << 'SHAR_EOF' | uudecode && begin 600 _shar_cmp_.tmp M'YV,(T"00%(F#)DR<G2`(".&QADV9\\JX86$'A`P7,T#DB/$B!HR.,"S.T`%# MAHX8-Q:&F0."R9LQ:\\J0$:A`P8@1-F_JW,FSI\\^?0'_:M`EBR!LX>>2D.8.& M#HHQ*4#$R)$#!HNI&T&(R0."2!@[:68&<0%BBIL\\!^6X&!H0A%LJ:-*P)/.R M3AN)=$",>>.&3I@T;E@"-O-&3ILP=-+P!4$'#6(0<HDV+@,"CIRC".EP?6.F MZ]>P(,:6/9MV+<Z`29P8>2*E21(L(%JT`)'$#6'#:?"4Y4SG3A@YE&N/,4V4 M2AHZ;,HH=,N\\N7/G#!U"E,@VJ/7KV'OFK%EG3IB(**+N43#F,0\\>(4*`\\&%" MAH(J4X(<*:*CYG.WT1]&=!-[)D,W8=P56UY^B0&@@%NT(`8(1B11!!-$Q!#; M@@T^2(0,78"0H!D96O;&&0>649,"]_6''V)AB+$292':=U\\+>3&68G(@M$CB MBPOJ!1QBE(D@QF5WS%&&""`HY<89(!R5V&+=`89DA1!*&(8;,T%YH8O/M=`9 M"+>-0=D;=B!TAU)T?-E9&