size() does not work with JavaAPI

21 views
Skip to first unread message

Hung Tran

unread,
Aug 6, 2014, 5:45:50 AM8/6/14
to orient-...@googlegroups.com
Hi,

Today, I have played with a SQL as following

SELECT FROM ContactList 
       LET $a = (SELECT count(1) FROM Contact WHERE OwnedBy = $parent.$current.@rid) 
WHERE Segments.size() > 0 AND $a[0].count > 0 limit 1

1/ Orient Console returns 1 record as expected

2/ JavaAPI throws an exception

OCommandSQLParsingException: Invalid keyword 'SEGMENTS.SIZE'

I am using OrientDB v1.7. Is there any workaround for v1.7?

Cheers,
Hung Tran

Luca Garulli

unread,
Aug 6, 2014, 6:12:13 AM8/6/14
to orient-database
Hi Hung,
How do you cal that SQL form Java API?

Lvc@



--

---
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 orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hung Tran Dinh

unread,
Aug 6, 2014, 9:45:35 AM8/6/14
to orient-...@googlegroups.com
Hi Luca,

I have tried with both ways, they did not work, they throw same exception above.

String rawSQL = "..."

OSQLSyncQuery query = new OSQLSyncQuery(rawSQL);
database.query(query); // does not work

OCommandSQL command = new OCommandSQL(rawSQL);
database.query(command).execute(); // does not work either

Remark, Segments is a LinkSet for ContactList.

My Best,
Hung Tran



--

---
You received this message because you are subscribed to a topic in the Google Groups "OrientDB" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/orient-database/veY3mrrw2O0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to orient-databa...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Hung Tran
Reply all
Reply to author
Forward
0 new messages