OrientDB 2.1 - newline in string in SQL

151 views
Skip to first unread message

Glenn Irwin

unread,
Aug 21, 2015, 7:15:54 AM8/21/15
to OrientDB
I am migrating to 2.1 and I noticed that the SQL parser gives me an error when I try to give it a data string (wrapped in quotes) with a newline or \r in it.  I am just trying to update the field that was inserted directly with Java API which accepted the data just fine with the newlines.  But when I update it using SQL, it doesn't accept it.

Exception in thread "Thread-8" com.orientechnologies.orient.core.sql.parser.TokenMgrError: Lexical error at line 1, column 68.  Encountered: "\r" (13), after : "\"/* horizontal menu style */"

at com.orientechnologies.orient.core.sql.parser.OrientSqlTokenManager.getNextToken(OrientSqlTokenManager.java:3370)

at com.orientechnologies.orient.core.sql.parser.OrientSql.getToken(OrientSql.java:12758)

at com.orientechnologies.orient.core.sql.parser.OrientSql.Expression(OrientSql.java:4167)

at com.orientechnologies.orient.core.sql.parser.OrientSql.UpdateItem(OrientSql.java:2403)

at com.orientechnologies.orient.core.sql.parser.OrientSql.UpdateOperations(OrientSql.java:2220)

at com.orientechnologies.orient.core.sql.parser.OrientSql.UpdateStatement(OrientSql.java:2053)

at com.orientechnologies.orient.core.sql.parser.OrientSql.Statement(OrientSql.java:571)

at com.orientechnologies.orient.core.sql.parser.OrientSql.parse(OrientSql.java:79)


any advice as to what I can do?  Is there any way to encode a newline in a string in OrientDB SQL?

Luca Garulli

unread,
Aug 21, 2015, 8:46:10 AM8/21/15
to OrientDB
Hi Glenn,
Please could you open a new issue or that?

Best Regards,

Luca Garulli
Founder & CEO


--

---
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.

Glenn Irwin

unread,
Aug 21, 2015, 2:34:42 PM8/21/15
to OrientDB
Issue #4837 opened

I suppose I could encode my updates to the Java API instead of assembling SQL but I think it would be useful to be able to update this data through SQL as well as direct API.

Thanks
Reply all
Reply to author
Forward
0 new messages