Create view from user type
I need to create an "empty" view which would select from an user type. Is it possible?
I have:
create or replace TYPE my_type as object
my_col varchar2(13)
create or replace type my_type_array as table of my_type;
And I need something like:
create view my_view as select my_col from my_type_array where 1=2
I'm not selecting anything I just need an view to read names and types of my_type_array fields. Is it possible?
If you just want to see the name and datatypes of your types attributes, just:
SQL> select attr_name
2 from DBA_TYPE_ATTRS
3 where type_name = 'MY_TYPE';
ATTR_NAME
MY_COL
1 row selected.
Similar Messages
-
Getting Error ORA-00604 While Creating View from front Ent
Hello All,
I am getting ORA-00604 while creating view from the front end. And some time I get Maximum cursor open, It is ok amy be I am opening cursors in while loop. While ORA-00604 is giving lots of truble to me. In help it said to contact Oracle service, I dont know how to do that. Help me.Please post your view definition including the complete error_message and also the relevant parts of your code with the while loop.
-
Create view from multiple days tables
Hi,
I'm having existing oracle db with daily stat data, tables strangely named data_mon, data_tue, data_wed.. For my batch processing I plan to use view with multiple day data, let say for last 5 days.
Not sure how better implement my sql statement, with those _mon suffixes to make it more or less dynamic.
I also never create View from multiple tables, so probably I can do something that will add fresh daily data and delete 5 days old data?
Will appreciate you comments on details and whole concept. I have prev sql server experience.
Thanks
Tuser12943718 wrote:
Hi,
I'm having existing oracle db with daily stat data, tables strangely named data_mon, data_tue, data_wed.. For my batch processing I plan to use view with multiple day data, let say for last 5 days.
Not sure how better implement my sql statement, with those _mon suffixes to make it more or less dynamic.
I also never create View from multiple tables, so probably I can do something that will add fresh daily data and delete 5 days old data?
Will appreciate you comments on details and whole concept. I have prev sql server experience.
Thanks
TChange the data model so you don't have 1 table for a day.
You just have a DATA table, and a column to denote the day of applicability.
Then you don't need a view, don't need anything dynamic, don't need to smash your head against a wall for a simple query ... etc. -
PISUPER was created as dialog user type from install
Hi,
I've noticed several threads stating that the PISUPER should be a service user. However, the PISUPER was created as a dialog user during my install of PI 7.1.
Can anyone tell me why it would be created as a dialog user? I would like to change this user to a service type rather than dialog. Will this cause any problems?
Thanks in advance for your input.
Best Regards,
RickHi Satish,
Thanks for your input. Unfortunately, the PISUPER user ID does not show up in that link. This ID was created either by the installation or the configuration wizard.
There are several other users created by the install or the configuration wizard, but, they are all created as system users. The only one created as a dialog user is PISUPER.
Any help in clarification will be greatly appreciated.
Regards,
Rick -
Create View from Database Links - Question
Question
I'm missing something simple.
I'm trying to create a view, from a Database Link.
CREATE VIEW view_name
AS SELECT a.*
FROM schema.tablename@dblink a;
When I run this in the SQL Commands window.
I get this error message.
ORA-00933: SQL command not properly ended
What am I missing? Any help is appreciated...<i>CREATE VIEW vw_name
AS SELECT a.*
FROM [email protected] a;
</i>
<br>
1) User (schema) which is creating view must have proper db_link to source database. For that try this for testing purpose:
select 1 from [email protected]<br>
If this fail then db_link is not ok! This step is absolute must to go any further step to!!!
<br>
2) when db_link is set, then your view should be named as:
CREATE VIEW vw_name
AS SELECT *
FROM <b>schema_name</b>.[email protected];<br>
please pay attention to "schema_name", because from remote side every table is in some schema so it really need declaration of owner schema.
<br>
Hope this helps... -
Creating views for users by entering a field
Hi I want to create a veiw for a new user.
I want the user to view details for a member after he has entered a Membership No
create view member_details
(&memberno, name, address)as
select memberno, name, address
from member
where memberno = &memberno;
when i use this command it asks me for a memberno, I enter one so when the user logs in and
select * from reilly.member_details;
all he gets is the info for the memberno I have entered
how do I fix this so the user is the one entering the membernoIf your admin staff need to access details for any member, can't they just query a view of all members and specify a memberno then?
View (presumably more complex than this in reality) would be
create view member_details
(memberno, name, address) as
select memberno, name, address
from members;Admin user query would be:
select * from member_details
where memberno = &memberno;Is SQL*Plus really the interface you provide your admin users with? -
Creat View from Multiple tables , Multiple Select
Hello Everyone ,
I have a question and am not sure if this the correct forum to post it .
I have two table studentTable and CourseTable which is each student take more than one course . 1:M
for example Student1 take 2 courses (C1 , C2).
Student2 take 3 courses (C1,C2, C3).
I need to create a table/View that contain student information plus all the courses and the score for each course in one row.
for example
Row1= Student1_Id ,C1_code ,C1_name ,C1_Score ,C2_code,C2_name ,C2_Score
Row2=
Student2_Id,C1_code, C1_name,C1_Score,C2_code ,C2_name ,C2_Score , C3_code,C3_name,C3_Score
and since Student 1 just took two courses , I should enter NULL in 'Course 3 fields'
My Struggle is in the insert statement
I tried the following but it show an error
Insert Into Newtable
( St_ID, C1_code,c1_name, C1_Score ,C2_code ,C2_name,C2_score,C3_code ,C3_name,C3_score)
Select
(Select St_ID from StudentTable)
(Select C_code,c_name,c_Score
from Coursetable,SudentTable
where course.Stid =Studet.stid)
(Select C_code,c_name,c_Score
from course ,student
where course.Stid =Studet.stid ),
(Select C_code,c_name,c_Score
from course ,student
where course.Stid =Studet.stid );
I'm fully aware that the New table will break the rules of normalization ,but I need it in this way for specifc purpose.
I tried also the PIVOT BY functionality but no luck with it .
FYI , I'm not expert in using SQL Syntax , I just know the basic.
I will be great full for any helpfull suggestions to try ,
thank you very much.First Table is Member table which Represent
Students Information
.The fields in this table are
member_sk (PrimaryKey), full_or_part_time, gender, age_at_entry, age_band_at_entry, disability, ethnicity,
widening_participation_level, nationality
Second Table is Modules table which include
the Courses' scores that Student took .
The fields in this table are
Module_result_k(Primary Key), member_sk(Foreign key to connect to Member table), member_stage_sk
,module_k(Foreign key to connect to Module table), module_confirmed_grade_src, credit_or_result
Third Table is
AllModuleInfo which is include
general information for each course .The fields in this table are
Module_k (Primary key), module_name ,module_code, Module_credit, Module stage.
The New table
that I will create has the following fields
member_sk (PrimaryKey), full_or_part_time, gender, age_at_entry, age_band_at_entry, disability, ethnicity,
widening_participation_level, nationality
" This will be retrieved from Member table"
Also will include
Module 1_name ,module1_code, Module1_credit, Module1_ stage, member1_stage_sk
, module1_confirmed_grade_src, credit1_or_result
Module 2_name ,module2_code, Module2_credit, Module2_ stage, member2_stage_sk
, module2_confirmed_grade_src, credit2_or_result
I will repeat this fields 14 times which is equal to Maximum courses number
that any of the students took.
//// I hope now my questions become more clear -
Hi,
Can you help me with this?
I wrote this
{declare
cursor c1 is
select *
from
all_objects
where lower(owner) like 'scott'
and lower(object_type)='table';
i varchar2(50);
begin
for i in c1
loop
execute immediate 'create table '||i.object_name|| ' as select *
from ' ||i.object_name;
end loop;
close c1;
end;
and I have the following errors:
ERROR at line 1:
ORA-00942: table or view does not exist
ORA-06512: at line 12
Thank youCould you please show output of your generated code using dbms_output.put_line command?
declare
cursor c1 is
select *
from
all_objects
where lower(owner) like 'scott'
and lower(object_type)='table';
i varchar2(50);
begin
for i in c1
loop
dbms_output.put_line('create table '||i.object_name|| ' as select *
from ' ||i.object_name);
end loop;
close c1;
end;
Kamran Agayev A. (10g OCP)
http://kamranagayev.wordpress.com -
Create pdf from any type of file file format
Hi there;
I have to create a pdf file from a special file format (which is not in the supported file list of livecycle pdf generator).Is there any chance to accompish that transform?I know Java.Thanks in advance..no sense?
-
How to CREATE VIEW to merge two tables each of which has CLOB-typed column
I failed in creating a view to merge two tables that have CLOB-type column each.
The details are:
Database: Oracle 9i (9.2.0)
Two tables "test" and "test_bak", each of which has the following structure:
ID Number(10, 0)
DUMMY VARCHAR2(20)
DUMMYCLOB CLOB
The following operation fails:
create view dummyview (id, dummy, dummyclob) as
select id, dummy, dummyclob from test
union
select id, dummy, dummyclob from test_bak;
I was announced:
select test.id, test.dummy, test.dummyclob
ERROR in line 2:
ORA-00932: inconsistent data type: required - , but CLOB presented.
But if creating views from only ONE table with CLOB-type columns, or from two tables WITHOUT CLOB-typed columns, the creation will succeed. The following 1) and 2) will succeed, both:
1) one table, with CLOB-typed column
create view dummyview (id, dummy, dummyclob) as
select id, dummy, dummyclob from test;
2) two tables, without CLOB-typed columns
create view dummyview (id, dummy) as
select id, dummy from test
union
select id, dummy from test_bak;
I want to merge the two tables all, with complete columns, how to write the CREATE VIEW SQL statement?
many thanks in advanceDong Wenyu,
No.
But you could do this:
SELECT source.*, nvl (tab1.clob_column, tab2.clob_column)
FROM your_table1 tab1, your_table2 tab2, (
SELECT primary_key, ...
FROM your_table1
UNION
SELECT primary_key, ...
FROM your_table2
) source
WHERE source.primary_key = tab1.id (+)
AND source.primary_key = tab2.id (+)
In other words, do the set operation (UNION (ALL)/INTERSECT/MINUS) on just the PK columns before pulling in the LOB columns.
d. -
Custom User Type in 11.5.10
I am trying to create a custom user type for iStore self registrations in the CRM HTML Administrator responsibility. I have learned through research on Metalink that there was a bug in this process introduced in patch 11i.IBE.P which requires you to create a new registration template Java class based on the RegisterBusiness class. There is a high-level overview in the RUP3 documentation. However, I can find no concrete examples of what I need to fix in the RegisterBusiness class to get the custom user type to work. I would appreciate any examples anyone might have. The most relevant info I have is Metalink note 374644.1 and the RUP3 Release Notes PDF from July 2005. (Sorry, I have no link for that PDF. I downloaded it over a year ago and can't find it on the site again.)
This is explained in metalink Note:374644.1
-
How to create view in oracle?
Hi sir,
i have a view created in sql server that i converted in sql developer through translation scratch editor.
but when i am executing this it's not getting executed showing error insufficient privilege.
here is my view below.
CREATE OR REPLACE VIEW vwEmpMain
AS
SELECT Employee.Emp_ID ,
Employee.Emp_FirstName || ' ' || Employee.Emp_LastName Emp_Name ,
Comp_Master.Comp_Name ,
Dept_Master.Dept_Name ,
Desig_Master.Desig_Name ,
Category_Master.Cat_Name ,
Dept_Master.Dept_Desc ,
Category_Master.Cat_Desc ,
Desig_Master.Desig_Desc ,
Comp_Master.Parent_ID HiredBy ,
Employee.Card_ID ,
Employee.Comp_ID ,
Employee.Dept_Code ,
Employee.Cat_Code ,
Employee.Desig_Code ,
Employee.ADDRESS ,
Employee.Phone ,
Comp_Master.STATUS Comp_Status ,
Employee.DOJ Date_Of_Join
FROM Comp_Master
RIGHT JOIN Employee
ON Comp_Master.Comp_ID = Employee.Comp_ID
LEFT JOIN Desig_Master
ON Employee.Desig_Code = Desig_Master.Desig_Code
LEFT JOIN Dept_Master
ON Employee.Dept_Code = Dept_Master.Dept_Code
LEFT JOIN Category_Master
ON Employee.Cat_Code = Category_Master.Cat_Code;
could you check that.
thanksWhenever you post provide your 4 digit Oracle version (result of SELECT * FROM V$VERSION).
>
when i am executing this it's not getting executed showing error insufficient privilege.
>
Always provide the exact error code and message for questions like this.
That error means the user does not have the CREATE VIEW or CREATE ANY VIEW privilege.
The solution is to grant the user CREATE VIEW, for creating views in their own schema, or CREATE ANY VIEW to create views on objects in other schemas.
As SYS 'REVOKE CREATE VIEW FROM SCOTT'. Then as SCOTT
>
create or replace view a_view as select * from emp;
ORA-01031: insufficient privileges
>
It is a different error when the user does not have SELECT privilege on the underlying table or view
As SYS 'GRANT CREATE VIEW TO SCOTT'. Then as SCOTT
>
create or replace view a_view as select * from hr.employees
ORA-00942: table or view does not exist
>
Same if the object does not exist
>
create or replace view a_view as select * from no_such_table
ORA-00942: table or view does not exist
>
But if the table does exist
>
create or replace view a_view as select * from emp; -
Hi Experts,
I need to create view from joining 4 Tables in SAP R/3 in SE11 Transaction. Can you please let me know step by step the procedure to create the view.
Thanks
PadmaHi Padma,
Welcome to SDN . Please use the below link to get the information about view
Re: how to create a view?
But please search SDN before posting and post the message in the correct forum ( ABAP) to get the faster response.
Thanks & Regards,
Raja -
User type for creating the Http connection from sap to xi
Hi Friends,
I need to create the Http and Rfc destination connection from R3 to XI.
For that what type of user is needed, like Dialog user and etc.,
Please guide me.
Thanks in advance
KarthikeyanHi,
If my Understanding is Correct You want to Make the RFC Destination of Type H From R/3 to XI.
If you want to send Any XML Data to XI( In case of Proxies Used means)
For Testing purpose You can use Your User And Once it went to production means You can Use Service User in the Logon Details( Ask Basis people to create one Service User & Use it)
REgards
Seshagiri -
Custom workflow... creating a new user from the End User's point of view
Hello I am trying to design a new Request for the end user so that they are able to create a new user. I am having problems with my workflow at this point and keep getting the error "Missing view id." Below is my code please help me out... I am very new to this so be gentle.
P.S. All my fields are named with " view.waveset.* " where * is either accountId or firstname or any attribute I need to set
<Extension>
<WFProcess name='End User Create New User' maxSteps='0'>
<Activity id='0' name='start'>
<Transition to='Create View'/>
<WorkflowEditor x='33' y='5'/>
</Activity>
<Activity id='1' name='Create View'>
<Action id='0' application='com.waveset.session.WorkflowServices'>
<Argument name='op' value='createView'/>
<Argument name='id' value='$(accountId)'/>
<Argument name='type' value='User'/>
</Action>
<Transition to='Update View'/>
<WorkflowEditor x='107' y='81'/>
</Activity>
<Activity name='Update View'>
<Action process='Update View'>
<Argument name='type' value='User'/>
<Argument name='id' value='$(accountId)'/>
<Argument name='options'>
<map/>
</Argument>
</Action>
<Transition to='Provision'/>
</Activity>
<Activity id='2' name='Provision'>
<Action id='0' application='com.waveset.provision.WorkflowServices'>
<Argument name='op' value='provision'/>
<Argument name='user' value='$(view)'/>
<Argument name='options'>
<map/>
</Argument>
</Action>
<Transition to='end'/>
<WorkflowEditor x='296' y='83'/>
</Activity>
<Activity id='3' name='end'>
<WorkflowEditor x='393' y='5'/>
</Activity>
</WFProcess>
</Extension>I ran across the same error today. Since it's been over a month, I assume you've fixed it already or decided you didn't need it at all? What was your fix?
For me, I noted that in the sample directory, a similar "createView" call (in End User Anonymous Enrollment) also includes this argument:
<Argument name='viewId' value='User'/>
When I added that to my createView call, the "Missing view id" error went away, and the user are gets created.
I'm not entirely comfortable with the value specified, though; seems like view IDs should be more unique. I would have thought it should have been something like this instead:
<Argument name='viewId' value='User:$(accountId)'/>
Maybe you are looking for
-
have a mac book pro that crashed. ran disk utility to repair. comp booted and ran for short time. then crashed. ran repair again. disk utility said it could not repair disk and needed to format and start again. comp said it could not unmount disk and
-
How to specify custom page size in points?
Have done the usual searches and not hit anything. Has anyone worked out how to get the custom sizes in Print Setup- to be measured in Points? I have a job where I need to work to screen resolution. The two System choices are for Metric which oddly s
-
Why can't i backup with iTunes 11
I am trying to backup with my Imac 27" running Lion, but I can't find any devices to back my Itunes library to. I want to back up using my DVD +R-DL disks. Am I doing something wrong? (Just in case, I'm upgrading right now to Mountain Lion and wil
-
Hi all, In my music pane of itunes I use the column "track #" to view the order of my tracks in certain albums. It only allows up to 3 digits and it doesn't seem possible to change the width of this column (unlike all the other columns). Anybody any
-
hi, pleas if y can give me resources or ideas how to develop file browser using j2me. this file browser can browse the memory card or the phone memory . and how to serach on file and to delete files .. specily for nokia 6600 phone whech is have its o