orientdb icon indicating copy to clipboard operation
orientdb copied to clipboard

whitespace problem in transactions / let OSQL statements

Open ycxq opened this issue 11 years ago • 1 comments

Hi OrientDB team,

I need to insert strings that contain whitespace \n in transactions with LET, e.g.,

script sql
begin
LET a=insert into V set greeting="hello\norientdb"
commit
end

however, this throws (2.1-rc4):

Error: com.orientechnologies.orient.enterprise.channel.binary.OResponseProcessingException: Exception during response processing.

Error: com.orientechnologies.orient.core.sql.parser.TokenMgrError: Lexical error at line 1, column 34.  Encountered: "\n" (10), after : "\"hello"

Is it possible to insert strings with \n into OrientDB using transactions?

ycxq avatar Jun 23 '15 06:06 ycxq

Hi @ycxq

to insert backslash character you have to quote it (double backslash), eg.

script sql
begin
LET a=insert into V set greeting="hello\\norientdb"
commit
end

luigidellaquila avatar Jul 06 '15 13:07 luigidellaquila