473,608 Members | 2,074 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DB2-SQL questions (grant...)

Hi,

I am pretty new to DB2 (and SQL as well), and run into a few
questions:

1) Is there anybody that knows if there is a way to write the
following in one SQL statement?:
grant select on table agent to user a, user b, user c;
grant select on table customer to user a, user b, user c;
grant select on table product to user a, user b, user c;
(there are more tables, but only these shoould the users get rights
on)

and 2) Is it possible to grant select rights onto only a few columns
of a table?
If so, what does the command look like? (also one command for more
columns possible?)

Thank you in advance.
Eric

Nov 12 '05 #1
2 4470
Ian
Eric wrote:
Hi,

I am pretty new to DB2 (and SQL as well), and run into a few
questions:

1) Is there anybody that knows if there is a way to write the
following in one SQL statement?:
grant select on table agent to user a, user b, user c;
grant select on table customer to user a, user b, user c;
grant select on table product to user a, user b, user c;
(there are more tables, but only these shoould the users get rights
on)
Your syntax above should work fine.
and 2) Is it possible to grant select rights onto only a few columns
of a table?
If so, what does the command look like? (also one command for more
columns possible?)


This is typically done using one or more views, and granting select
priviliges on the view(s) to the appropriate users.

Currently you can only grant update or references authorities on a subset
of columns in a table.
Good luck,


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Nov 12 '05 #2
"Eric" <er**********@y ahoo.com> wrote in message
news:5d******** *************** *********@4ax.c om...
Hi,

I am pretty new to DB2 (and SQL as well), and run into a few
questions:

1) Is there anybody that knows if there is a way to write the
following in one SQL statement?:
grant select on table agent to user a, user b, user c;
grant select on table customer to user a, user b, user c;
grant select on table product to user a, user b, user c;
(there are more tables, but only these shoould the users get rights
on)

and 2) Is it possible to grant select rights onto only a few columns
of a table?
If so, what does the command look like? (also one command for more
columns possible?)

Thank you in advance.
Eric

I don't know which DB2 platform you are running, but all this information is
contained in the SQL Reference for the appropriate DB2 you are running. You
can download the manual from the IBM website:
http://www-3.ibm.com/software/data/pubs/
The manuals are at the bottom of the screen.
Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
17480
by: Michael | last post by:
Hi, I am migrating an application from Oracle to DB2. There is an Oracle SQL like: SELECT c1, c2 FROM table CONNECT BY c2 = PRIOR c1 START WITH c2 IN ('1','2') My question is how to convert above SQL to DB2 SQL.
6
3098
by: shaun.mostashari | last post by:
Hello all, I am curious to know if anyone has done a trade study on DB2, SQL Server, and Oracle databases. Basically I am trying to identify which one to chose based on "Ease of implementation", Ease of maintenance", "Pricing" and "Ease of technical support". The criteria I am looking at can be obtained by interviewing people who have worked with these products. I appreciate any input I can get. Thanks, Shaun
1
178810
by: tmugavero | last post by:
Hello, This is my first time starting a topic here so I hope this is the right place. I am having problems running SQL queries on a Version 8 DB2 database for Windows Server using the type 4 driver. I get a connection but when I run a query, I get this error: DB2 SQL error: SQLCODE: -204, SQLSTATE: 42704 For example if my query was "SELECT * from TABLE" , I would get the
138
59298
by: Ian Boyd | last post by:
i've been thrown into a pit with DB2 and have to start writing things such as tables, indexes, stored procedures, triggers, etc. The online reference is only so helpful. The two pdf manuals are only so helpful. Googling is only so helpful. So let's start with some simple SQL constructs, that i know so very well in SQL Server, that seem to be like pulling teeth in DB2. 1. Selecting a value
2
6501
by: pspivack | last post by:
I have a UNIX .sh script that invokes a DB2 SQL .sql script that contains the following: db2 -t -f parmtest.sql -z parm_output.log My question is how can I pass a parameter to the parmtest.sql script from the db2 clp (if it is possible) and how does one reference the parameter in the .sql script. The .sql script is not a procedure.
2
4880
by: Todd | last post by:
Hi, My company is switching from Microsoft SQL 2005 to IBM DB2 UDB 9.1. I've been playing around with the environment on and off for about two weeks now in my spare time, and have a bunch of questions. I've read through this group, it has helped a bit, but I'm definitely still struggling with some of the concepts and would appreciate some help. For reference, I've been using Toad Freeware from a Windows XP machine against a DB2 UDB...
5
3880
by: PJackson | last post by:
DB2 UDB 8.X on Windows server A couple of questions: 1.) I am trying to develop some DB2 SQL stored procedures. Dev environment at UDB v 8.2, production environment still at UDB v 8.1. Any issues with migrating these things since the Dev environment does not need a C compiler and production does? 2.) Main stored procedure calling other stored procedures. Called
1
1355
by: Alwonder | last post by:
Hi, I am new to DB2, I have been trying to convert some of the Oracle sql to DB2 but I have encountered a lot of query syntax. I was wondering if there is any SQL classes for DB2 that I can take. Or ss there any place that I can start off reading DB2 SQL tutorial for newbies like me. Thanks alot! Alwonder
0
17728
by: 098765 | last post by:
Hi All, Since last couple of week i am trying to connect to QA box. But i am getting error. Strange thing is that i can connect to DEV box using same code. Please let me know what is the possible solution. I am able to get connection. I am able to create statement but whenever program goign to line execute it throws error as below: Here is my code: Connection dbconn = null; PreparedStatement pstmt = null;
16
6824
by: Matthew | last post by:
Hi everyone, i'm really newbie in IBM DB2 but I have to know how is IBM DB2 Dialcet called? In oracle we have PL/SQL, in SQL Server we have T-SQL. What about DB2? Is it SQL PL, or DB2 SQL Dialect? Thanks in advance for any reposne. Matthew
0
8087
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8025
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8509
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8179
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6023
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5499
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3993
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2493
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1620
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.