Query to find the Base tables of views
Hi,
Can you pl let me know the query to find the base tables on which the view is based.I looked into views like ci_view_definitions but i could not find them.
Thanks for your help
thanx,
Suji.
select vw.name viewname, nvl( tabdef.name, vwdef.name) "based on"
from ci_view_definitions vw
, i$sdd_vwtab
, ci_view_definitions vwdef
, ci_table_definitions tabdef
where view_ref = vw.id
and table_ref = tabdef.id (+)
and table_ref = vwdef.id (+)
Similar Messages
-
Finding the base tables of a database view
Hi
I have a database view like VIQMEL, VIQMSM .So how can i find the what are the base tables for these views.
pls let me know
kumarHi ,
In SE11,
1. Type in VIQMSM.
2. Display
3. you have a tabe "Table & Join Condition.... to list all the releated tables for this view...
If the hint is useful Say thanks by reward .
Regards,
Prabhu Rajesh -
Query to find the Salary table details HRMS 11i
I am looking query to find the persons salary details in Oralce EBS 11i.
I tried the below query bu it didn'ty work.
SELECT papf.employee_number
,papf.full_name
,pj.NAME job
,haou.NAME ORGANIZATION
,ppp.proposed_salary_n salary
FROM per_all_people_f papf
,per_all_assignments_f paaf
,per_jobs pj
,hr_all_organization_units haou
,per_position_definitions ppd
,per_all_positions pap
,per_pay_proposals ppp
WHERE 1 = 1
AND SYSDATE BETWEEN papf.effective_start_date AND papf.effective_end_date
AND papf.current_employee_flag = 'Y'
AND papf.employee_number IS NOT NULL
AND paaf.person_id = papf.person_id
AND SYSDATE BETWEEN paaf.effective_start_date AND paaf.effective_end_date
AND paaf.job_id = pj.job_id
AND paaf.organization_id = haou.organization_id
AND paaf.position_id = pap.position_id
AND pap.position_definition_id = ppd.position_definition_id
AND ppp.pay_proposal_id = (SELECT MAX (pay_proposal_id)
FROM per_pay_proposals
WHERE assignment_id = paaf.assignment_id)
In our case all the below tables have 0 records..
select count(*) from PER_PAY_PROPOSALS ;
COUNT(*)
0
select count(*) from pay_element_entry_values_f;
COUNT(*)
0
select count(*) from PAY_ELEMENT_ENTRY_VALUES_F;
COUNT(*)
0
select count(*) from PAY_ELEMENT_ENTRIES_F;
COUNT(*)
0Hi,
Your results clearly states that there is no salary data which is been captured as well as there are no element entries which are assigned to any assignment.
Please do the below which will insert records in salary as well as element entries table:
1. Add a salary proposal to any active employee (People Enter and Maination --> Search for any employee --> Assignment --> Salary) - This will insert a record in PER_PAY_PROPOSALS table
2. Add an element entry to any active assignment (People Enter and Maination --> Search for any employee --> Assignment --> Entries) - This will insert a record in PAY_ELEMENT_ENTRIES_F and PAY_ELEMENT_ENTRY_VALUES_F table
Hope this clarifies.
Thanks,
Sanjay -
Query to find the biggest table in the database..!!!
Hello everybody,
i have more than 600 tables in the database i need to find the biggest table in the database and want to order it in descending pattern..
Is there any query for this task...
Rgds
Harsh.What version of Oracle? Do you use the CBO or the RBO? If you use the CBO, are your statistics accurate? Can you tolerate having approximate rowcounts?
SELECT table_name, num_rows
FROM user_tables
ORDER BY num_rowsmay be what you're looking for, but
- num_rows is populated when you gather statistics, so it'll be empty if you're using the RBO
- num_rows may be an approximate number, depending on how you're gathering statistics
- num_rows only reflects the size at the instant you gathered statistics. It is not maintained in real time.
I'm guessing, though, that this is close enough for whatever you're doing.
Justin -
List the base tables of a view
Hi All,
I have a view but I do not have any information about the base tables and the query that was used to set up this view. Is there a way to atleast list the base tables on which the view was created!
Thanks in advance!
~SQL> desc user_source
Name Null?
Type
NAME
ARCHAR2(30) - > Name of the View.
TYPE
ARCHAR2(12)
LINE
NUMBER
VARCHAR2(4000) -> will give you the text to
create the View.-----------------------------------------------------------------------------------------------------------------------
For some reason the view I have is not listed in the NAME .. -
How to update view without modifying the base table ?
Hi Experts , I need help in two qurstions
1. How to update a view without modifying the base table ?
2. How to write a file unix operating system in pl/sql ? is there any built in procedure is there ?
Thank youHi,
I'm not sure what you're asking in either question. It would help if you gave a specific example of what you want to do.
SowmyRaj wrote:
Hi Experts , I need help in two qurstions
1. How to update a view without modifying the base table ?You can't.
Views don't contain any data; they just query base tables.
You can change the definition of a view (CREATE OR REPLACE VIEW ...) so that it appears that the base table(s) have changed; that won't change the base tables.
2. How to write a file unix operating system in pl/sql ? is there any built in procedure is there ?The package utl_file has routines for working with files. -
How to find out the query is accessing the DB tables or not
Hi Gurus ,
How to find out the query is accessing the DB tables or not.
Where exactly we will find this information in SAP BW.
I know that this information we can find in ST03. But where exactly we will find the query information along with DB information?Lakshmi
Activate BI Technical Content for Query analysis and run query against that.
Hope this helps
Thanks
sat -
Query to find the no of columns in a table
Is there a query to find the total number of columns in a table?
Dou you know read?
-- the number of rows in a table named yourtable:
select count(1) from yourtable;
-- the number of columns in a table
-- If is a user's table:
select count(1)
from user_tab_columns
where table_name='YOURTABLE'
--If it is´t
select count(1)
from DBA_tab_columns
where owner = 'USEROWNER'
and table_name='YOURTABLE' -
When I run the code below I get the following error:"RUN-TIME ERROR '3078': The Microsoft Access database engine cannot find the input table or query 'False'. Make sure it exists and that its name is spelled correctly. Note that I do not call
anything by the name of "false" anywhere in this code.
The subject code (the underscored line of code is highlighted in the debugger when the error occurs):
Option Compare Database
Private Sub JobAssign_Click()
MatLotListAvail_openform
End Sub
Function MatLotListAvail_openform()
Dim dbsAPIShopManager2010 As DAO.Database
Dim rstMaterialLotJobJoint As DAO.Recordset
Dim strSQL As String
Set dbsAPIShopManager2010 = CurrentDb
strSQL = "SELECT * FROM MaterialLotJobJoint WHERE JobID" = "tempvars!JobID" And "MatLotID" = "tempvars!MatLotID"
Set rstMaterialLotJobJoint = dbsAPIShopManager2010.OpenRecordset(strSQL, dbOpenDynaset)
If rstMaterialLotJobJoint.EOF Then
DoCmd.OpenForm "JobAssignMatConf", acNormal, "", "", acEdit, acNormal
Forms!JobAssignMatConf!PartapiIDVH = TempVars!PartapiID
Forms!JobAssignMatConf!JobapiIDVH = TempVars!JobapiID
Forms!JobAssignMatConf!JobIDVH = TempVars!JobID
Forms!JobAssignMatConf!MaterialLotIDVH = TempVars!MatLotID
Forms!JobAssignMatConf!Desc = TempVars!MatDesc
Forms!JobAssignMatConf!recdate = TempVars!recdate
DoCmd.Close acForm, "MaterialLotListAvailable"
Else: MsgBox "This material lot has already been assigned to this job."
DoCmd.Close acForm, "MaterialLotListAvailable"
End If
End FunctionI think the SQL statement should be
strSQL = "SELECT * FROM MaterialLotJobJoint WHERE JobID=" & _
tempvars!JobID & " AND MatLotID=" & tempvars!MatLotID
This assumes thatJobID and MatLotID are number fields.
Regards, Hans Vogelaar (http://www.eileenslounge.com) -
Query to find the Views and synonyms that are accessing through db_link
HI all,
Oracle 10g
I need a Query to find the Views and synonyms that are accessing through db_link.
ie.
database A have the db_link to database B through a schema A
now i need to find what are the Synonyms and views that are accessing through db_link either directly or indirectly..
regards,
Deepak
Edited by: Deepak_DBA on Dec 10, 2010 5:38 PMOn the second database (B) use this query to find the SQL which used by the schema A (DB LINK USER). Check the SQL_FULLTEXT column.
select sql_fulltext,sql_id,module,parsing_schema_name,parsing_user_id,first_load_time,loads,users_executing,rows_processed,plsql_exec_time,sorts,fetches,invalidations,parse_calls,cpu_time,elapsed_time,disk_reads,buffer_gets
from V$sqlarea
where parsing_schema_name = 'A' --and to_char(first_load_time,'dd/mm/yyyy') like '%11/08/2007'
order by first_load_time desc;
Regards
Asif Kabir -
Query to find the second maximum date in a table
please give me the query to find the second maximum date in a table
You can try with this
SELECT empno
,hiredate
FROM emp a
WHERE 2 = (SELECT COUNT(DISTINCT hiredate)
FROM emp b
WHERE b.hiredate >= a.hiredate
OR
SELECT empno
,hiredate
FROM (SELECT ROWNUM row_num
,empno
,hiredate
FROM emp a
ORDER BY hiredate ASC
WHERE row_num = 2;Regards
Arun -
SQL Query to find the Notify upon Completion employees
Hi,
I am looking for a query to find the names of the employees/users who are notified upon the completion of the Concurrent Programs. I know how to find the concurrent program details but not able to find notify upon completion employees details. Please help me.
Thanks,
KMThanks Scott for responding. There is no any custom code. Here is the navigation to reach there:
System Administrator -> Requests -> View -> Specific Requests -> Open any request ->View Details -> Options -> Notify the following people
I am looking for the query to find these notified people using SQL Query.Query FND_CONCURRENT_REQUESTS table (NOTIFY_ON_PP_ERROR column) -- http://etrm.oracle.com/pls/et1211d9/etrm_pnav.show_object?c_name=FND_CONCURRENT_REQUESTS&c_owner=APPLSYS&c_type=TABLE
Thanks,
Hussein -
Hi experts help me,
I have one requirment
there have two machine(plant) fert1,fert2 each one have some materilas.
from one of the plant will be goining to stop(fert1).
than we need featch the issued material from fert1 in reverse order to store it than post the meterial into fert2 based on the production number.
Please help me,
THANKS advance
Moderator message: "spec dumping", please work yourself first on your requirement.
Edited by: Thomas Zloch on Oct 29, 2010 1:54 PMHi,
I'm not sure what you're asking in either question. It would help if you gave a specific example of what you want to do.
SowmyRaj wrote:
Hi Experts , I need help in two qurstions
1. How to update a view without modifying the base table ?You can't.
Views don't contain any data; they just query base tables.
You can change the definition of a view (CREATE OR REPLACE VIEW ...) so that it appears that the base table(s) have changed; that won't change the base tables.
2. How to write a file unix operating system in pl/sql ? is there any built in procedure is there ?The package utl_file has routines for working with files. -
How to find the dependency information for views?
Hi All,
There is reuirement where in we have to find the dependency information for all the tables which are used in particular view...along with remote database connections.. For this we have tried to use following query..
Select * from user_dependencies
start with name =’SAMPLE_VIEW’
connect by prior trim(referenced_name)=trim(name);
The view consists of three tables :
Create view sample_view as
select t1.col1,
T2.col2,
T3.col3,
From
Table1,
Table2@prd1,
Table3@prd2
Where
T1.col5=t2.col5
And T1.col5=t3.col5;
But the ouptut is :
name Type Reference_name Reference_type Reference_link_name
sample_view View Table1 Table null
So what will be the magic query which will give the all the tables in the view sample_view??
Desired result:
name Type Reference_name Reference_type Reference_link_name
sample_view View Table1 Table null
sample_view View Table2 Table prd1
sample_view View Table3 Table prd2
Thanks all in Advance!!Thanks all for the help!!
So right now, inorder to find the dependency informations for views there is no direct query :(
As per the michaels post, i have developed some query ....just joining the table....which will give the source code of the object... :)
The query is :
select view_name,db_link,owner, substr(to_char(text),instr(to_char(text),'.',1,2),instr(to_char(db_link),'@')) as _Final_result_,
substr(to_char(text),instr(to_char(text),'.',1,2),20),text from (
select a.view_name,b.owner,a.db_link,dbms_metadata.get_ddl ('VIEW', a.view_name) text
from (
select view_name, db_link
from (select view_name, dbms_metadata.get_ddl ('VIEW', view_name) text
from user_views ),
user_db_links
where upper (text) like '%@' || nvl (substr (db_link, 1, instr (db_link, '.') - 1), db_link) || '%' ) A,
all_views B
where
A.view_name=b.view_name
and b.view_name='VW_TESTING') The sampe view is :
create or replace view VW_TESTING
as select A.F_DRUG_SKEY,B.F_DRUG_ID
from dma_info.MORE_SOME_FTF_DRUG@info A,dms_prf.MORE_SOME_FTF_DRUG_FACTOR@info B
where a.F_DRUG_ID=b.F_DRUG_ID and
rownum<=5 The output of these query is :
Final_result
MORE_SOME_FTF_DRUG@info A,dms_prf.MORE_SOME_FTF_DRUG_FACTOR@info B where .F_DRUG_ID=b.F_DRUG_ID and rownum<=5 In short through source code, I am trying to find those object name which are preceding the "@' sign...please let me know if this can be workaround for finding the dependencies of objects in view... :(
Thanks!!
Edited by: user8915904 on Dec 28, 2009 11:22 PM -
Index not using the base table
Hi,
In which scenario, a query will only use the index and not the base table. Please give me some example.
Thanks,
Santhosh
Edited by: Santhosh on Oct 23, 2012 2:45 AMChancal,
not always,
SQL> desc temp;
Name Null? Type
EMPNO NUMBER(4)
ENAME VARCHAR2(10)
JOB VARCHAR2(9)
MGR NUMBER(4)
HIREDATE DATE
SAL NUMBER(7,2)
COMM NUMBER(7,2)
DEPTNO NUMBER(2)
SQL> select empno from temp;
EMPNO
7369
7499
7521
7566
7654
7698
7782
7788
7839
7844
7876
7900
7902
7934
1057
15 rows selected.
SQL> select * from table(dbms_xplan.display_cursor);
PLAN_TABLE_OUTPUT
SQL_ID 3qt0w20pqj162, child number 0
select empno from temp
Plan hash value: 3800668828
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | | | 2 (100)| |
| 1 | TABLE ACCESS FULL| TEMP | 15 | 60 | 2 (0)| 00:00:01 |
13 rows selected.
SQL> alter table temp modify(empno not null);
Table altered.
SQL> select empno from temp;
EMPNO
1057
7369
7499
7521
7566
7654
7698
7782
7788
7839
7844
7876
7900
7902
7934
15 rows selected.
SQL> select * from table(dbms_xplan.display_cursor);
PLAN_TABLE_OUTPUT
SQL_ID 3qt0w20pqj162, child number 0
select empno from temp
Plan hash value: 472861760
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | | | 1 (100)| |
| 1 | INDEX FULL SCAN | IDX_TEMP | 15 | 60 | 1 (0)| 00:00:01 |
13 rows selected.
Maybe you are looking for
-
I tried to use finder to browse /volumes/mobilebackups/Backups.pdb/Mabbook Pro.... and I found an empty folder. Using terminal, I can see hourly backups These backups doesn't appear in Time line I have a MBP early-2011 running Lion with one user How
-
Purchased Movies purchased in itunes not showing in video's on iphone
I Just purchased the Extended Lord of the Rings Trilogy. It shows up on my mac, shows up on my ipad in video's but on my iphone 5, it does not show up? I can see other cloud movies I have purchased, but these three will not show up at all. I logge
-
Booting Lion Recovery Assistant From Thumb Drive
I'm wondering if I can boot the Lion "Recovery Disk Assitant" from a USB thumb drive with an early 2008 MacBook Pro with an installed but unformatted hard drive. I do have a Time Machine backup to finish the job. I'm not sure the laptop's firmware wi
-
CALLING A UK MOBILE IN THE USA
Hi - Which subscription package should I use if I want to make cheaper calls from a UK mobile in the UK, to a UK mobile being used in the USA? Solved! Go to Solution.
-
Java Database User Role Privileges Framework
Hello I am looking Java Framework which automatic generates Java Code for Database User Role Privileges Administration. Like in database we have a table of Users Now we have table of Author, Book etc. (Related to Library) Now i want to give insert pe