Re: SQL in Oracle

From: Stephan Born <stephan.born_at_beusen.de>
Date: Thu, 07 Oct 1999 12:02:18 +0200
Message-ID: <37FC6FA9.F517D8E0_at_beusen.de>


> Hello!
>
> I have some questions about SQL (Oracle).
>
> 1. Is there a view that shows what rights a user( or a role) have? Ex:
>
> select * from the_magic_view where USERNAME like ‘SCOTT’ ….
>

Try some of the following:

select * from user_role_privs;
select * from user_sys_privs;
select * from user_tab_privs;
select * from role_role_privs;
select * from role_sys_privs;
select * from role_tab_privs;
select * from session_roles;


>
> 2. What is the simplest way to delete a column from a table? Oracle
> don’t support:
> ALTER TABLE <TABLENAME> DROP COLUMN <COLUMNNAME>….
>
> I saw a solution on a www page. It was something like this:
>
> ? update t1 set column_to_drop = NULL; rename t1 to t1_base; create view
> t1 as select <specific columns> from t1_base;
>
> ? create table t2 as select <specific columns> from t1; drop table t1;
> rename t2 to t1;
>
> But I want to select all columns except one. (Select all form t1 but not
> column like ‘name’)
>
> How do I do this?

I didn't understand you: what columns do you have and what coloumns do you want to drop?

>
>
> 3. Sometimes then I update tables I get a ORA 02289 error… (The table
> contains a field that is unique.)
> What is that??
>

ORA-02289 sequence does not exist

Cause: The specified sequence does not exist, or access privilege is required for this operation. Also, this error can occur if attempting to access a remote sequence through an invalid or non-existent database link. Action: Check spelling of the sequence name or obtain the required access privilege. If necessary, create the sequence. All remote sequences accessed in a distributed transaction must be on the same node.

Copyright (C) 1995, Oracle Corporation

Regards, Stephan

--
---------------------------------------------------------------
Dipl.-Inf. (FH) Stephan Born   | beusen Consulting GmbH
fon: +49 30 549932-17          | Landsberger Allee 392
fax: +49 30 549932-29          | 12681 Berlin
mailto:stephan.born_at_beusen.de  | Germany
---------------------------------------------------------------
Received on Thu Oct 07 1999 - 12:02:18 CEST

Original text of this message