Re: getting login name in 4GL
Posted in 1996
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