Re: Customising user menu menu in ISQL
Posted in 1995
> Is it possible to customise the menu bar for a user menu. I just want > add, modify, delete and exit for a particular menu. > > Thanks, > > Kate We used the SQL user menu to call itself with only one of those options on the command line: ******* BEGIN SCREEN PERFORM: Query Next Previous View Add Update Remove Table ... Shows the next row in the Current List. 2: sysmenuitems table ==========================MENU ENTRY FORM================================= Menu Name: [main ] Menu Title: Interactive Query Menu -------------------------SELECTION SECTION-------------------------------- Selection Number: [2 ] Selection Type: [P] Selection Text: [Run ISQL Query Language Menu ] Selection Action: [cd $HOME/isql/1227;/usr2/informix/bin/isql -s an1227db -q;cd] ******* END SCREEN This is a user menu screen in ISQL, which we invoke from the user's .profile. In this way we keep him in only the SQL options we choose. The "Selection Action" here changes directory to an isql dir, runs isql against the "an1227db" database with the query language option, and changes back to the home dir when finished. Caveats: * Be careful of users "banging out" of SQL and getting to the unix commands. This is a way to run ISQL again (without the restrictions) and have more access. * This uses 2 Informix user licenses, one for the menu and one for the SQL. You can run out of users pretty quick. Informix should have a way to do this better. * Have table-level permissions set appropriately for your application. Don't rely on the menu alone to keep your data intact. I'm sure there are other, and better, ways to do this, but this was easy and cheap and it works well enough that I haven't bothered to improve it in the last few years. On second thought, we also use the "invoke" menuing system from the O'Reilly nutshell book on "sed & awk". That's a very nice, very simple menu system that will do the same thing without using all the informix licenses. We do that in other places. Good luck, __________________________________________________________________ | Clem Akins Standard Disclaimers Apply | |Reynolds Metals Co, Alloys Plant "Climb High, Cave Deep!" | | Muscle Shoals, Alabama USA cwakins@leia.alloys.rmc.com | |________________________________________________________________|