Problem selecting uniqueness and last ddl from two tables
I need to select uniqueness from user_indexes, and last_ddl_time from user_objects to determine the last ddl on all indexes within a schema.
I have this code
select a.object_name,a. object_type ,to_char(last_ddl_time, 'DD-MON-YYYY HH24:MI:SS'
) Last_Used , b.uniqueness
from user_objects a, user_indexes b
where object_type ='INDEX'
and uniqueness = 'NONUNIQUE';Schema name not included beacuse i have it setup in my unix script.
Is this correct?????
SELECT a.object_name,
a.object_type,
to_char(last_ddl_time, 'DD-MON-YYYY HH24:MI:SS') last_used,
b.uniqueness
FROM user_objects a,
user_indexes b
WHERE object_type = 'INDEX'
AND uniqueness = 'NONUNIQUE
and a.object_name = b.index_name'; ------------------------------ missed joined condition.You are missing a join condtion..
Similar Messages
-
Hi
how to create a external content type for Read and Update data from two tables in sqlserver using sharepoint designer 2010
i created a bcs service using centraladministration site
i have two tables in sqlserver
1)Employee
-empno
-firstname
-lastname
2)EmpDepartment
-empno
-deptno
-location
i want to just create a list to display employee details from two tables
empid firstname deptno location
and same time update in two tables
adilWhen I try to create an external content type based on a view (AdventureWorks2012.vSalesPerson) - I can display the data in an external list. When I attempt to edit it, I get an error:
External List fails when attached to a SQL view
Sorry, something went wrong
Failed to update a list item for this external list based on the Entity (External Content Type) 'SalesForce' in EntityNamespace 'http://xxxxxxxx'. Details: The query against the database caused an error.
I can edit the view in SQL Manager, so it seems strange that it fails.
Any advice would be greatly GREATLY appreciated.
Thanks,
Randy -
Selective Deletion and Data Load from Setup Tables for LIS Extractor
Hi All,
We came across a situation where one of the delta in PSA was missed to load in DSO. This DSO updates another cube in the flow. Since it has been many days since this miss come in our knowledge we need to selectively delete data for those documents from DSO & Cube and then take a full load for the Documents filling the setup table.
Now what will be the right approach to load this data from setup table > DSO > cube. There is change log present for those documents and a few KPI's in DSO are in summation mode.
Regards
Jitendrathanks Ajeet!!!!
This is Sales Order extractor, the data got loaded to ODS just fine, but since the data is coming to ODS from different extractor. Everything is fine in ODS, but not in the cube. Will Full repair request and Full load would it make difference when the data is going to cube? I thought that it would matter only if I am loading to ODS.
what do you mean "Even if you do a full load without any selections you should do a full repair ".
thanks.
W -
Data fetch from two table without refresh
hi Friends,
I have a problem i want to extract data from two table without refresh into text field when i'll enter any value in a text field then corressponding value should come in to corressponding textfield.
eg. there two table A and B.
Table A has Colunm
s_id Number;
c_id Varchar2(30);
sec varchar2(4);
Second Table B Colunm Name
s_id Number;
f_name varchar(30);
l_name varchar(20);
when i enter s_id 101 in a text field then the c_id ,sec,first_name and last_name should come in to corressponding text fields without refresh.
How Can I do this.
Thanks
ManojHi Manoj,
You have to make an Ajax call to display data without refreshing the page. Search this forum for Ajax and you can find lots of related posts. This link might help too. http://www.dba-oracle.com/t_html_db_apex_ajax_application_express.htm
Thanks,
Manish. -
Selecting from two tables and confirming from them despites they not relate
Please I need a query to select from two tables that are not related to each other.
I also want to confirm data's as in verify wether what the user has entered is in accordance with what is in the tables
Examples
the first table is named "Card" and the second table is named "Student_Details"
Card table contains a column named "Pin_Number".
The Student_Details table contains fields such as Exam_Number, Name, Age, Sex.
The user has to Enter the Pin_Number which has to be confirmed in the Card table and Exam_Number which has to be confirmed in the Student_Details table and verify that both data's are correct.
Please I need the SQL and PL/SQL queries for this problem.
ThanksHi,
I think you need two different queries
You can write a procedure like:
create or replace procedure p1 (p_pin_number number, p_exam_number)
is
r_card_row card%rowtype;
r_student_details student_details%rowtype;
cursor c1 is
select *
from card
where pin_number = p_pin_number;
cursor c2 is
select *
from student_details
where exam_number = p_exam_number;
begin
open c1;
loop
fetch c1 into r_card_row;
exit when c1%notfound;
.... do whatever you want..... and the samething you can do with other cursor
end loop;
close c1;
end p1;Hope this helps
Ghulam -
To Select the data from two table one is transp table and onther is cluster
Hi All,
I want to select the data from two tables
Here i am giving with an example.
Fileds: kunnr belnr from bseg. table bseg
fields: adrnr from kna1 table: kna1.
Know i want to put these into one internal table based on kunnr and belnr.
Thanks in advance.
RameshHi,
U cant use joins on cluster table and BSEG is a cluster table so use FOR ALL ENTRIES for taht
refer this code
*& Form sub_read_bsak
text
--> p1 text
<-- p2 text
FORM sub_read_bsak.
*--Select data from BSAK Table
SELECT lifnr
augdt
augbl
gjahr
belnr
xblnr
blart
dmbtr
mwskz
mwsts
sgtxt
FROM bsak
INTO CORRESPONDING FIELDS OF TABLE it_bsak
WHERE belnr IN s_belnr
AND augdt IN s_augdt.
IF sy-subrc EQ 0.
*--Sort table by accounting document and vendor number
SORT it_bsak BY belnr lifnr.
ENDIF.
ENDFORM. " sub_read_bsak
*& Form sub_read_bseg
text
--> p1 text
<-- p2 text
FORM sub_read_bseg.
IF NOT it_bsak[] IS INITIAL.
*--Select data from BSEG table
SELECT belnr
gjahr
shkzg
kostl
hkont
ebeln
ebelp
FROM bseg
INTO CORRESPONDING FIELDS OF TABLE it_bseg
FOR ALL ENTRIES IN it_bsak
WHERE belnr EQ it_bsak-belnr
AND gjahr EQ it_bsak-gjahr
AND shkzg EQ 'S'.
IF sy-subrc EQ 0.
*--Sort table by accounting document
SORT it_bseg BY belnr.
ENDIF.
ENDIF.
ENDFORM. " sub_read_bseg -
Select from two tables and insert into a third
I'm trying to do a select from two tables and do an insert into a third table from the two resulting columns.
I have the following....
DECLARE
tempsid number;
temphostid number;
BEGIN
select "DBSID_ID","ID" into tempsid,temphostid from "DBSIDS","SERVERS"
where "HOST_SID" like '%'||"DBSID_NAME"||'%'
and "HOST_NAME" not like 'vio%'
and exists (select "DBSID_NAME" from DBSIDS)
order by "DBSID_NAME";
insert into "DBSID_LOOKUP" ("SIDLOOKUP_ID", "SERVERLOOKUP_ID")
values(tempsid, temphostsid);
END;
run;
I get the error ....
ORA-06550: line 11, column 18:
PL/SQL: ORA-00984: column not allowed here
ORA-06550: line 10, column 1:
PL/SQL: SQL Statement ignored
1. DECLARE
2. tempsid number;
3. temphostid number;okay ... I tried a different way ...
DECLARE
a number;
b number;
BEGIN
select "DBSID_ID","ID" into a,b from "DBSIDS","SERVERS"
where "HOST_SID" like '%'||"DBSID_NAME"||'%'
and "HOST_NAME" not like 'vio%'
and exists (select "DBSID_NAME" from DBSIDS)
order by "DBSID_NAME";
insert into "DBSID_LOOKUP" (SIDLOOKUP_ID, SERVERLOOKUP_ID) values (a, b);
END;
and now it whines about ...
ORA-01422: exact fetch returns more than requested number of rows -
Need of SQL query in selecting distinct values from two tables
hi,
I need a query for selecting distinct values from two tables with one condition.
for eg:
there are two tables a & b.
in table a there are values like age,sex,name,empno and in table b valuses are such as age,salary,DOJ,empno.
here what i need is with the help of empno as unique field,i need to select distinct values from two tables (ie) except age.
can anybody please help me.
Thanks in advance,
RatheeshNot sure what you mean either, but perhaps this will start a dialog:
SELECT DISTINCT a.empno,
a.name,
a.sex,
b.salary,
b.doj
FROM a,
b
WHERE a.empno = b.empno;Greg -
Select data from two tables...!
HI Experts...!
i m a beginner user and i want to select data from two tables proj and prps.....using joins.....and internal tables i have written a code...
SELECT prps~pspnr
prps~objnr
prps~psphi
proj~ernam
proj~erdat
proj~pspnr
INTO table itab -
itab is internal table
FROM prps inner join proj
WHERE pspnr in p_no and prpspsphi = projpspnr.
but there is error in from clause ..please help me....
Advance thanx....Hi,
check the sample code bellow above two reply will solve out your problem but one more extra line in your code pointed out bellow.
TABLES: prps, proj.
TYPES: BEGIN OF ty_test,
pspnr LIKE prps-pspnr,
objnr LIKE prps-objnr,
psphi LIKE prps-psphi,
ernam LIKE proj-ernam,
erdat LIKE proj-erdat,
END OF ty_test.
DATA: itab TYPE STANDARD TABLE OF ty_test WITH HEADER LINE.
SELECT-OPTIONS: p_no FOR prps-pspnr.
SELECT prps~pspnr
prps~objnr
prps~psphi
proj~ernam
proj~erdat
* proj~pspnr " No need for this you have selected this in
* the first line because it is commone so you only need to select from any one
INTO TABLE itab
FROM prps INNER JOIN proj ON ( prps~pspnr = proj~pspnr )
WHERE prps~pspnr IN p_no.
Best Regards,
Faisal
Edited by: Rob Burbank on Dec 24, 2009 12:24 PM -
Selecting data from two tables
I am trying to select data from two tables. The only problem that I am running into, is that i am only seeing results from my 'uploads' table. there is also a record in documents where user = 1 that should show up. here is my sql:
$userIDNum = 1;
$sql="Select *
from uploads, documents
WHERE uploads.user = documents.user AND uploads.user = $userIDNum
ORDER BY uploads.title ASC, documents.title ASC";You'll need to explain a little more about your data and what you are trying to accomplish. Your current sql will select all columns from both the uploads and documents tables but only rows where the user id in both tables match, AND the user id equals 1. Is that not what you are seeing? Where's the code that outputs the results?
-
Selecting from two tables but making it just one selection
Is there a way to select from two tables and just have one selection appear?
Specifically I have a fact_install_unit, and a fact_install_arch table.
Sometimes the value exists in fact_install_unit.factory_timestamp, and sometimes when fact_install_unit.factory_timestamp is null I need to pull it from the fact_install_arch.factory_timestamp.
sort of like:
(select fact_install_unit.factory_timestamp
from fact_install_unit, fact_install_arch
where fact_install_unit.fl_unit_sak = fact_install_arch.fl_unit_sak
and where fact_install_unit.factory_timestamp is null then display fact_install_arch.factory_timestamp)> I was just stating that I do not have sufficient priveleges to create views in this database.
>
nm means "no more" than that
And how are we supposed to know that? You seem to have changed the thread subject to "unfortunately I only have read-only and insufficient priveleges", which is not even a question.
nm means "New Mexico":
http://www.myshortpencil.com/schooltalk/messages/85/515.html?971794944 -
ALV OOps report- getting data from two tables and adding issue
Hi,
This is sales employee performance report.
I need to select all the fields from two tables based on user input ie VKorg, sales employee .
There is one field callled " Net sales"in both the tables.
Based on sales employee number, i need to add that net sales which i get from two tables.
I need to generate single report.
Can you give some inputs reg. the select query.
My idea is select all the data from both tables using join statement.
ThanksHi,
I have written like this:
select * from S002 as a join S006 as b
into table ME->SS002_RAW[]
where vkorg in me->select_parameters->SO_VKORG[] = vkorg in me->select_parameters->SO_VKORG[]
and ZZSLSEMP01 in me->select_parameters->SO_so_empl[] = ZZSLSEMP02 in me->select_parameters->SO_so_empl[].
when i do like that,
I am getting error
Incorrect structure of FROM clause . . . .
If you give some idea on this
Edited by: Raja on Apr 22, 2009 11:19 AM -
Capture from Two Tables and Apply in one Table
Hi All,
Is it possible to capture from two tables (master and child table) and apply in one table?
For example,
1. DEPT and EMP tables in source database with relation
DEPT table structure is like DEPT_ID, DEPT_NAME, LOC_NAME
EMP table structure is like EMP_ID, EMP_NAME, EMP_DOJ, EMP_SAL, DEPT_ID
2. EMP_DEPT_STAGING in destination database
EMP_DEPT_STAGING table structure is like EMP_ID, EMP_NAME, EMP_DOJ, EMP_SAL, DEPT_ID. DEPT_NAME, LOC_NAME
if there is any update in DEPT table, EMP_DEPT_STAGING should get populated with Department and its employee details. Similarly, if there is any update in EMP table EMP_DEPT_STAGING table should get populated with Employee details and along with department detail.
Is it possible to accomplish this? If yes, could you please provide me some examples?
Thanks & Regards
Thiyagu
Edited by: mt**** on Sep 4, 2011 11:22 PMlike this
INSERT @PlantNew (PlantID, PlantName, PlantDirExists, PlantAssistantDirID, PlantDirID)
SELECT p.PlantID,
p.PlantName,
CASE WHEN pd.PlantID IS NULL THEN 0 ELSE 1 END,
PlantAssistantDirID,
PlantDirID
FROM @Plant p
LEFT JOIN (SELECT PlantID,
MAX(CASE WHEN Assistant = 1 THEN PlantDirectorID END) AS PlantAssistantDirID,
MAX(CASE WHEN Assistant = 0 THEN PlantDirectorID END) AS PlantDirID
@PlantDirector
GROUP BY PlantID)pd
ON pd.PlantID = p.PlantID
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs
You're missing a FROM
insert into @PlantNew
SELECT p.PlantID,
p.PlantName,
CASE WHEN pd.PlantID IS NULL THEN 0 ELSE 1 END,
PlantAssistantDirID,
PlantDirID
FROM @Plant p
LEFT JOIN (SELECT PlantID,
MAX(CASE WHEN Assistant = 1 THEN PlantDirectorID END) AS PlantAssistantDirID,
MAX(CASE WHEN Assistant = 0 THEN PlantDirectorID END) AS PlantDirID
from @PlantDirector
GROUP BY PlantID)pd
ON pd.PlantID = p.PlantID -
hi i have i phone 4s and ios 7.0.2 is updated and problem is wifi and last 3 days i have problem about wifi and im connected wifi and its automatic turn off and then on ...... will you help me
Apple guys are deleting posts. I have found my posts have been deleted. Apple should MUST let us downgrade at least to previous release from current which was working fine.
-
How to save, update and retrieve data from two diffrent table
Hi,
I can save and retrieve data into an user defined SBO form from one database table only. How can I save retrieve and update records from two or more different tables in a single screen?
Regards,
Sudeshna.Sudeshna,
Are these tables external to SAP Business One and do not have a Business Object? If there is a Business Object available such as if you were to enter an order, that order would use the Documents object which abstracts you, the programmer, from the underlying tables that need to be updated. If you are handling multiple business objects you would need to wrap the transaction with the StartTransaction - EndTransaction methods. This information is detailed in the SAP Business One SDK Help Center that comes with the SDK.
HTH,
Eddy
Maybe you are looking for
-
Error UCD1038 regarding Movement Type after upgrade
During testing for the BW upgrade and implementation of BPC, the SEM-BCS data collection resulted in an unexpected and unnecessary error: Maximum selection does not contain value 600 of subassignment Movement Type; Message no. UCD1038. Both before an
-
If I have a PDF file opened in firefox 4, I am for unknow reason unable to open pages in new tabs with MMB or scroll thepage up or down. The scroll function isn't working at all, and it seems like I'd be scrolling the PDF file, not the page of my cur
-
Remittance Advice with PMW (AU_BECS_B & MT013)
Hi Friends, We are deploying BCM for our client. In the process we are migrating from Classic Payment Medium to Payment Medium using PMW (AU_BECS_B) While creating payment method in the company code (FBZP)I dont see any field for form data (next form
-
We want to disable or eliminate "Finally Close" option in PO Control
We want to disable or eliminate "Finally Close" option in PO Control. Pl suggest any solution Regards,
-
Filtering OSPF routes from MPBGP to BGP speaker in the same VRF
I'm wondering if anyone has some ideas they an share on this. Assume the following: - CE1 is speaking *iBGP and OSPF to PE1 inside vrf foo - PE1 is mutually redistributing CE1's OSPF table with MPBGP - PE1 exchanges MPBGP routes with PE2. - PE2 is mu