Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

insert into a from (select * from b) dont work #2404

Closed
publicocean0 opened this issue May 28, 2014 · 2 comments
Closed

insert into a from (select * from b) dont work #2404

publicocean0 opened this issue May 28, 2014 · 2 comments
Assignees
Labels

Comments

@publicocean0
Copy link

I have a

class A { 
  B link 
}

i have multiple instance of b inserted.
I tried to create a multiple insertion of class a

insert into A from (select * from B)

or

insert into A from (select @rid as link from B)
/--------- log 
Connecting to database [remote:127.0.0.1/test3] with user 'admin'...OK
orientdb {test3}> select * from bb

----+-----+----+--------+-----
# 
----+-----+----+--------+-----
0   |#71:0|c   |[size=2]|#72:0
1   |#71:1|a   |#72:0   |#72:0
2   |#71:2|b   |#72:0   |#72:0
3   |#71:3|d   |#72:0   |#72:0
----+-----+----+--------+-----

4 item(s) found. Query executed in 0.038 sec(s).
orientdb {test3}> select * from aa

----+-----+----
# 
----+-----+----
0   |#70:0|[3] 
1   |#70:1|[3] 
2   |#70:2|[3] 
3   |#70:3|[2] 
4   |#70:4|[2] 
5   |#70:5|[3] 
6   |#70:6|[1] 
----+-----+----

7 item(s) found. Query executed in 0.053 sec(s).
orientdb {test3}> insert into aa from (select @rid as link from bb)

Inserted record '[]' in 0,002000 sec(s).

orientdb {test3}> 
@enisher
Copy link
Contributor

enisher commented May 29, 2014

Sorry, what do you want to do?

INSERT FROM SELECT syntax just copy a document from source to target. Seems that you want do something else.

@lvca
Copy link
Member

lvca commented May 29, 2014

Look at the syntax, just remove () after FROM

@lvca lvca closed this as completed May 29, 2014
@lvca lvca added this to the 1.7.1 milestone May 29, 2014
@lvca lvca self-assigned this May 29, 2014
@lvca lvca modified the milestone: 1.7.1 Aug 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants