Re: getting login name in 4GL
Posted in 1996
If you ever do an alter on that Table you are messing with your Informix Product. That table number (tabid) will always exist and be the same table, because it is the table "systables". As stated early: select <any function var> from systables where tabid=1; ALWAYS will work! The only thing you have to worry about is does the function var applicable/available to you version of Informix engine! Tabid < 100 have always been reserved for the Informix engine! ------------------------------------------------------------------------- Cheryl Kendricks Internet:cherylk@prod1.jcdc.doleta.gov OR kendric@gwysmtp.jcdc.doleta.gov DTSI, Inc. Voice: 1-800-598-5008 Database Administrator - DOL Job Corps San Marcos, Texas ------------------------------------------------------------------------ On Wed, 8 May 1996, Dennis J Pimple wrote: } Apostolos Varnas wrote: } > } > montgomery f. tidwell wrote: } > You have to use the USER function in following manner in your 4GL Programm: } > } > define login_name char(20) } > select user into login_name from systables where tabid = 1 } > } > The assignment } > let login_name = USER } > is not valid in 4GL 4.11 } } Quibbling; } I don't think there's any guarantee that tabid = 1 will alway be in the } database (I vaguely recall that some sort of ALTER TABLE or UPDATE } STATISTICS caused the tabid to be something else), so: } } SELECT USER INTO login_name FROM systables WHERE tabname = "systables" } } Might be better. Also, with 4.11 and up, you can: } } LET login_name = fgl_getenv("LOGNAME") } } with the caveat of knowing that users *can* change their $LOGNAME } environment variable (although there is a Unix way to create an } unchangable environment variable). } > } > Regards } > } > Tolis } > } > +---------------------------------------------------------------------+ } > | V+K Relational Solutions email: tvarnas@compulink.gr | } > | Deligiorgi 26 tvarnas@orbit.de | } > | 546 42 Thessaloniki Voice: (30) 31 820270 | } > | Greece Fax: (30) 31 865463 | } > +---------------------------------------------------------------------+ } } -- } //////////////// ======================================================= } ////////// // Dennis J. Pimple Informix Software, Inc. } ////// / /// Principal Consultant 5299 DTC Blvd Suite 740 } ///// // //// dennisp@informix.com Englewood CO 80111 } //// // ///// } /// // ////// recept: 303-850-0210 } // // /////// direct: 303-740-5611 Opinions expressed are mine, } / /////////// fax: 303-843-6408 and do not necessarily } //////////////// http://www.informix.com reflect those of my employer }