From: cs_mj@gsbacd.uchicago.edu (Mark Jaeger)
Subject: Re:  Ownership problem. ABF application  
Organization: 
Date: Thu, 20 Aug 1992 22:06:07 GMT

In article <1992Aug20.161118.18014@emr1.emr.ca>, kasvand@ccrs.emr.ca
(Tony Kasvand) writes:
>
>   I have an image (and running executable) application which won't let other
> users execute and use this program. They keep receiving this error at the
> beginning:
>
> xlqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
> xx SELECT on table special_users_table: no GRANT or GRANT compatible permit   x
> xx exists. (E_US0DAE)                                                         x
> xx (Tue Aug 18 09:02:21 1992)                                                 x
> xx                                                        [PRESS RETURN]      x
> xmqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj

Let's say your database is called "foodb".  You need to do this:

	$ sql foodb
	grant all on special_users_table to public \g
	\quit

This allows all users to do "select", "insert", "update", or "delete"
on the table (as directed by the application).

>   OK, so I try to grant privileges to my database. I put this command into
> the Default Frame ABF/4GL code (is it correct to do this? ...apparenty not)..
>
> grant db_admin on database tonis_ccrs_database to public;
>
>     The error I receive is:
>
> qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
>  x You cannot GRANT or REVOKE database or installation privileges             x
>  x  while in session with this database.                                      x
>  x  Ensure your session is connected to the iidbdb database. (E_US188A)       x
>  x (Tue Aug 18 08:59:52 1992)                                                 x
>  x                                                        [PRESS RETURN]      x
>  mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
>
>  I don't know where to find iidbdb .

The iidbdb is special database, but in many ways it's just like any
other database.  If you really wanted to do what you state, then you
should do this:

	<log into the INGRES account>
	$ sql iidbdb
	grant db_admin on database tonis_ccrs_database to public \g
	\quit

However, this now gives the public the ability to do very destructive
things to your database, such as "drop table special_users_table", which
is probably not what you want.  You're better off using the
table-specific grants.

>      While in ABF/4GL menus editing the application, i've tried to unlock
> the database in menu options Utilities.LockStatus by using Delete which
> should unlock the database (at least that what the Help says) but :
>
>
> qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
>  x You may not delete your own session.                                       x
>  x  The row you are positioned on is the one corresponding to your own edit   x
>  x session.  You may not delete locks corresponding to that session.          x
>  x (E_AB00A6)                                                                 x
>  x                                                        [PRESS RETURN]      x
>  mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj

The lock referred to in the message is a lock that helps prevent
multiple ABF/4GL developers from colliding with each other while working
on the same ABF application.  This does not apply to _users_ of the
database who are using an application that you wrote.  

It's important to distinguish between access to the database, access to
the tables, and access to an ABF application.  I'd like to suggest that
you take one of the elementary INGRES developers classes.  There's also
a lot of good information along these lines in the INGRES DBA Guide.

--Mark Jaeger				internet: cs_mj@gsbvax.uchicago.edu
Graduate School of Business		yellnet:  (312) 702-0328
University of Chicago			faxnet:   (312) 702-0233
Disclaimer: My opinions are my own and not those of my employer.
Ich bin ein Virus.  Mach' mit und kopiere mich in Deine .signature.

Newsgroups: comp.databases.ingres