SQL Query question : how to add data to two tables connected by third Junction-table.
Hello specialists.
Maybe this is the wrong formum but I've got a question for which you probably have the answer, i hope.
Situation
John is member of Group_A and Group_B
Bill is member of Group_B and Group_C
Allison is member of Group_A and Group_E
How can I create a query to input Allisons username into table 1 and groupmembership into table 2. Also updating the relationship within junction-table3 must be done automaticaly. I want to avoid duplicate records.
The final situation I want is given in red text.
The relationships between the tables are as follows
Table1 (PK)ID-Userinfo [ONE] <------------> [MANY] Table3 ID-Userinfo
Table3 (PK)ID-GroupInfo [MANY] <------------> [ONE] Table2 (PK)ID-GroupInfo
Table1: UserInfo
(PK)ID-Userinfo UserName
1 John
2 Bill
3 Allison
Table2: GroupInfo
(PK)ID-GroupInfo GroupName
1 Group_A
2 Group_B
3 Group_C
4 Group_E
Table3: MemberOf
(PK)ID-MemberOf ID-UserInfo ID-GroupInfo
1 1 1
2 1 2
3 2 2
4 2 3
5 3 1
6 3 4
I hope you can help me cracking this nut.
Thx in advance. Greetings Fred
Hi RSingh
May i comment something very small?
Anyone who writes a response, done it on the assumption that he is writing the answer. Writing response is the statement of "I think that's correct". Each one that write a response see it as the answer. It makes no sense immediately mark your own
answer too (double actions). Marking a response as "Propose as answer" is explicitly designed to
allow others to announce that they think this is the best right answer in the thread, after the discussion :-)
In my personal opinion, we should not mark our own answers. There are enough users with permissions, which would be glad to mark your answers as correct / recommended.
Give us the opportunity, I will love to mark your answers :-). Moreover, by marking "Proposed as answer" you actually close the thread, other users which see that the question got an answer, may not check
the thread at all, and maybe they could provide a different answer.
* Exceptions are very specific cases. For example a case where the message has already become very old and no one marked anything. in this case marking "Proposed as answer" can help others and especially the person who ask the question, to focus
on thread and the answer (more on the subject is in the Moderators forum and the Moderators Guide by the way).
[Personal Site] [Blog] [Facebook]
Similar Messages
-
Can we change/Modify BI server generated Sql query and run to fetch data
Hi,
My client is saying that there is an option to modify bi server generated sql query to fetch data from source.
question:As a request is made in presentation services, A dynamic sql query is generated and fetches data from source. all this is loggedin Nqlquery log..well can we change/modify the sql query generated and run modified sql query to fetch data from source. ., if so how? if not why?
Thanks in advance
Edited by: user10794468 on Jun 16, 2009 6:29 PM
Edited by: user10794468 on Aug 12, 2009 6:58 PMThank you so much for your reply..
..Can we also modify sql query generated by bi server to fetech data. the query's which we see in query log file.. -
How to add date with month after convert number to month?
How to add date with month after convert number to month?
Month Date Result
24 21/11/09 24*(21/11/09)
I want to add both the column and result should be 21/11/11
Thanks
NiharHmm,
Because, you are using YYYY for '09'.
SQL> ed
Wrote file afiedt.buf
1* select to_char(to_date('10/01/09','DD/MM/RRRR'),'DD/MM/YYYY') from dual
SQL> /
TO_CHAR(TO
10/01/2009
SQL> ed
Wrote file afiedt.buf
1* select to_char(to_date('10/01/09','DD/MM/YYYY'),'DD/MM/YYYY') from dual
SQL> /
TO_CHAR(TO
10/01/0009Or with Add_months
SQL> ed
Wrote file afiedt.buf
1* select to_char(add_months(to_date('10/01/09','DD/MM/YYYY'),36),'DD/MM/YYYY') from dual
SQL> /
TO_CHAR(AD
10/01/0012
SQL> ed
Wrote file afiedt.buf
1* select to_char(add_months(to_date('10/01/09','DD/MM/RRRR'),36),'DD/MM/YYYY') from dual
SQL> /
TO_CHAR(AD
10/01/2012-Arun -
Sql query to indetify the identical data
Hi
I would like to know the query to identify the identical data in same table.
Example: I have table called 'AA" having same data for load_ctry i.e. 'MY' and 'HK' ,I need sql query to indetify the identical data for above countries in that table.
Thanks
MRHi,
Table called "AA" with columns col1,col2,col3,load_ctry with following sample date
col1 col2 col3 load_ctry
3 bg xx TH
4 op xc TH
3 bg xx MY
4 op xc MY
3 vb nb MY
When query ,if data is identical for both countries ,no data to fecth or data identical .If data is differ ,it will return the mismatching data becuase we are using same table for both countries .
Thanks
MR -
QUESTION: HOW TO ADD OWN SUBJECT IN CCMS
Hi, All
QUESTION: HOW TO ADD OWN SUBJECT IN CCMS
In NW2004s SP20, kernal 4.6C WebAs 620
I add paramater in RZ21, Method: CCMS_OnAlert_Eamil , Paramater: SUBJECT_ALERT value CCMS Alert from XDV
But nothing changed when I received e mail it same look like CCMS alerts XDV 20080528 104346
How can I do that please advicse
ThanksHI,
Refer
Blog to implement the email notification:
/people/federico.babelis2/blog/2006/05/03/solution-manager-cen-and-alerting-configuration-guide-for-dummies
http://help.sap.com/saphelp_nw04/helpdata/en/ce/c193d07a7343ff9a81db1bdc97b2f7/frameset.htm
Monitoring with Solution Manager
http://help.sap.com/saphelp_nw04/helpdata/en/1a/40f83ee0e66856e10000000a114084/frameset.htm
Configuring the Alert monitoring of Solution Manager 4.0
Thanks
Swarup
Edited by: Swarup Sawant on May 30, 2008 8:07 PM -
Hi
I am trying to wright a SQL query that will return the date the timesheet was submitted and date/time it was approved, can anyone guide me on this?
I basically need person name who submitted, date - time it was submitted for approval, then the person who approved it and the date - time that it was approved
Thanks
RubyRuby,
you can start with HXC_TIMECARD_SUMMARY table for submitter detail. But for approver details, i think you need WF tables to get the data for item type HXCEMP. -
How to import data from excel or csv files to Oracle table
hello everybody,
I am new here and new in Oracle. I would like to know the steps how to import data from excel or csv files to Oracle table.
Let say I already have table inside the Oracle. Then my user give me the sets of data inside the Excel Worksheet.
So, how can I import the excel data into Oracle table.
Thank you in advance.
cheers,
shimaEven easier. Download JDeveloper 11G from this site.
Set up the database connection, right click on the table, select Import->Excel and specify your file to load it. On the import pop-up, you must view and update each tab indicating Columns, Data Types, and DML.
Columns -- move the selected columns that you want to load to the box on the right
Data Types -- select column name from second column to which the data for each column of the import file should load
DML -- click this tab to generate the INSERT SQL
Once done click 'Insert' -
How to add one or two photos without synchronise my 8240 photos on my ipad2
How to add one or two photos without synchronize my 8240 photos on my ipad2 or iPhon4 ?
Thank youJust add the photos to the folders/location that you last synced and sync them - as only the contents of the last photo sync remains on the iPad, you have to (re-)sync all the photos that you want on the iPad. In theory only the new photos will need processing by the sync process, so it shouldn't take a long time to sync (it hasn't for me when I've added a few to my 1500 photos in the past anyway). Not including photos in a sync is how you remove them from the iPad.
Your alternative is to email them to yourself and then save them from the email, but they will only go into the Saved Photos/Camera Roll album - come iOS 5 in the Autumn you should then be able to move photos between albums. -
How to add a feild as key combination for existing condition table
Hi all,
please any body can inform me about how to add a feild as key combination for existing condition table ex 901 having the key combination of sales organisation and material
for this cond. table,how to add a new feild ex:price list
iam unable to add it in change mode of v/03.(even after removing this 901 table from Acc.seq.)
Edited by: rajendraprasad vasam on Apr 25, 2008 10:08 AMmr.Rajendra
I you have the access key - you can copy the 901 table and create a new table along with your required field. v/03
Or
in the access sequence for the condition type - add 1 more step and add your field.
ie 10 - 901
and in 20 - your required field
regards,
Reshmi
Edited by: reshmi bhaskar on Apr 25, 2008 10:21 AM -
How to insert data into two tables linke with foreign key..
I have two tables
1)EMP(emp_ID,username,emp_type_code)
emp_ID is primary key, emp_type_code is a foreign key references emptype table.
2)emptype(emp_type_code,emp_type_descripton)
emp_type_code is primary key
Could anyone help me ..how to insert data into EMP table. How to insert data into two tables linke with foreign key..CREATE TABLE "CATDB"."DWDIMUSER"
"USER_ID" NUMBER(10,0) NOT NULL ENABLE,
"SPECIALTY_ID" NUMBER(10,0),
"FULLNAME" VARCHAR2(20 BYTE),
"FNAME" VARCHAR2(20 BYTE),
"LNAME" VARCHAR2(20 BYTE),
"USER_SUBTYPE" VARCHAR2(20 BYTE),
CONSTRAINT "DIMUSER_PK" PRIMARY KEY ("USER_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CATDB" ENABLE,
CONSTRAINT "DIMUSER_DIMSPECIALTY_FK" FOREIGN KEY ("SPECIALTY_ID") REFERENCES "CATDB"."DWDIMSPECIALTY" ("SPECIALTY_ID") DISABLE
CREATE TABLE "CATDB"."DIMSPECIALTY"
"SPECIALTY_ID" NUMBER(10,0) NOT NULL ENABLE,
"SPECIALTY_NAME" VARCHAR2(100 BYTE),
CONSTRAINT "DIMSPECIALTY_PK" PRIMARY KEY ("SPECIALTY_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CATDB" ENABLE
INSERT INTO DIMUSER (FullName, FNAME, LNAME, USER_TYPE, USER_SUBTYPE)
SELECT DISTINCT
Engineer AS FullName,
regexp_substr(Engineer , '[^,| ]+', 1, 1) as FName,
regexp_substr(Engineer , '[^,| ]+', 1, 2) as LName ,
'Engineer'
FROM EMPLOYEELOOKUP;
INSERT INTO DIMSPECIALTY (SPECIALTY_NAME)
SELECT DISTINCT SPECIALITY
FROM EMPLOYEELOOKUP;
COMMIT;
CREATE TABLE employeelookup ...IS A TABLE THAT HAS ALL THE DATA NEDED TO BE FILLED IN BOTHE TABLES...
CREATE TABLE "CATDB"."EMPLOYEELOOKUP"
"EMPLOYEELOOKUP_ID" NUMBER(10,0) NOT NULL ENABLE,
"ENGINEER" VARCHAR2(25 BYTE),
"SPECIALTY" VARCHAR2(20 BYTE),
CONSTRAINT "DIMSPECIALTY_PK" PRIMARY KEY ("EMPLOYEELOOKUP_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CATDB" ENABLE
DATA IN EMPLOYEELOOKUP
Engineer, Specialty,
John, Dow, Electronis,
Dow, Jons, Technician
Stan Smithers Sales
Mark, Richards Marketing
Jenny, Lane Marketing
John, Lee Sales
I NEED TO LOAD THE FOREIGN KEY IN DIMUSER FROM THE DIMSPECIALTY TABLE?
BY USING THE LOOKUP TABLE TO MARCH THE NAMES UNDER THE Engineer COLUMN, SPECIALTY COLUMNE DISTICTIVLY BY JOINING THE DIMSPECILTY TO RISTIVE THE PRIMARY KEY AND FILL IT IN THE DIMUSER TABLE AS A FOREIGNE KEY. -
How to pass data between two internal sessions using ABAP memory?
Hi,
How to pass data between two internal sessions using ABAP memory?
It would be fine if you could explain with an example.
And also let me clear about the data passing between two main sessions and two external sessions with specific examples.
Thanks.Hi ,
check the example.
Reading Data Objects from Memory
To read data objects from ABAP memory into an ABAP program, use the following statement:
Syntax
IMPORT <f1> [TO <g 1>] <f 2> [TO <g 2>] ... FROM MEMORY ID <key>.
This statement reads the data objects specified in the list from a cluster in memory. If you do not use the TO <g i > option, the data object <f i > in memory is assigned to the data object in the program with the same name. If you do use the option, the data object <f i > is read from memory into the field <g i >. The name <key> identifies the cluster in memory. It may be up to 32 characters long.
You do not have to read all of the objects stored under a particular name <key>. You can restrict the number of objects by specifying their names. If the memory does not contain any objects under the name <key>, SY-SUBRC is set to 4. If, on the other hand, there is a data cluster in memory with the name <key>, SY-SUBRC is always 0, regardless of whether it contained the data object <f i >. If the cluster does not contain the data object <f i >, the target field remains unchanged.
In this statement, the system does not check whether the structure of the object in memory is compatible with the structure into which you are reading it. The data is transported bit by bit. If the structures are incompatible, the data in the target field may be incorrect.
PROGRAM SAPMZTS1.
DATA TEXT1(10) VALUE 'Exporting'.
DATA ITAB LIKE SBOOK OCCURS 10 WITH HEADER LINE.
DO 5 TIMES.
ITAB-BOOKID = 100 + SY-INDEX.
APPEND ITAB.
ENDDO.
EXPORT TEXT1
TEXT2 FROM 'Literal'
TO MEMORY ID 'text'.
EXPORT ITAB
TO MEMORY ID 'table'.
SUBMIT SAPMZTS2 AND RETURN.
SUBMIT SAPMZTS3.
The first part of this program is the same as the example in the section Saving Data Objects in Memory. In the example, the programs SAPMZTS1 and SAPMZTS2 are called using SUBMIT. You can create and maintain the programs called using the SUBMIT statement by double-clicking their names in the statement. For further information about the SUBMIT statement, refer to Calling Executable Programs (Reports)
Example for SAPMZTS2:
PROGRAM SAPMZTS2.
DATA: TEXT1(10),
TEXT3 LIKE TEXT1 VALUE 'Initial'.
IMPORT TEXT3 FROM MEMORY ID 'text'.
WRITE: / SY-SUBRC, TEXT3.
IMPORT TEXT2 TO TEXT1 FROM MEMORY ID 'text'.
WRITE: / SY-SUBRC, TEXT1.
Example for SAPMZTS3:
PROGRAM SAPMZTS3.
DATA JTAB LIKE SBOOK OCCURS 10 WITH HEADER LINE.
IMPORT ITAB TO JTAB FROM MEMORY ID 'table'.
LOOP AT JTAB.
WRITE / JTAB-BOOKID.
ENDLOOP.
The output is displayed on two successive screens. It looks like this:
and
The program SAPMZTS2 attempts to read a data object TEXT3 from the data cluster "text", which does not exist. TEXT3 therefore remains unchanged. The existing data object TEXT2 is placed in TEXT1. In both cases, SY-SUBRC is 0, since the cluster "text" contains data.
The program SAPMZTS3 reads the internal table ITAB from the cluster "table" into the internal table JTAB. Both tables have the same structure, namely that of the ABAP Dictionary table SBOOK.
Pls. reward if useful..... -
How to separate data between two colons
Hi,
how to separate data between two colons?
ex: 'ABC:1234:1-ss-2:0:0:0:0-DEF:5678:0:0:0:0'
how to access these 1234, 5678 and 1-ss-2 ?
there may be any string.
please helpHi,
The string 'ABC:1234:1-ss-2:0:0:0:0-DEF:5678:0:0:0:0' contains 11 colons, and 10 sub-strings that are between colons. How do you distinguish the ones you want,
(1) 1234
(7) 5678
(2) 1-ss-2
from the ones you don't want
(3) 0
(4) 0
(5) 0
(6) 0-DEF
(8) 0
(9) 0
(10) 0
Anyhow, in Oracle 10 (and up) you can easily get the n-th item from a :-delimited list by saying:
REGEXP_SUBSTR ( txt
, '[^:]+
, 1
, n
)First use REGEXP_REPLACE to remove anything before the first colon and anything after the last one. -
SQL Query using a Variable in Data Flow Task
I have a Data Flow task that I created. THe source query is in this file "LPSreason.sql" and is stored in a shared drive such as
\\servername\scripts\LPSreason.sql
How can I use this .sql file as a SOURCE in my Data Flow task? I guess I can use SQL Command as Access Mode. But not sure how to do that?Hi Desigal59,
You can use a Flat File Source adapter to get the query statement from the .sql file. When creating the Flat File Connection Manager, set the Row delimiter to a character that won’t be in the SQL statement such as “Vertical Bar {|}”. In this way, the Flat
File Source outputs only one row with one column. If necessary, you can set the data type of the column from DT_STR to DT_TEXT so that the Flat File Source can handle SQL statement which has more than 8000 characters.
After that, connect the Flat File Source to a Recordset Destination, so that we store the column to a SSIS object variable (supposing the variable name is varQuery).
In the Control Flow, we can use one of the following two methods to pass the value of the Object type variable varQuery to a String type variable QueryStr which can be used in an OLE DB Source directly.
Method 1: via Script Task
Add a Script Task under the Data Flow Task and connect them.
Add User::varQuery as ReadOnlyVariables, User::QueryStr as ReadWriteVariables
Edit the script as follows:
public void Main()
// TODO: Add your code here
System.Data.OleDb.OleDbDataAdapter da = new System.Data.OleDb.OleDbDataAdapter();
DataTable dt = new DataTable();
da.Fill(dt, Dts.Variables["User::varQuery"].Value);
Dts.Variables["QueryStr2"].Value = dt.Rows[0].ItemArray[0];
Dts.TaskResult = (int)ScriptResults.Success;
4. Add another Data Folw Task under the Script Task, and join them. In the Data Flow Task, add an OLE DB Source, set its Data access mode to “SQL command from variable”, and select the variable User::QueryStr.
Method 2: via Foreach Loop Container
Add a Foreach Loop Container under the Data Flow Task, and join them.
Set the enumerator of the Foreach Loop Container to Foreach ADO Enumerator, and select the ADO object source variable as User::varQuery.
In the Variable Mappings tab, map the collection value of the Script Task to User::QueryStr, and Index to 0.
Inside the Foreach Loop Container, add a Data Flow Task like step 4 in method 1.
Regards,
Mike Yin
TechNet Community Support -
hi everyone ! i have created a view object based on 2 entities objects (EMP and Departaments of hr schema)
but i have also modified the sql query of the view in this way :
SELECT Employees.EMPLOYEE_ID,
Employees.FIRST_NAME,
Employees.LAST_NAME,
Employees.DEPARTMENT_ID,
Departments.DEPARTMENT_NAME,
Departments.DEPARTMENT_ID AS DEPARTMENT_ID1
FROM EMPLOYEES Employees ,DEPARTMENTS Departments
where Employees.DEPARTMENT_ID(+) = Departments.DEPARTMENT_ID
and i have created a tables based on this view object..... in this table are shown those empl. that doesnt have departaments.... what i want to do is how can i add data to those rows wich doesnt have employess but have departaments???
Thanks in advance :)Hi,
I think you can resolve that problem using EL expression condition, try the following in your table:
<af:table ...>
<af:column headerText="#{bindings.EmployeeDepartment.labels.FirstName}"
binding="#{backing_EmployeeDepartment.column2}" id="column2">
<af:outputText value="#{row.FirstName!=null? row.FirstName: 'No Emp Found'}"
binding="#{backing_EmpDept.outputText2}"
id="outputText2"/>
</af:column>
</af:table>
Regards,
Ahmad Esbita -
Issue with SQL Query with Presentation Variable as Data Source in BI Publisher
Hello All
I have an issue with creating BIP report based on OBIEE reports which is done using direct SQL. There is this one report in OBIEE dashboard, which is written using direct SQL. To create the pixel perfect version of this report, I am creating BIP data model using SQL Query as data source. The physical query that is used to create OBIEE report has several presentation variables in its where clause.
select TILE4,max(APPTS), 'Top Count' from
SELECT c5 as division,nvl(DECODE (C2,0,0,(c1/c2)*100),0) AS APPTS,NTILE (4) OVER ( ORDER BY nvl(DECODE (C2,0,0,(c1/c2)*100),0)) AS TILE4,
c4 as dept,c6 as month FROM
select sum(case when T6736.TYPE = 'ATM' then T7608.COUNT end ) as c1,
sum(case when T6736.TYPE in ('Call Center', 'LSM') then T7608.CONFIRMED_COUNT end ) as c2,
T802.NAME_LEVEL_6 as c3,
T802.NAME_LEVEL_1 as c4,
T6172.CALENDARMONTHNAMEANDYEAR as c5,
T6172.CALENDARMONTHNUMBERINYEAR as c6,
T802.DEPT_CODE as c7
from
DW_date_DIM T6736 /* z_dim_date */ ,
DW_MONTH_DIM T6172 /* z_dim_month */ ,
DW_GEOS_DIM T802 /* z_dim_dept_geo_hierarchy */ ,
DW_Count_MONTH_AGG T7608 /* z_fact_Count_month_agg */
where ( T802.DEpt_CODE = T7608.DEPT_CODE and T802.NAME_LEVEL_1 = '@{PV_D}{RSD}'
and T802.CALENDARMONTHNAMEANDYEAR = 'July 2013'
and T6172.MONTH_KEY = T7608.MONTH_KEY and T6736.DATE_KEY = T7608.DATE_KEY
and (T6172.CALENDARMONTHNUMBERINYEAR between substr('@{Month_Start}',0,6) and substr('@{Month_END}',8,13))
and (T6736.TYPE in ('Call Center', 'LSM')) )
group by T802.DEPT_CODE, T802.NAME_LEVEL_6, T802.NAME_LEVEL_1, T6172.CALENDARMONTHNAMEANDYEAR, T6172.CALENDARMONTHNUMBERINYEAR
order by c4, c3, c6, c7, c5
))where tile4=3 group by tile4
When I try to view data after creating the data set, I get the following error:
Failed to load XML
XML Parsing Error: mismatched tag. Expected: . Location: http://172.20.17.142:9704/xmlpserver/servlet/xdo Line Number 2, Column 580:
Now when I remove those Presention variables (@{PV1}, @{PV2}) in the query with some hard coded values, it is working fine.
So I know it is the PV that's causing this error.
How can I work around it?
There is no way to create equivalent report without using the direct sql..
Thanks in advanceI have found a solution to this problem after some more investigation. PowerQuery does not support to use SQL statement as source for Teradata (possibly same for other sources as well). This is "by design" according to Microsoft. Hence the problem
is not because different PowerQuery versions as mentioned above. When designing the query in PowerQuery in Excel make sure to use the interface/navigation to create the query/select tables and NOT a SQL statement. The SQL statement as source works fine on
a client machine but not when scheduling it in Power BI in the cloud. I would like to see that the functionality within PowerQuery and Excel should be the same as in Power BI in the cloud. And at least when there is a difference it would be nice with documentation
or more descriptive errors.
//Jonas
Maybe you are looking for
-
I have a form in which I have placed a subform in a SharePoint Web App. I also have 2 controls on the form, from which I'd like to link to two columns on the subform. How can I have two Master/Child linking relationships to a subform. In Access des
-
How to use HR infotypes in abap
hi i m new for ABAP HR . how i can use or extract data from infotypes. Thanks.
-
Premiere Elements 11 crashes while loading ImporterQuickTime.pm
Hi all! I'm facing a problem with Adobe Premiere elements 11.0 whenever I launch it (even launched directly without passing the organizer's launch screen) it stops while loading ImporterQuickTime.pm. Here's my PC specifications: Windows 7 32bit Ram 2
-
Hello everyone, I was hoping that someone here could provide me with some advice or tips I have a MSI GX740 with a Mobility 5870 It is about 3 years old. Never had any big problems with it aside the fact that from time to time it would autoshut down
-
My safari bookmarks have disappeared from all of my apple devices and I have not deleted or moved them. Any ideas on how I can recover them?