urgent help required with informix forms.
Posted in 1999
A developer launching ISQL/sperform forms from an ESQL-C application needed a USER field to be read-only and auto-filled with the current Unix/login user so one person couldn't edit another's row. Art Kagel suggested driving the form from a 4GL function called from C, but the poster had no 4GL licence and 4GL can't be compiled with the ESQL-C compiler. Jonathan Leffler proposed a view (SELECT ... WHERE UserName = USER) with SELECT-only rights on the base table and update rights granted on the view; another reader suggested a trigger to insert the username. The poster asked follow-ups about restricting inserts, and no confirmed resolution is recorded.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Platform-Specific Issues
Hi, I have run into a problem just before my release. We are using ESQL-C to access informix in our application but for some of the menus we just use the informix forms to access database tables. We use the system command in ESQL C to run (sperform -s xx.frm). In one such form the users update their record. This record contains some information for the user along with his userid. All these information go into a database table. Now suddenly the users came up with the requirement that don't want anybody else to update the information of a user. That means one can only update his information in this form. As I said there is a field called USER in the form. So now anybody can enter this field and update anybody's record. I want to make this field as read only and populate it always with the userid(unix userid) whebever someone accesses this form. The first part is easy but is there a way we can achieve the second thing i.e. populate the field always with the unix userid(LOGNAME) variable? If yes you have saved me or else I can think of only one way i.e. make 100 forms for hundred users and hard code that field for each of them, but this is a very crude way. If any of you have some better idea please let me know ASAP. Please send a copy of your reply to email id (asharma@uswest.com) as sometimes I have some problem getting to the group. Any help of any kind will be greatly appreciated. We are on version 7.24.UCU of ESQL and 7.24.UD1 of ISQL and 7.20.UD1 of sperform. We use this on HP-UX release 10.20. Thanks Arvind
It will be easier and give more control if you run those forms from a 4GL function called from "C". This is not hard to implement and you will have complete control from the 4GL module while it is managing the form. Art S. Kagel Arvind Sharma wrote: > > Hi, > I have run into a problem just before my release. We are using > ESQL-C to access informix in our application but for some of the menus > we just use the informix forms to access database tables. We use the > system command in ESQL C to run (sperform -s xx.frm). > In one such form the users update their record. This record contains > some information for the user along with his userid. All these > information go into a database table. Now suddenly the users came up > with the requirement that don't want anybody else to update the > information of a user. That means one can only update his information in > this form. As I said there is a field called USER in the form. So now > anybody can enter this field and update anybody's record. > I want to make this field as read only and populate it always with > the userid(unix userid) whebever someone accesses this form. The first > part is easy but is there a way we can achieve the second thing i.e. > populate the field always with the unix userid(LOGNAME) variable? If yes > you have saved me or else I can think of only one way i.e. make 100 > forms for hundred users and hard code that field for each of them, but > this is a very crude way. If any of you have some better idea please let > me know ASAP. Please send a copy of your reply to email id > (asharma@uswest.com) as sometimes I have some problem getting to the > group. > > Any help of any kind will be greatly appreciated. We are on version > 7.24.UCU of ESQL and 7.24.UD1 of ISQL and 7.20.UD1 of sperform. We use > this on HP-UX release 10.20. > > Thanks > Arvind
Thanks for the response. As I said to you earlier we don't have 4gl running on our machine. Can we compile 4gl with ESQL C compiler. Thanks Arvind "Art S. Kagel" wrote: > It will be easier and give more control if you run those forms from a > 4GL function called from "C". This is not hard to implement and you > will have complete control from the 4GL module while it is managing the > form. > > Art S. Kagel > > Arvind Sharma wrote: > > > > Hi, > > I have run into a problem just before my release. We are using > > ESQL-C to access informix in our application but for some of the menus > > we just use the informix forms to access database tables. We use the > > system command in ESQL C to run (sperform -s xx.frm). > > In one such form the users update their record. This record contains > > some information for the user along with his userid. All these > > information go into a database table. Now suddenly the users came up > > with the requirement that don't want anybody else to update the > > information of a user. That means one can only update his information in > > this form. As I said there is a field called USER in the form. So now > > anybody can enter this field and update anybody's record. > > I want to make this field as read only and populate it always with > > the userid(unix userid) whebever someone accesses this form. The first > > part is easy but is there a way we can achieve the second thing i.e. > > populate the field always with the unix userid(LOGNAME) variable? If yes > > you have saved me or else I can think of only one way i.e. make 100 > > forms for hundred users and hard code that field for each of them, but > > this is a very crude way. If any of you have some better idea please let > > me know ASAP. Please send a copy of your reply to email id > > (asharma@uswest.com) as sometimes I have some problem getting to the > > group. > > > > Any help of any kind will be greatly appreciated. We are on version > > 7.24.UCU of ESQL and 7.24.UD1 of ISQL and 7.20.UD1 of sperform. We use > > this on HP-UX release 10.20. > > > > Thanks > > Arvind
Arvind Sharma wrote: > > Thanks for the response. > As I said to you earlier we don't have 4gl running on our machine. Can we > compile 4gl with ESQL C compiler. Unfortunately not. Art S. Kagel > "Art S. Kagel" wrote: > > > It will be easier and give more control if you run those forms from a > > 4GL function called from "C". This is not hard to implement and you > > will have complete control from the 4GL module while it is managing the > > form. > > > > Art S. Kagel > > > > Arvind Sharma wrote: > > > > > > Hi, > > > I have run into a problem just before my release. We are using > > > ESQL-C to access informix in our application but for some of the menus > > > we just use the informix forms to access database tables. We use the > > > system command in ESQL C to run (sperform -s xx.frm). > > > In one such form the users update their record. This record contains > > > some information for the user along with his userid. All these > > > information go into a database table. Now suddenly the users came up > > > with the requirement that don't want anybody else to update the > > > information of a user. That means one can only update his information in > > > this form. As I said there is a field called USER in the form. So now > > > anybody can enter this field and update anybody's record. > > > I want to make this field as read only and populate it always with > > > the userid(unix userid) whebever someone accesses this form. The first > > > part is easy but is there a way we can achieve the second thing i.e. > > > populate the field always with the unix userid(LOGNAME) variable? If yes > > > you have saved me or else I can think of only one way i.e. make 100 > > > forms for hundred users and hard code that field for each of them, but > > > this is a very crude way. If any of you have some better idea please let > > > me know ASAP. Please send a copy of your reply to email id > > > (asharma@uswest.com) as sometimes I have some problem getting to the > > > group. > > > > > > Any help of any kind will be greatly appreciated. We are on version > > > 7.24.UCU of ESQL and 7.24.UD1 of ISQL and 7.20.UD1 of sperform. We use > > > this on HP-UX release 10.20. > > > > > > Thanks > > > Arvind
Arvind Sharma wrote:
>
> Hi,
> I have run into a problem just before my release. We are using
> ESQL-C to access informix in our application but for some of the menus
> we just use the informix forms to access database tables. We use the
> system command in ESQL C to run (sperform -s xx.frm).
> In one such form the users update their record. This record contains
> some information for the user along with his userid. All these
> information go into a database table. Now suddenly the users came up
> with the requirement that don't want anybody else to update the
> information of a user. That means one can only update his information in
> this form. As I said there is a field called USER in the form. So now
> anybody can enter this field and update anybody's record.
> I want to make this field as read only and populate it always with
> the userid(unix userid) whebever someone accesses this form. The first
> part is easy but is there a way we can achieve the second thing i.e.
> populate the field always with the unix userid(LOGNAME) variable? If yes
> you have saved me or else I can think of only one way i.e. make 100
> forms for hundred users and hard code that field for each of them, but
> this is a very crude way. If any of you have some better idea please let
> me know ASAP. Please send a copy of your reply to email id
> (asharma@uswest.com) as sometimes I have some problem getting to the
> group.
>
> Any help of any kind will be greatly appreciated. We are on version
> 7.24.UCU of ESQL and 7.24.UD1 of ISQL and 7.20.UD1 of sperform. We use
> this on HP-UX release 10.20.
This sounds like an application crying for the use of a view:
CREATE VIEW SecureTable AS
SELECT * FROM UnSecureTable WHERE UserName = USER;
On the UnSecureTable, you only grant SELECT privileges to the general
public. On the SecureTable (actually a view), the table owner grants
others UPDATE (?INSERT, ??DELETE) privileges on the view. The form
references the view.
This is hypothetical; I'm not certain that it will work.
--
Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net)
Guardian of DBD::Informix v0.60 -- see http://www.perl.com/CPAN
#include <disclaimer.h>
Thnaks, That sounds like a great idea Jonathan. This takes care of the query
of the form. Can somehow we can restrict the insert as well. And where will
the insert and update go?
Arvind
Jonathan Leffler wrote:
> Arvind Sharma wrote:
> >
> > Hi,
> > I have run into a problem just before my release. We are using
> > ESQL-C to access informix in our application but for some of the menus
> > we just use the informix forms to access database tables. We use the
> > system command in ESQL C to run (sperform -s xx.frm).
> > In one such form the users update their record. This record contains
> > some information for the user along with his userid. All these
> > information go into a database table. Now suddenly the users came up
> > with the requirement that don't want anybody else to update the
> > information of a user. That means one can only update his information in
> > this form. As I said there is a field called USER in the form. So now
> > anybody can enter this field and update anybody's record.
> > I want to make this field as read only and populate it always with
> > the userid(unix userid) whebever someone accesses this form. The first
> > part is easy but is there a way we can achieve the second thing i.e.
> > populate the field always with the unix userid(LOGNAME) variable? If yes
> > you have saved me or else I can think of only one way i.e. make 100
> > forms for hundred users and hard code that field for each of them, but
> > this is a very crude way. If any of you have some better idea please let
> > me know ASAP. Please send a copy of your reply to email id
> > (asharma@uswest.com) as sometimes I have some problem getting to the
> > group.
> >
> > Any help of any kind will be greatly appreciated. We are on version
> > 7.24.UCU of ESQL and 7.24.UD1 of ISQL and 7.20.UD1 of sperform. We use
> > this on HP-UX release 10.20.
>
> This sounds like an application crying for the use of a view:
>
> CREATE VIEW SecureTable AS
> SELECT * FROM UnSecureTable WHERE UserName = USER;>
> On the UnSecureTable, you only grant SELECT privileges to the general
> public. On the SecureTable (actually a view), the table owner grants
> others UPDATE (?INSERT, ??DELETE) privileges on the view. The form
> references the view.
>
> This is hypothetical; I'm not certain that it will work.
>
> --
> Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net)
> Guardian of DBD::Informix v0.60 -- see http://www.perl.com/CPAN
> #include <disclaimer.h>
Hi Arvind, Write a Trigger on the table and INSERT the username from there. HTH Yogesh In article <3796458A.27D677D6@uswest.com>, Arvind Sharma <asharma@uswest.com> wrote: > This is a multi-part message in MIME format. > --------------463C0E8C6D992E9D6D0D91BF > Content-Type: text/plain; charset=us-ascii > Content-Transfer-Encoding: 7bit > > Thanks for the response. > As I said to you earlier we don't have 4gl running on our machine. Can we > compile 4gl with ESQL C compiler. > > Thanks > Arvind > > "Art S. Kagel" wrote: > > > It will be easier and give more control if you run those forms from a > > 4GL function called from "C". This is not hard to implement and you > > will have complete control from the 4GL module while it is managing the > > form. > > > > Art S. Kagel > > > > Arvind Sharma wrote: > > > > > > Hi, > > > I have run into a problem just before my release. We are using > > > ESQL-C to access informix in our application but for some of the menus > > > we just use the informix forms to access database tables. We use the > > > system command in ESQL C to run (sperform -s xx.frm). > > > In one such form the users update their record. This record contains > > > some information for the user along with his userid. All these > > > information go into a database table. Now suddenly the users came up > > > with the requirement that don't want anybody else to update the > > > information of a user. That means one can only update his information in > > > this form. As I said there is a field called USER in the form. So now > > > anybody can enter this field and update anybody's record. > > > I want to make this field as read only and populate it always with > > > the userid(unix userid) whebever someone accesses this form. The first > > > part is easy but is there a way we can achieve the second thing i.e. > > > populate the field always with the unix userid(LOGNAME) variable? If yes > > > you have saved me or else I can think of only one way i.e. make 100 > > > forms for hundred users and hard code that field for each of them, but > > > this is a very crude way. If any of you have some better idea please let > > > me know ASAP. Please send a copy of your reply to email id > > > (asharma@uswest.com) as sometimes I have some problem getting to the > > > group. > > > > > > Any help of any kind will be greatly appreciated. We are on version > > > 7.24.UCU of ESQL and 7.24.UD1 of ISQL and 7.20.UD1 of sperform. We use > > > this on HP-UX release 10.20. > > > > > > Thanks > > > Arvind > > --------------463C0E8C6D992E9D6D0D91BF > Content-Type: text/x-vcard; charset=us-ascii; > name="asharma.vcf" > Content-Transfer-Encoding: 7bit > Content-Description: Card for Arvind Sharma > Content-Disposition: attachment; > filename="asharma.vcf" > > begin:vcard > n:Sharma;Arvind > x-mozilla-html:FALSE > org:Tata Consultancy Services > version:2.1 > email;internet:asharma@uswest.com > tel;fax:303-624-0500 > tel;home:303-399-4762 > tel;work:303-624-5052 > adr;quoted-printable:;;931, 14th Street, Room #830 (work)=0D=0A900, S. Quince St., #B511(home);Denver;Co;80231;US > x-mozilla-cpt:;56096 > fn:Arvind Sharma > end:vcard > > --------------463C0E8C6D992E9D6D0D91BF-- > > Sent via Deja.com http://www.deja.com/ Share what you know. Learn what you don't.