SQL Report From Another Schema
Is there anyway to select a table from another schema?I have a default schema for my application but i want each user to use their own schema.
I'm looking for something like #OWNER#.table_name but replacing #OWNER# with the name of another schema in the workspace.
Kind Regards,
BgUrsea
APEX 4.0 10g XE
Hello BgUrsea,
you could achieve this by granting the needed privileges (e.g. select, insert, update, delete) on each table in the #OWNER#-schema to your applications parsing schema.
If you can't use a direct mapping (e.g., you can't assign the schema name of a user as usernames for his application user), you probably need a mapping table in your parsing schema. Define an application item (e.g. "F_OWNER") and create a application computation that executes "On New Instance" and does something like
SELECT schema
FROM mapping_table
WHERE owner=v('APP_USER');If you aren't sure you always have a mapping, you might think about an application process that not only computes the value but also handles the action to be performed in case there is no mapping for a user.
But I suppose it could be easier to have a copy of you application for each user and assign the appropriate schema to each copy. That way, you don't need the mapping, you don't need to care about always using the #OWNER# when developing your application, and of course, no user can (not even accidently) access another users (or your default) schema.
-Udo
Similar Messages
-
Calling a report from another report
Hi,
Is there any way ,(any built in ) to call a report from another report in Report Builder 2000 and Report Builder 6i.
RegardsTry to call report from report by a button in the calling report:
1 In the Layout Model view, click in the tool palette. Note
2 Click and drag a rectangle.
3 Double-click the button object to display the Property Palette.
4 Under the Button Label node, set the Label Type property to either Text or Icon:
n If the button label is text, set the Text property to the text you want to appear on the button.
n If the button label is an icon, set the Icon Name property to the name of the file containing the icon (the file must reside in the directory specified by the UI_ICON environment variable).
5 Under the Button Behavior node, set the Type property to PL/SQL.
6 Double-click the PL/SQL Trigger property value field.
7 In the PL/SQL Editor, define the PL/SQL for the action trigger or format trigger when the button is clicked in the formatted report.
8 Set other properties as desired.
9 To activate the button, run the report, then display it in the Runtime Previewer. -
Calling a Report from another Report.....URGENT
Hi,
I am calling a report from another report using hyperlink. I want that this new report should come in a new page.
Can any body help me where i can set this property, so that the new report will open in a new page.
Thanks in advance
Regards
KamalTry to call report from report by a button in the calling report:
1 In the Layout Model view, click in the tool palette. Note
2 Click and drag a rectangle.
3 Double-click the button object to display the Property Palette.
4 Under the Button Label node, set the Label Type property to either Text or Icon:
n If the button label is text, set the Text property to the text you want to appear on the button.
n If the button label is an icon, set the Icon Name property to the name of the file containing the icon (the file must reside in the directory specified by the UI_ICON environment variable).
5 Under the Button Behavior node, set the Type property to PL/SQL.
6 Double-click the PL/SQL Trigger property value field.
7 In the PL/SQL Editor, define the PL/SQL for the action trigger or format trigger when the button is clicked in the formatted report.
8 Set other properties as desired.
9 To activate the button, run the report, then display it in the Runtime Previewer. -
Cant view objects from another schemas
Hi everybody!
I have a 10.1.2 Jdeveloper and a 9.2.4 Oracle database.
I successfully created a database connection.
With provided login I can access to tables from another schemas in SQL Worksheet, but I cant see any objects from those schemas in the connection tree.
What's wrong?The Schemas are being filtered so that you only automatically see the schema for the connection that you logged on with. To change the schemas that are visible you need to :
1) Select the connection name in the Navigator (you should see that it has a filter icon overlaid showing that it is being filtered)
2) Invoke the context menu and select 'Apply filters'
3) Shuttle over the other Schemas you wish to see and press OK
Regards,
Lisa Sherriff
JDev QA -
How can i access all the objects of one schema from another schema
Dear All,
How can i access all the objects(Tables,Views,Triggers,Procedures,Functions,Packages etc..) and do the modifications of one schema from another schema (Without using synonyms concept).
Thanks in advance,
MahiFirst of all, synonyms only help you easy reference the object. It doesn't have any implication of object privilege.
As long as you have proper privilege on target object. You can access it with or without synonyms.
Assuming you have proper privilege of objects, you can use following command to assume schema owner.
ALTER SESSION SET CURRENT_SCHEMA = Schema_owner -
Regarding calling 1 report from another
Hello Friends,
Can u plz tell me how to call one report from another report.
Regards,
Drashanahi,
Use SUBMIT program statement
SUBMIT ZFIR001
chk this.
*Code used to populate 'select-options' & execute report
DATA: seltab type table of rsparams,
seltab_wa like line of seltab.
seltab_wa-selname = 'PNPPERNR'.
seltab_wa-sign = 'I'.
seltab_wa-option = 'EQ'.
load each personnel number accessed from the structure into
parameters to be used in the report
loop at pnppernr.
seltab_wa-low = pnppernr-low.
append seltab_wa to seltab.
endloop.
SUBMIT zreport with selection-table seltab
via selection-screen.
*Code used to populate 'parameters' & execute report
SUBMIT zreport with p_param1 = 'value'
with p_param2 = 'value'.
Other additions for SUBMIT
*Submit report and return to current program afterwards
SUBMIT zreport AND RETURN.
*Submit report via its own selection screen
SUBMIT zreport VIA SELECTION-SCREEN.
*Submit report using selection screen variant
SUBMIT zreport USING SELECTION-SET 'VARIANT1'.
*Submit report but export resultant list to memory, rather than
*it being displayed on screen
SUBMIT zreport EXPORTING LIST TO MEMORY.
Once report has finished and control has returned to calling
program, use function modules LIST_FROM_MEMORY, WRITE_LIST and
DISPLAY_LIST to retrieve and display report.
\[removed by moderator\]
rEGARDS
Edited by: Jan Stallkamp on Jul 29, 2008 5:25 PM -
Can we run one report from another Report in reports 6i
Actually my requirement is i want to run 4 reports from another report(driver report) by passing parameter same as the driver report.
i want to see the out put on the screen report by report next to driver report output.is it possible?? actually i got the solution for printing or taking file. but i want to show the output on the screen.
Edited by: user9165808 on Feb 16, 2010 3:21 AMI used SRW.RUN_REPORT () . But my question that is it possible to show report in batches on screen??
Edited by: user9165808 on Feb 19, 2010 4:23 AM -
Selection from Another schema by default without schema name qualifier.
Hi
Oracle10g release 2, LinuxOS
i want my schema (User_1) to always select,insert, update, delete the objects from another schema (User_2) without passing full schema qualifier every time whenever i don't pass any schema name explicitly.
i.e. if i pass the following guerry
select * from table_a;
the table of user User_2.table_a (User_2.table_a) will be queried by default instead of table (User_1.table_a)
and the same implementation is also required in Functions , procedures, sequences etc.
WishesThree relatively easy options
1) Create private synonyms in User_1's schema for each object in User_2's schema, i.e.
CREATE SYNONYM table_a
FOR user_2.table_a2) Create public synonyms for each object in User_2's schema. This will make it possible for all users to query user_2's objects without specifying the schema name
CREATE PUBLIC SYNONYM table_a
FOR user_2.table_a3) Change the current schema for the session (potentially in a login trigger)
ALTER SESSION SET current_schema = USER_2There are other options that are a bit more complicated like using enterprise users with shared schemas. But most people are perfectly happy with one of these three.
Justin -
If I want to select table from another schema, I have to type
select * from [username].table_name.
What can I do inorder not to write shema name all the time.
for instance:
instead of writing
select * from [username].table_name.
select * from table_name.create synonym for the object in other schema:
create synonym <syn-name> for schema.tablename;
then use syn-name in place of schema.tablename in ur query
like
select * from syn-name; -
Calling one WAD Report from another WAD Report
Hi All,
I want to Call one WAD report from another WAD Report and I want to show that Report in a Container of the Calling Report Itself. Kindly give the Solution. Thanks for your support in advance.
Thanks & Regards
ShivaHi Shiva,
There is Command called "SET_TEMPLATE" Set Web Template.
Here you can select any of your existing web template and choose to open it in current page of in a new window.
Hope it helps.
Regards,
Pratap Sone -
How to pass a bind variable from one SQL Report to Another
Hello~
I've created a link on one SQL Report page (Page 1). I would like a value from Page 1 used in the SQL on Page 2 to determine the result set. The Where Clause in SQL Query containing the bind variable is as follows:
AND hp.party_name = ':District_Account'
When I run Page 1 and click on the link to execute Page 2, I get 'No Data Found'. The setup of the link is as follows:
Column_Name = District_Account
Link Text = #District_Account#
Target = Page in this application
Page = 2
I'm a rookie working in V1.6...any help would be greatly appreciated!
Thanks,
BeckyI don't see any parameter being passed in that URL. A little sample: http://htmldb.oracle.com/pls/otn/f?p=33203:4<br>
when you click on the edit link the URL looks like this:<br>http://htmldb.oracle.com/pls/otn/f?p=33203:5:16073998852455071705::NO:5:P5_TABLE_NAME,P5_OWNER:PRESIDENTS_THEMES%2CBLUETEST<br><br>
where P5_TABLE_NAME and P5_OWNER are the items and PRESIDENTS_THEMES and CBLUETEST are the values.<br><br>
The SQL on the filtered report looks like:<br>
SELECT *
FROM all_tab_cols
WHERE table_name = :P5_TABLE_NAME
AND owner = :P5_OWNER<BR><BR> -
Create stored procedure with table from another schema throws PLS-00201
Oracle 10g. I'm new to procedures, so maybe I'm missing something obvious.
Schema owner ABC has table T2001_WRITEOFF. The SYSDBAs granted SIUD to Some_Update_Role, and granted that role to developer user IJK. User IJK then created a private synonym T2001_WRITEOFF for ABC.T2001_WRITEOFF. This worked with normal SQL DML commands.
When I try to create a simple procedure as follows, it throws PLS-00201 identifier 'T2001_WRITEOFF' must be declared, and points to the 2nd line.
create or replace procedure woof1(
fooname in T2001_WRITEOFF.territory%TYPE, <=== error points here
bardesc IN T2001_WRITEOFF.ind_batch_submit%TYPE) IS
BEGIN
INSERT into T2001_WRITEOFF
VALUES ( fooname, bardesc);
END woof1;
What am I doing wrong?
Thanks
JimRHi,
The reason I've heard has to do with knowing when a procedure becomes invalid due to privileges being revoked. Any time a grant to a role is revoked, you would have to check all procedures that depended on that role to know if they were still valid. Even worse, since roles can be granted to other roles, every time a role is revoked from another role, you would have to check all procedures that depended on anything to see if they were still valid.
Oracle 11 behaves the same as earlier versions in this regard, and I don't expect this to change.
This whole thread applies only to AUTHID DEFINER stored procedures (which is the default). If you can make the procedure AUTHID CURRENT_USER, then you can run it with privileges granted through roles. Usually, however, you really want AUTHID DEFINER, and granting the necessary privileges directly to the procedure owner (or to PUBLIC) isn't too hard. -
How to defer constraint of one schema from another schema
Hi All,
I am having a requirement of migrating data from one schema(SCHEMA_A) to another schema(SCHEMA_B). So I tried to implement the same using PL/SQL.
Because of foreign key contraint while migrating child table, Oracle throws an error message like parent key not available.
So I tried to set the all contraints to deferred and after completion of migration i planned to set all the contraints to immediate.
But Here I am executing the procedure from schema(SCHEMA_C) which has rights to access SCHEMA_A and SCHEMA_B.
How could I able to defer all the constraint in SCHEMA_B from SCHEMA_C?
Thanks in Advance,
Antany.Yes,
You could run something like this, for foreign keys:
BEGIN
FOR cur_rec IN (SELECT table_name, constraint_name FROM DBA_CONSTRAINTS WHERE OWNER = <owner> AND CONSTRAINT_TYPE = 'R' )
LOOP
EXECUTE IMMEDIATE 'ALTER TABLE <owner>.' || cur_rec.table_name || ' DISABLE CONSTRAINT ' || cur_rec.constraint_name;
END LOOP;
END;
/ -
Calling PL/SQL Procedure In Another Schema Gives Unexpected Result
I have a SQL Script that does this:
conn pnr/<password for user pnr>;
set serveroutput on;
exec vms.disable_all_fk_constraints;
SELECT owner, constraint_name, status FROM user_constraints WHERE constraint_type = 'R';
and the disable_all_fk_constraints procedure that is owned by user 'vms' is defined as:
create or replace
procedure disable_all_fk_constraints is
v_sql VARCHAR2(4000);
begin
dbms_output.put_line('Disabling all referential integrity constraints.');
for rec in (SELECT table_name, constraint_name FROM user_constraints WHERE constraint_type='R') loop
dbms_output.put_line('Disabling constraint ' || rec.constraint_name || ' from ' || rec.table_name || '.');
v_sql := 'ALTER TABLE ' || rec.table_name || ' DISABLE CONSTRAINT ' || rec.constraint_name;
execute immediate(v_sql);
end loop;
end;
When I run the SQL script, the call to vms.disable_all_fk_constraints disables the FK constrains in the 'vms' schema, whereas I wanted it to disable the FK constraints in the 'pnr' schema (the invoker of the procedure). I know that I could make this work by copying the disable_all_fk_constraints procedure to the 'pnr' schema and calling it as "+exec disable_all_fk_constraints;+" from within the SQL script but I want to avoid having to duplicate the PL/SQL procedure in each schema that uses it.
What can I do?
Thank youYou have two issues to solve.
First you need to write a packaged procedure that works with INVOKER rights. The default is DEFINER rights.
The difference is excatly what you need. Usually the package has the rights from the schema where it is defined (=Definer rights). In your case schema VMS. Whereas you need the privileges from the user that calls the package (PNR).
=> Check out the documentation for INVOKER rights
The second problem is that the view "user_constraints" will not give the results you expect when called from inside a procedure in another schema. An alternative could be to use the view DBA_CONSTRAINTS with a filter on the owner (where owner = 'PNR'). Not sure if there are other working possibilities. Well you could create a list of constraint names that you want to disable, instead of creating the list dynamically.
And you could have another potential disaster creeping up upon you. If you run this thing, then at this moment you don't have any referential integrity anymore. You can't be sure that you can create the FKs again after this action. This is EXTREMLY DANGEROUS. I would never ever do this in any kind of production or test database. I would be very careful when I do it on a development database. -
To kill session in one schema from another schema
Hi Team,
I got a problem like a table from one of my schema has been locked. I am getting 'ORA-00054: resource busy and acquire with NOWAIT specified' error when trying to delete rows from that table or even when trying to truncate that table.
Let the table be 'T1' present in schema 'VIEW'
I tried to kill the session which is active for that schema by below query
select sid,serial#,status from v$session where username='VIEW' and STATUS = 'ACTIVE';
alter system kill session '681,2586';
But i couldn't do the above as i don't have DBA privilege for that. But i have DBA privilege for another schema let it be 'ADMIN'
Now how can i kill the session in schema 'VIEW' from schema 'ADMIN'
can any one get me solution.
Thanks in Advance
11081985I got a problem like a table from one of my schema has been locked. I am getting 'ORA-00054: resource busy and acquire with NOWAIT specified' error when trying to delete rows from that table or even when trying to truncate that table.
Before you do anything why don't you actually find out WHY that table has been locked.
You generally should NOT be killing sessions without knowing what is causing the problem to begin with.
Then you also need to determine if you should use KILL SESSION or instead use DISCONNECT SESSION and well as whether the use of IMMEDIATE is appropriate.
Each of those choices acts differently. Many people use KILL when they should really use DISCONNECT.
See DISCONNECT SESSION Clause and KILL SESSION Clause in the ALTER SESSION chapter of the SQL Language doc
http://docs.oracle.com/cd/E11882_01/server.112/e17118/statements_2014.htm#i2282145
Maybe you are looking for
-
Hi! So i think i closed the wrong service at some point a few weeks back (apple mobile device) but iTunes remained working after that for another week. I then updated iTunes and i get the same "Service 'Apple Mobile Device' (Apple Mobile Device) fai
-
To find open line items as in FS10N
Hi Friends, I need your advise since I don't know the accounting funtionality happening in FS10N open items with standard tables (open items). The open line items available or showing in FS10N which is not stored in open item tables like BSIS,BSID or
-
Here is my code, I thought I was doing this right but can't get this to show up import javax.swing.*; import java.awt.event.*; import java.awt.*; * @author Administrator public class EditFrame extends JFrame{ LP editing_lp; JPanel editing_pa
-
What are SERIALLY_REUSABLE and RESTRICT_REFERENCES pragmas and when used?
Hi everyone, I have recently joined in Discussion forums and My question is about SERIALLY_REUSABLE and RESTRICT_REFERENCES pragmas. what are these pragmas and when can we use them? please give me practical example as I have understood them in Oracle
-
Buying from the USA an iPad Air. Will it work in Russia?
Hello. My friends are going to the USA, so I asked they to buy a iPad Air 64gb WiFi+4G. After one day I visited Apple site and go to a purchase page. There, after choosing WiFi+Cellurar model, was the plate with a choice of the operators (AT&T, Vers