@Andrey / @Luca,

Can you help here ?

How to do multiple inserts / updates across multiple connected classes in 
single statement ?

For instance, lets take a simple example of three classes employer, 
employee and contact

   - employer attributes - company_name (string), employees (Linkset to 
   employee class), contact_details (Linkset to contact class)
   - employee attributes - name (string), employer (Link to employer 
   class), contact_details (Linkset to contact class)
   - contact attributes - email_id (string), contact_of (Link to employee 
   or employer class)
   

How can we perform insert across all three classes and establish 
inter-linking in single insert / update statement ?

Regards,
Gaurav



On Monday, March 10, 2014 10:19:37 AM UTC+5:30, Mitul Golakiya wrote:
>
> That works if we want to insert records in single table, but what about if 
> we want to insert records in different table with relationships ??
> Like in my case, I want person object in person table, emails in emails 
> table, phones in phones table and I had relationships between them.
>
> So How can I do that with in Query ??
>
>
>
> On Monday, March 10, 2014 8:28:57 AM UTC+5:30, Lvc@ wrote:
>>
>> Hi Gaurav,
>> you could group inserts in one call like this:
>>
>> insert into xxx (x,y) values (1,2) (2,3) (3,4)
>>
>> This will insert 3 records.
>>
>> Lvc@
>>
>>
>>
>> On 10 March 2014 01:32, Gaurav Dhiman <[email protected]> wrote:
>>
>>> Andray, can you suggest how to do multiple inserts / updates in single 
>>> SQL, considering the case of document DB that Mitul Golakiya presented.
>>> It will help me and other members on community to best utilize the power 
>>> of OrientDB.
>>>
>>> Regards,
>>> Gaurav
>>>
>>>
>>>
>>> On Friday, March 7, 2014 9:28:01 PM UTC+5:30, Mitul Golakiya wrote:
>>>>
>>>> We are using Document Type database.
>>>>
>>>> I had sent one mail with my current schema of MongoDB and OrientDB to 
>>>> your external gmail email address which I got from Github.
>>>>
>>>>  Please check and can you suggest how can I do that ??
>>>>
>>>> On Friday, March 7, 2014 5:24:18 PM UTC+5:30, Andrey Lomakin wrote:
>>>>>
>>>>> Hi,
>>>>> You do not need to insert them as separate insertions.
>>>>> Just create all objects at once and store root document everything 
>>>>> will be stored and links will be updated automatically.
>>>>>
>>>>> Also with what kind of database do  you work graph of document ?
>>>>> if you use document database usage of LINKSET is OK.
>>>>>
>>>>> If you work with graph database you should connect vertexes through 
>>>>> edges.
>>>>> Also you should do it in single tx to avoid data consistency problems 
>>>>> in case if you will have errors during insertions.
>>>>>
>>>>> Our users report that insertion speed is at least 1500 rec/s (2/3 ms 
>>>>> for single record) so insertion of 5 records for a second (it should be 
>>>>> about 5 ms for such small amount of data) is indication that something is 
>>>>> really wrong.
>>>>> Could you send me example of database and code which you use to import 
>>>>> data ? 
>>>>>
>>>>> -- 
>>>>> Best regards,
>>>>> Andrey Lomakin.
>>>>>
>>>>> Orient Technologies
>>>>> the Company behind OrientDB
>>>>>
>>>>>   -- 
>>>
>>> --- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "OrientDB" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to [email protected].
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to