Creating view to get instances to user in wich he has taken part
hellow.
I have a question. I should to create custom view inside Oracle BPM. This view should get only instances in wich current user has taken part, for a example, some user "test" has assigned in the instance to make some task. Part "Test" has done this task and he whant to look this instance after his task. But participant is not a initiator of the instance...
This view is similar to another view, where participant create the instance and this participant - initiator. In this case, we should only add a condition in our view like "initiator is current user"....
But what should I do in my case, when participat is not initiator of the instance but he whants to look tasks in the instance where he have taken part.
Thank you very much.
I have seen this requirement come up quite often but unfortunately it is not easily supported out of the box. The limitation is that you can only filter a view based on a project variable, and user defined project variables can only be primitive types. Because of this you cannot for example keep a list of participants as a project variable. The best you can get is a comma separated list of participant ids in a string, but this is still limited to 255 characters. The next limitation is that you can only compare the current user to a Participant project variable, so the initiator or current user, not against a string. The only way we have found to get the current user in to the filter against a string was to do some workspace customizations that were not all that straight forward.
Similar Messages
-
Error creating view with tables of other user
I am creating of view containing two tables of another user. I
am a dba-user.
The statement looks like this:
CREATE VIEW TEST
(SELECT ...
FROM DWH.TABLE_A A, DWH.TABLE_B B
WHERE A.ID = B.ID)
I get an error-message (ORA-00942: Table or view not found).
When I create the view as user DWH, everything went OK. I don't
think it has something to do with privileges since I am the dba-
user.
How can I create a view using other users tables?Hi
To create view on table of another user you need to have select
privilege grant directly to you - not to role granted to you. In
your case you can select tables because you have granted dba
role and it has select any table prvivilege, but you havent
directly granted this rights without role.
Regards -
To get the sum of leave an employee has taken
hi all
i have this query
SELECT dif.employee_number, dif.full_name employeename,
TO_CHAR (date_entray, 'DY') DAY, date_entray attendance_date,
TO_CHAR (start_date, 'dd-Mon-rrrr') doj, dif.dept_name, POSITION,
tran_name, insert_type, day_desc,
CASE
WHEN insert_type = 'AnLv'
THEN COUNT
(insert_type)
END days_anlv,
CASE
WHEN insert_type = 'SkLv'
THEN COUNT (insert_type)
END days_sklv,
CASE
WHEN insert_type = 'BTrp'
THEN COUNT (insert_type)
END days_btrp
FROM nap_punch_data_emp_list trn, nap_emp_def dif,
nap_punch_card_eleg ele
WHERE trn.employee_number = dif.employee_number
AND ele.employee_number = trn.employee_number
AND date_entray BETWEEN :p_from_date AND :p_to_date
AND trn.employee_number BETWEEN NVL (:p_emp_no, trn.employee_number)
AND NVL (:p_emp_no2, trn.employee_number)
GROUP BY dif.employee_number,
dif.full_name,
start_date,
dif.dept_name,
POSITION,
tran_name,
insert_type,
date_entray,
day_desc
ORDER BY date_entray
the output of which is
EMPLOYEE_NUMBER ATTENDANCE_DATE INSERT_TYPE DAYS_ANLV DAYS_SKLV DAYS_BTRP
686 04/18/2012 annual leave 1
688 04/18/2012 sick leave 1
689 04/18/2012 annual leave 1
686 04/19/2012 annual leave 1
69 04/19/2012 businesstrip 1
69 04/19/2012 businesstrip 1
is it possible to obtain
employee number days_anlv days_btrp
686 2
69 2the sum of the respective leaves each employee has taken
kindly guide
thanking in advance
Edited by: makdutakdu on Jun 24, 2012 2:59 PM
Edited by: makdutakdu on Jun 24, 2012 3:00 PM
Edited by: makdutakdu on Jun 24, 2012 3:01 PM
Edited by: makdutakdu on Jun 24, 2012 3:02 PM
Edited by: makdutakdu on Jun 24, 2012 3:03 PM
Edited by: makdutakdu on Jun 24, 2012 3:03 PM
Edited by: makdutakdu on Jun 24, 2012 3:04 PM
Edited by: makdutakdu on Jun 24, 2012 3:26 PM
Edited by: makdutakdu on Jun 24, 2012 3:27 PM
Edited by: makdutakdu on Jun 24, 2012 3:28 PM
Edited by: makdutakdu on Jun 25, 2012 9:05 AMHi,
makdutakdu wrote:
hi all
i have this query
SELECT dif.employee_number, dif.full_name employeename,
TO_CHAR (date_entray, 'DY') DAY, date_entray attendance_date,
TO_CHAR (start_date, 'dd-Mon-rrrr') doj, dif.dept_name, POSITION,
tran_name, insert_type, day_desc,
CASE
WHEN insert_type = 'AnLv'
THEN COUNT
(insert_type)
END days_anlv,
CASE
WHEN insert_type = 'SkLv'
THEN COUNT (insert_type)
END days_sklv,
CASE
WHEN insert_type = 'BTrp'
THEN COUNT (insert_type)
END days_btrp
FROM nap_punch_data_emp_list trn, nap_emp_def dif,
nap_punch_card_eleg ele
WHERE trn.employee_number = dif.employee_number
AND ele.employee_number = trn.employee_number
AND date_entray BETWEEN :p_from_date AND :p_to_date
AND trn.employee_number BETWEEN NVL (:p_emp_no, trn.employee_number)
AND NVL (:p_emp_no2, trn.employee_number)
GROUP BY dif.employee_number,
dif.full_name,
start_date,
dif.dept_name,
POSITION,
tran_name,
insert_type,
date_entray,
day_desc
ORDER BY date_entray
the output of which is
EMPLOYEE_NUMBER ATTENDANCE_DATE INSERT_TYPE DAYS_ANLV DAYS_SKLV DAYS_BTRP
686 04/18/2012 annual leave 1
688 04/18/2012 sick leave 1
689 04/18/2012 annual leave 1
686 04/19/2012 annual leave 1
69 04/19/2012 businesstrip 1
69 04/19/2012 businesstrip 1
When posting formatted code, make sure it appears on this site so that people can read and understand it. Does the output above look okay ih your browser? I can;t tell which numbers are supposed to be in which columns. Use the "Preview" tab and edit your message, if necessarry, before posting.
is it possible to obtain
employee number days_anlv days_btrp
686 2
69 2
the sum of the respective leaves each employee has takenIt's unclear what you want, but I'm sure you can do it.
Whenever you have a question, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
Explain, using specific examples, how you get those results from that data.
Always say what version of Oracle you're using.
See the forum FAQ {message:id=9360002}
If you only want one row of output for each employee_number, then employe_number should be the only thing in the GROUP BY clause.
You may need to do 2 GROUP BYs; one in a sub-query, and the the other (with employee_number alone in the GROUP BY clause) in the main query.
Why do the results not include employee_numbers 688 and 689? -
How do I get rid of a search engine that has taken over home page?
Search.US.com has taken over my hone page and everything else it can. I have tried all the suggestions available to me by the help section. I have went so far as to delete cookies. This is very invasive. I looked at restoring the system but have few options for recovery points and they don't include the search engine download. I removed the add on it came with as well. I had removed the search engine in add/remove programs and was stupid when it asked if I wanted the default settings restored. I said no. I'm afraid I am j pretty stupid when it comes to software. I hope someone can help me. Thank you for your time in this matter. ps I put what I thought was relevant in the bottom box. I had not seen this before. I tried to modify it but couldn't.
SoultenderI finally got a hold of someone at that search us.com. They gave me this link to try and solve the problem. I have already reinstalled firefox but it might help someone else out. And it's much simpler. I haven't tried it but they said to get a hold of them if it didn't work. the link is:
Running ResetBrowsers.exe from http://support.search.us.com/uninstall.php should restore your settings to their defaults
Hope I'm not misusing this post. Thanks again for all your help. Your are all awesome. -
Creating view to get first row for each table !!
I am having tables(more than 10) which are related using foreign key and primary key relationship.
Example:
Table1:
T1Prim T1Col1 T1Col2
Table2
T2For T2Prim T2Col1 T2Col2 T2Col3
(here T2For will have value same as T1Prim and in my design it has same column name i.e. T1Prim)
Table3
T3For T3Prim T3Col1 T3Col2 T3Col3
(here T3For will have value same as T2Prim)
and so on.
The data in the tables is like For table1 there will be one record, for table2 there will be one record and for table 3 there are more than one records.
Can i view either the first record for each of them or all records from each of them by writing the following view.
I have written a view like this:
Create or replace view test (T1Prim,T1Col1, T1Col2,T2Prim,T2Col1 T2Col2, T2Col3, T3Prim,T3Col1, T3Col2, T3Col3)
As
Select
Table1.T1Prim,
Table1.T1Col1,
Table1.T1Col2,
Table2.T2Prim,
Table2.T2Col1,
Table2.T2Col2,
Table2.T2Col3,
Table3.T3Prim,
Table3.T3Col1,
Table3.T3Col2,
Table3.T3Col3
From
Table1,
Table2,
Table3
where
Table1.Prim = Table2.For
and Table2.Prim = Table3.For
When i ran the select statement on the view I am not getting any data. Whereas there is data when select is ran on individual table.
Can someone please tell me where i am goofing.
Thanks in the anticipation that i will get some hint to solve this.
Eagerly waiting for reply.
Thanks !!I mean use a collection :
Collection Methods
A collection method is a built-in function or procedure that operates on collections and is called using dot notation. The methods EXISTS, COUNT, LIMIT, FIRST, LAST, PRIOR, NEXT, EXTEND, TRIM, and DELETE help generalize code, make collections easier to use, and make your applications easier to maintain.
EXISTS, COUNT, LIMIT, FIRST, LAST, PRIOR, and NEXT are functions, which appear as part of an expression. EXTEND, TRIM, and DELETE are procedures, which appear as a statement. EXISTS, PRIOR, NEXT, TRIM, EXTEND, and DELETE take integer parameters. EXISTS, PRIOR, NEXT, and DELETE can also take VARCHAR2 parameters for associative arrays with string keys. EXTEND and TRIM cannot be used with index-by tables.
For more information, see "Using Collection Methods".
Syntax
Text description of the illustration collection_method_call.gif
Keyword and Parameter Description
collection_name
This identifies an index-by table, nested table, or varray previously declared within the current scope.
COUNT
COUNT returns the number of elements that a collection currently contains, which is useful because the current size of a collection is not always known. You can use COUNT wherever an integer expression is allowed.
For varrays, COUNT always equals LAST. For nested tables, normally, COUNT equals LAST. But, if you delete elements from the middle of a nested table, COUNT is smaller than LAST.
DELETE
This procedure has three forms. DELETE removes all elements from a collection. DELETE(n) removes the nth element from an index-by table or nested table. If n is null, DELETE(n) does nothing. DELETE(m,n) removes all elements in the range m..n from an index-by table or nested table. If m is larger than n or if m or n is null, DELETE(m,n) does nothing.
EXISTS
EXISTS(n) returns TRUE if the nth element in a collection exists. Otherwise, EXISTS(n) returns FALSE. Mainly, you use EXISTS with DELETE to maintain sparse nested tables. You can also use EXISTS to avoid raising an exception when you reference a nonexistent element. When passed an out-of-range subscript, EXISTS returns FALSE instead of raising SUBSCRIPT_OUTSIDE_LIMIT.
EXTEND
This procedure has three forms. EXTEND appends one null element to a collection. EXTEND(n) appends n null elements to a collection. EXTEND(n,i) appends n copies of the ith element to a collection. EXTEND operates on the internal size of a collection. So, if EXTEND encounters deleted elements, it includes them in its tally. You cannot use EXTEND with index-by tables.
FIRST, LAST
FIRST and LAST return the first and last (smallest and largest) subscript values in a collection. The subscript values are usually integers, but can also be strings for associative arrays. If the collection is empty, FIRST and LAST return NULL. If the collection contains only one element, FIRST and LAST return the same subscript value.
For varrays, FIRST always returns 1 and LAST always equals COUNT. For nested tables, normally, LAST equals COUNT. But, if you delete elements from the middle of a nested table, LAST is larger than COUNT.
index
This is an expression that must yield (or convert implicitly to) an integer in most cases, or a string for an associative array declared with string keys.
LIMIT
For nested tables, which have no maximum size, LIMIT returns NULL. For varrays, LIMIT returns the maximum number of elements that a varray can contain (which you must specify in its type definition).
NEXT, PRIOR
PRIOR(n) returns the subscript that precedes index n in a collection. NEXT(n) returns the subscript that succeeds index n. If n has no predecessor, PRIOR(n) returns NULL. Likewise, if n has no successor, NEXT(n) returns NULL.
TRIM
This procedure has two forms. TRIM removes one element from the end of a collection. TRIM(n) removes n elements from the end of a collection. If n is greater than COUNT, TRIM(n) raises SUBSCRIPT_BEYOND_COUNT. You cannot use TRIM with index-by tables.
TRIM operates on the internal size of a collection. So, if TRIM encounters deleted elements, it includes them in its tally.
Usage Notes
You cannot use collection methods in a SQL statement. If you try, you get a compilation error.
Only EXISTS can be applied to atomically null collections. If you apply another method to such collections, PL/SQL raises COLLECTION_IS_NULL.
You can use PRIOR or NEXT to traverse collections indexed by any series of subscripts. For example, you can use PRIOR or NEXT to traverse a nested table from which some elements have been deleted.
EXTEND operates on the internal size of a collection, which includes deleted elements. You cannot use EXTEND to initialize an atomically null collection. Also, if you impose the NOT NULL constraint on a TABLE or VARRAY type, you cannot apply the first two forms of EXTEND to collections of that type.
If an element to be deleted does not exist, DELETE simply skips it; no exception is raised. Varrays are dense, so you cannot delete their individual elements.
PL/SQL keeps placeholders for deleted elements. So, you can replace a deleted element simply by assigning it a new value. However, PL/SQL does not keep placeholders for trimmed elements.
The amount of memory allocated to a nested table can increase or decrease dynamically. As you delete elements, memory is freed page by page. If you delete the entire table, all the memory is freed.
In general, do not depend on the interaction between TRIM and DELETE. It is better to treat nested tables like fixed-size arrays and use only DELETE, or to treat them like stacks and use only TRIM and EXTEND.
Within a subprogram, a collection parameter assumes the properties of the argument bound to it. So, you can apply methods FIRST, LAST, COUNT, and so on to such parameters. For varray parameters, the value of LIMIT is always derived from the parameter type definition, regardless of the parameter mode.
Examples
In the following example, you use NEXT to traverse a nested table from which some elements have been deleted:
i := courses.FIRST; -- get subscript of first element
WHILE i IS NOT NULL LOOP
-- do something with courses(i)
i := courses.NEXT(i); -- get subscript of next element
END LOOP;
In the following example, PL/SQL executes the assignment statement only if element i exists:
IF courses.EXISTS(i) THEN
courses(i) := new_course;
END IF;
The next example shows that you can use FIRST and LAST to specify the lower and upper bounds of a loop range provided each element in that range exists:
FOR i IN courses.FIRST..courses.LAST LOOP ...
In the following example, you delete elements 2 through 5 from a nested table:
courses.DELETE(2, 5);
In the final example, you use LIMIT to determine if you can add 20 more elements to varray projects:
IF (projects.COUNT + 20) < projects.LIMIT THEN
-- add 20 more elements
Related Topics
Collections, Functions, Procedures
http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96624/13_elems7.htm#33054
Joel P�rez -
Everytime I go to my home page, this Inbox screen comes up. I uninstalled the program, but it still comes up, implying that it is embedded in something else. I want to be able to simply go to my web browser, Yahoo, when I click on my home button.
I finally got a hold of someone at that search us.com. They gave me this link to try and solve the problem. I have already reinstalled firefox but it might help someone else out. And it's much simpler. I haven't tried it but they said to get a hold of them if it didn't work. the link is:
Running ResetBrowsers.exe from http://support.search.us.com/uninstall.php should restore your settings to their defaults
Hope I'm not misusing this post. Thanks again for all your help. Your are all awesome. -
How do I get rid of a search engine that has taken over Firefox?
I have a problem similar to the "Abuchak" problem listed in your forums. This is something different though. When I am at Yahoo or Google, I click a link and it takes me to another search listing. Sometimes it takes me to various sites where Avast (virus proggy) tells me it has blocked a malicious virus.
The last website it sent me to was http://64.111.211.188
I can, however, highlight the website under the link and paste it in the address field and that works out, but that's a pain. This has been going on for 2 weeks.
I have run Spybot, SpySweeper & Ad-Aware but it doesn't help.
How can I keep this software from taking over Firefox?
Please help. Thanks.Uninstall the "ConnectBar" extension, you may have to reset [http://kb.mozillazine.org/About:config_entries keyword.URL] in your '''about:config''' afterwards or change to a value you prefer for [http://kb.mozillazine.org/Location_Bar_search#Location_Bar_search_.28external_-_search_engine.29 Location bar searches].
The extension is not at Addons, it may have been obtained from an [http://www.facebook.com/pages/ConnectBar/156184567774985 advertisement] on Facebook. -
10g R2 problem: CREATE VIEW
Hello,
I noticed with 10g R2 SE that the RESOURCE Role no longer contains the "CREATE VIEW" Privilege. On Standard Edition this is not that bad, cause we use user defined roles anyway. However since the GUI of XE is optimized for CONNECT/RESOURCE/DBA is really bad, that you cant create views as the RESOURCE user.
It helps to run
GRANT CREATE VIEW TO "RESOURCE";
Greetings
Bernd
Chief Architect (R&D) SEEBURGER AG - http://www.seeburger.com
German Personal IT-Blog http://itblog.eckenfels.netNot sure if I get this right... but.
When going through the user creation wizard in the web gui there are three roles checkboxes to grant the user RESOURCE, CONNECT and DBA roles.
What is not listed is that the user will be granted a number of "plain" priviledges as well when the user logins in to HTMLDB the first time.
So even if the role CONNECT role lacks the "CREATE VIEW" priviledge the user will still be granted "CREATE VIEW", given that the user login to HTMLDB at one point.
I think Bernds' point is this;
When creating a user in sqlplus and granting the RESOURCE, CONNECT roles in 9i the user had the "CREATE VIEW" priv from the CONNECT role, however in 10g the user doesn't.
When creating a user in HTMLDB in XE the user do have the "CREATE VIEW" privilege (where the sysdba user only sees the RESOURCE and CONNECT roles as checkboxes, not the list of plain privileges granted).
-- Example scenario --
I use the HTMLDB Create user feature to create 'SALLY'.
In my ssh window running sqlplus I do:
SQL> select GRANTEE, PRIVILEGE from dba_sys_privs where grantee='SALLY';
GRANTEE PRIVILEGE
SALLY UNLIMITED TABLESPACE
Ok, all good.
Now I login to HTMLDB as Sally, just looking at the first screen, I do nothing else.
Back to my SSH window.
SQL> select GRANTEE, PRIVILEGE from dba_sys_privs where grantee='SALLY';
GRANTEE PRIVILEGE
SALLY CREATE TABLE
SALLY CREATE SEQUENCE
SALLY CREATE JOB
SALLY CREATE TRIGGER
SALLY CREATE PROCEDURE
SALLY CREATE CLUSTER
SALLY UNLIMITED TABLESPACE
SALLY CREATE MATERIALIZED VIEW
SALLY CREATE DIMENSION
SALLY CREATE INDEXTYPE
SALLY CREATE LIBRARY
SALLY CREATE DATABASE LINK
SALLY CREATE SYNONYM
SALLY CREATE ANY CONTEXT
SALLY CREATE TYPE
SALLY CREATE OPERATOR
SALLY CREATE VIEW
17 rows selected.
Why is Sally granted 16 roles just by logging in to HTMLDB?
This this a feature or a bug? ;) -
Error while creating the view from one instance to another instance
Hi Experts
I want to Create a view which reside in one instance for example xxx Instance . I want to create the same view which reside in xxx instance to another instance for example YYY Instance How to acheive this ?
I tried desc the View take the view script from XXX instance and copied the view script to YYY instance when I compiled Iam getting an Error
For Example My view in XXX Instance
CREATE OR REPLACE FORCE VIEW xxx.sample
First_name,
last_name
as
select "F_NAME",
"L_NAME"
FROM EMP;When try to copy and compile the same view in my YYY Instance
i am getting error
ORA: table or view does not exist
Advance Thanks
ATA.T wrote:
Hi Experts ,
Thanks For all your valuable information I amTrying Of DB Link i think so
As per My understanding If wrong anywhere please advice me
Here Instance is Like : One DB 10g divided into several Instance like (test , devlopement , production Instance)
Now hope i ll make my req clear .
Coming to my reqirement
the actual table EMP is in xxi.TEST (Here xxi => Schema and test is an Instance )
I want to create the view which is based on by table EMP which in my test instance to devoplment instance
For example xxo.development (here xxo => Schema and development is an Instance )
Need to access the xxi schema in Test Instance How can I create a DB Link please share your ideas and advice me
Advance Thanks
ATIt's still not at all clear, but let me outline what I think you are after
Given a database, ORCL_A
In database ORCL_A we have a schema, HALFTRACK
User HALFTRACK has a table, MYSTUFF
Given a database, ORCL_B
In database ORCL_B we have a user GREENBRASS
User GREENBRASS needs to be able to query the table HALFTRACK.MYSTUFF.
In database ORCL_B, as user GREENBRASS
create database link mylink
connect to halftrack identified by halftracks_pswd
using ORCL_A;
select * from mytable@mylink;The db link defines a connection specification to ORCL_A, using the credentials of a user on ORCL_A. The target of the USING clause in the link definition must be an entry in the tnsames.ora file on the server hosting database ORCL_B.
When querying through the link, database ORCL_B is simply acting as a client to ORCL_A, no different that a sqlplus session on ORACL_B's server. As far as ORCL_A is concerned, ORCL_B is just another client requesting a connection, connecting with the credentials defined in the link definition. -
Create view and alter Session gets 0RA-01031
I can't create a view after using ALTER SESSION set current_schema without using an explicit schema. I get ORA-01031. Is this a known bug? Here are the details:
1. Log on as SYSTEM
2. ALTER SESSION set current_schema=FRED;
3. CREATE VIEW vFoo as select * from Foo; -- ORA-01031: insufficient privileges
4. CREATE VIEW FRED.vFoo as select * from Foo; -- this works!
I've read where some privileges need to be granted directly. In fact, if Fred grants select privilege on Foo to SYSTEM, the statement in #3 above works. However, something doesn't seem right because why does #4 succeed without the GRANT?
In case you're wondering why I don't just use #4 above, which does work, it's because I've got a script that will be run by customers to create tables, views, etc. in an arbitrary schema and the schema is associated with a user with limited permissions. Hence, the use of the ALTER SESSION.See, You looged as SYSTEM (Scheme = SYSTEM)
Now you alter your session to another schema FRED.
Now if you want to access SCHEMA of FRED, You need to connect first.
SQL > connect user/password@host
Then
SQL > CREATE VIEW vFoo as select * from Foo;
View created. -
How to Get Most Current User View Before Checking In.
Hi,
We have several custom workflows which users can start from end-user menu and have some resource accounts created/modified after approvals.
User view is checked out once at the beginning of each workflow, then some user attributes are modified through forms and user view is checked in with new attributes at the end.
If any user starts a workflow (say W2) before completion of another workflow (say W1) he started before, and W1 is completed when W2 is waiting for approvals or etc., W2 completely discards changes made to user view through W1 since it has already checked out the user view before.
If I checkout the user once more just before checkin, I'm able to get a current user view but this time changes made through forms used in the current workflow are lost.
What's the best way, to get an updated user view of the user without overwriting any changes made out of the running workflow and losing form data?
Regards,
Mehtap.In a situation like this, you should probably change the front end to store the changes in workflow variables instead of using the view directly. Then, post approval, you checkout the view and apply the changes. I've used this approach to perform changes on large numbers of users (kind of like a bulk action, only more reliable).
Alternatively, you can checkout the user object at the beginning of the workflow, and this will prevent your race condition by putting a lock on it. This will obviously cause problems (for you) if your users expect to be able to do multiple changes simultaneously. Don't try this approach if an angry mob will storm your cubicle -- IDM coders are hard to come by.
Jason -
Is it possible to grant users to create views only?
We are using SQL Server 2008 R2.
Some advanced users have been working on the database to retrieve data from tables and alter existing views for years. Now we would like to give them permissions to create their own views.
It is not supposed to give them too much rights such as creating tables. Is it possible to do that, such as creating new schema for that purpose. Thanks.You left out an important step that we failed to mention: you muist change the order of the schema. This is required, or else ownership chaining will void all security checks.
In script below, you get a permission error trying to create the first view, but comment out the ALTER AUTHORIZATION statement and it will not.
Using a loginless user and EXECUTE USER is an execellent way to test a permission setup on database level.
CREATE DATABASE yngve
go
USE yngve
go
CREATE SCHEMA torsten
go
CREATE USER ulrik WITHOUT LOGIN WITH DEFAULT_SCHEMA = torsten
GRANT SELECT ON SCHEMA::torsten TO ulrik
GRANT ALTER ON SCHEMA::torsten TO ulrik
GRANT CREATE VIEW TO ulrik
ALTER AUTHORIZATION ON SCHEMA::torsten TO ulrik
go
CREATE TABLE dbo.alfa(a int NOT NULL)
INSERT dbo.alfa(a) VALUES (88)
go
EXECUTE AS USER = 'ulrik'
go
CREATE VIEW torsten.albin AS SELECT a FROM dbo.alfa
go
SELECT * FROM torsten.albin
go
CREATE VIEW torsten.alfons AS SELECT getdate() AS today
go
SELECT * FROM torsten.alfons
go
REVERT
go
USE tempdb
go
DROP DATABASE yngve
Erland Sommarskog, SQL Server MVP, [email protected]
Thanks. I have tried to create a login less account.
CREATE USER [testuser] without login WITH DEFAULT_SCHEMA=[SchemaTest]
GOGRANT SELECT ON SCHEMA :: SchemaTest TO [testuser]
GO
GRANT ALTER ON SCHEMA :: SchemaTest TO [testuser]
GOGRANT CREATE VIEW TO [testuser]
GO
ALTER AUTHORIZATION ON SCHEMA :: SchemaTest TO [testuser]
GO
Without "ALTER AUTHORIZATION" statment, user can create SchemaTest.v_MyView and select all data.
With "ALTER AUTHORIZATION" statment, user can still be able to create SchemaTest.v_MyView, but unable to select retrieve data from the view. The error is as below.
The SELECT permission was denied on the object 'MyTable', database 'ViewTest', schema 'dbo'.
Maybe I still miss something. But at least user cannot retrieve protected data. -
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? -
I am on Oracle 11.1.1.7 BPM suite on W8 64 bit. I can't launch the flow trace and get the error "Unable to get the composite instance for the invocation. This could be because instance has not yet been created or because the audit level for the SOA infra has been set to Off". I have set the audit level to development at the soa-infra>SOA Administration> Common Properties > Audit level set to development and Capture Composite Instance State is Checked.
Can somebody advice.
ThanksCan you please confirm me the following steps...
Log in to the EM console, Expand soa-infra (soa_server1) , go to the partition where your composite is been deployed, Click on your composite, On the right, click on the dropdown Settings and choose Composite Audit Level. you can choose to set the Audit Level for this composite. If you choose Inherit, it will take the settings to what the server is being set to. Otherwise, we can override it by choosing Off, Production, or Development.
Make sure your setting for that composite is not Off, keep inherit or production or development.
Thanks,
N -
List View Filter - I want to create List View based on a specific user
I want to create a List View Filter based on specified user ID. I dont want to specify the [Me] for filtering the view based in current logged in User.
I want the view to be based on specific user ID for Ex: "AD\JohnDoe"
Thanks
NateThe People/Group Picker field has several options for how the name is displayed. For example you can set it to be the friendly name or the account name. When you create your View Filter, make sure that you are using the same format as the field's display
type.
Dimitri Ayrapetov (MCSE: SharePoint)
Maybe you are looking for
-
Hi, I am facing an issue with the implementation of "Execute As" clause.Following is my code GRANT IMPERSONATE ON USER:: SQL_AUTH TO [DOM\WINDOWS_AUTH]; EXECUTE AS USER = 'SQL_AUTH' SELECT Pwd FROM Master.dbo.Pwd_Store The SELECT permission was denie
-
Regarding translation package...
Hi, Did any one worked on traslation package.Please help how to work out on translation package(Transaction SLWA). Rgds, Sunil.K
-
We want to translate the objects of an existing room. Is it possible? I also find no way to translate an existing template. Any ideas? EP6 SP2 Patch 29 Bye Sybille
-
Need to create a flat file source system in bi?
Hi all, i need to load the data from a flat file to an ods? can anyone pls tell me the steps to create the flat file source system in bi? Thanks
-
i bought the family pack version but when I install I am being asked for serial number, but nothing was provided