Hi,

I am migrating from version 1.7.8 to version 2.1.8, the SQL below does not 
working any more

SELECT IFNULL(@rid, '') AS Id,
    IFNULL(Number, '') AS Number,
    IFNULL(IssuedDate, '') AS IssuedDate,
    IFNULL(Title, '') AS Title,
    eval('SubTotal - DiscountAmount') AS Taxable,
    IFNULL(GrandTotal, '') AS GrandTotal,
    IFNULL(Status, '') AS Status,
    IFNULL(1, '') AS __metadata,
    IFNULL($v0, '') AS __xf8,
    IFNULL($v1, '') AS __xf9,
    IFNULL($v2, '') AS __xf10,
    IFNULL($v3, '') AS __xf11,
    IFNULL($v4, '') AS __xf12,
    IFNULL($v5, '') AS __xf13,
    IFNULL($v6, '') AS __xf14
FROM Invoice 
 LET $v0 = $__currentProjector.@this.CurrencyCode,
     $v1 = $__currentProjector.@this.IssuedTo,
     $v2 = $__currentProjector.@this.IsInvalidated,
     $v3 = $__currentProjector.@this.IssuedTo.Username,
     $v4 = $__currentProjector.@this.ToAccount.Username,
     $v5 = $__currentProjector.@this.InvalidatedInvoice.Number, $v6 = 
$__currentProjector.@this.OriginalInvoice.Number,
     $__currentProjector = (SELECT FROM $parent.$current)
WHERE((IssuedTo = #20:0 OR ToAccount= #20:0) AND (NOT (Number LIKE 
'__temp_' + '%'))) AND EntityInfo.State= 0 
ORDER BY IssuedDate DESC LIMIT 10

An error is

com.orientechnologies.orient.core.sql.OCommandSQLParsingException: Error on 
parsing command at position #0: Error parsing query: SELECT IFNULL(@rid,'') 
AS Id,IFNULL(Number,'') AS Number,IFNULL(IssuedDate,'') AS 
IssuedDate,IFNULL(Title,'') AS Title,eval('SubTotal - DiscountAmount') AS 
Taxable,IFNULL(GrandTotal,'') AS GrandTotal,IFNULL(Status,'') AS 
Status,IFNULL(1,'') AS __metadata,IFNULL($v0,'') AS __xf8,IFNULL($v1,'') AS 
__xf9,IFNULL($v2,'') AS __xf10,IFNULL($v3,'') AS __xf11,IFNULL($v4,'') AS 
__xf12,IFNULL($v5,'') AS __xf13,IFNULL($v6,'') AS __xf14 FROM Invoice LET 
$v0 = $__currentProjector.@this.CurrencyCode,$v1 = 
$__currentProjector.@this.IssuedTo,$v2 = 
$__currentProjector.@this.IsInvalidated,$v3 = 
$__currentProjector.@this.IssuedTo.Username,$v4 = 
$__currentProjector.@this.ToAccount.Username,$v5 = 
$__currentProjector.@this.InvalidatedInvoice.Number,$v6 = 
$__currentProjector.@this.OriginalInvoice.Number,$__currentProjector = 
(select from $parent.$current) WHERE ((IssuedTo=#20:0 OR ToAccount=#20:0) 
AND (NOT (Number LIKE '__temp_' + '%'))) AND EntityInfo.State=0 ORDER BY 
IssuedDate DESC LIMIT 10 Encountered " "." ". "" at line 1, column 471.
 Was expecting one of:
 <EOF> 
 <WHERE> ...
 <ORDER> ...
 <GROUP> ...
 <LIMIT> ...
 <SKIP2> ...
 <OFFSET> ...
 <TIMEOUT> ...
 <FETCHPLAN> ...
 <LOCK> ...
 <NOCACHE> ...
 <PARALLEL> ...
 <UNWIND> ...
 ";" ...
 "," ...
 "," ...
 <WHERE> ...
 <GROUP> ...
 <ORDER> ...
 <UNWIND> ...
 <SKIP2> ...
 <OFFSET> ...
 <LIMIT> ...
 <FETCHPLAN> ...
 <TIMEOUT> ...
 <LOCK> ...
 <PARALLEL> ...
 <NOCACHE> ...
 <NOCACHE> ...

What is the correct syntax in version 2.1+ for this case?

Any help will be very appreciated!

My Best,
Hung Tran


-- 

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

Reply via email to