Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help about views!!!

Status
Not open for further replies.

dcampo

Programmer
Jun 13, 2006
71
EC
hi..

I'm user new in Oracle

Is possible create a table from a view? How should be? are there any sentence example for view?

thanks
 
You can create a view from a table.
Code:
CREATE TABLE test_it
(   job_title       VARCHAR2(15),
    first_name      VARCHAR2(20), 
    last_name       VARCHAR2(30)
);
INSERT INTO test_it VALUES ('MANAGER','JULIO','PENA');
INSERT INTO test_it VALUES ('PROGRAMMER','BOB','WHITMAN');
INSERT INTO test_it VALUES ('MANAGER','CHRISTA','SATNER');
INSERT INTO test_it VALUES ('SUPERVISOR','FREDERICK','PENA');
INSERT INTO test_it VALUES ('NETWORK ADMIN','SANDY','MILLER');
COMMIT;

SELECT * FROM test_it ORDER BY job_title;

[b]JOB_TITLE      FIRST_NAME   LAST_NAME[/b]
MANAGER        JULIO        PENA
MANAGER        CHRISTA      SATNER
NETWORK ADMIN  SANDY        MILLER
PROGRAMMER     BOB          WHITMAN
SUPERVISOR     FREDERICK    PENA

CREATE VIEW manager_view AS 
SELECT first_name, last_name FROM test_it WHERE job_title = 'MANAGER';

SELECT * FROM manager_view ORDER BY first_name;

[b]FIRST_NAME  LAST_NAME[/b]
CHRISTA     SATNER
JULIO       PENA
Is this what you wanted?

[sup]Beware of false knowledge; it is more dangerous than ignorance.[/sup][sup] ~George Bernard Shaw[/sup]
Consultant Developer/Analyst Oracle, Forms, Reports & PL/SQL (Windows)
My website: www.EmuProductsPlus.com
 
If you are asking if a permanent table can be created as from a view, then the short answer is yes. You can do one of the following

Create a materilized view. See
Create a point-in-time static table of the contents of a view

create table as
select * from my_view.

Bill
Oracle DBA/Developer
New York State, USA
 
thanks for response!!!

A View is possible apply to sentece UPDATE? why?
 
I am not sure what you meant by "A View is possible apply to sentece UPDATE? why?", could you be a little clearer? I am a little dense today.

Bill
Oracle DBA/Developer
New York State, USA
 
¿Puede hacer usted su pregunta en otras palabras? Nosotros no podemos entender su pregunta en este momento.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services: www.dasages.com]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top