Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: grant select on SCOTT.* to vewalluser

RE: grant select on SCOTT.* to vewalluser

From: Mercadante, Thomas F \(LABOR\) <Thomas.Mercadante_at_labor.state.ny.us>
Date: Tue, 31 Oct 2006 13:17:11 -0500
Message-ID: <ABB9D76E187C5146AB5683F5A07336FFE087F6@EXCNYSM0A1AJ.nysemail.nyenet>


I like to do this without spooling a file and needing to run that:  

Declare  

CURSOR c3 IS

  SELECT 'GRANT SELECT ON ' || object_name || ' to viewallusers;' out_line

  FROM USER_OBJECTS   WHERE object_type = 'TABLE'

;  

BEGIN   FOR c3_rec IN c3 LOOP

   EXECUTE IMMEDIATE RTRIM(c3_rec.out_line,';');

END LOOP;   END; /    



This transmission may contain confidential, proprietary, or privileged information which is intended solely for use by the individual or entity to whom it is addressed. If you are not the intended recipient, you are hereby notified that any disclosure, dissemination, copying or distribution of this transmission or its attachments is strictly prohibited. In addition, unauthorized access to this transmission may violate federal or State law, including the Electronic Communications Privacy Act of 1985. If you have received this transmission in error, please notify the sender immediately by return e-mail and delete the transmission and its attachments.

From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Allen, Brandon Sent: Tuesday, October 31, 2006 1:13 PM
To: Roger.Xu_at_dp7upbg.com; Oracle-L_at_Freelists. Org (E-mail) Subject: RE: grant select on SCOTT.* to vewalluser  

Just a small syntax correction - you need the string concatenation operator in there, and will probably want to add a semi-colon at the end too:  

select 'grant select on ' || table_name || ' to viewalluser;' from user_tables;  

Regards,

Brandon

Privileged/Confidential Information may be contained in this message or attachments hereto. Please advise immediately if you or your employer do not consent to Internet email for messages of this kind. Opinions, conclusions and other information in this message that do not relate to the official business of this company shall be understood as neither given nor endorsed by it.

--
http://www.freelists.org/webpage/oracle-l
Received on Tue Oct 31 2006 - 12:17:11 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US