[Vtigercrm-developers] server api vtws query parenthesis?
nilay khatri
nilay.spartan at gmail.com
Mon Apr 6 11:52:27 GMT 2020
Check include/Webservices/VTQL_Parser.php
Line 106:
/*
add this rule to add parenthesis support.
condition ::= PARENOPEN expr_set expr(E) PARENCLOSE.
sample format(for contacts) for generated sql object
Array (
[column_list] => c4,c3,c2,c1
[tableName] =>
vtiger_crmentity,vtiger_contactdetails,vtiger_contactaddress,vtiger_contactsubdetails,vtiger_contactscf,vtiger_customerdetails
[where_condition] => Array (
[column_operators] => Array (
[0] => =
[1] => =
[2] => =
)
[column_names] => Array (
[0] => c1
[1] => c2
[2] => c3
)
[column_values] => Array (
[0] => 'llet me'
[1] => 45
[2] => -1
)
//TO BE DONE
[grouping] => Array (
[0] => Array (
[0] => 1
[1] => 2
)
)
[operators] => Array (
[0] => and
[1] => or
)
)
[orderby] => Array (
[0] => c4
[1] => c5
)
[select] => SELECT
[from] => from
[semi_colon] => ;
)*/
Parenthesis is not supported by default, but might be the mentioned change
could do the trick.
On Mon, Apr 6, 2020 at 5:18 PM nilay khatri <nilay.spartan at gmail.com> wrote:
> I don't think grouped where clauses are supported.
>
> On Mon, Apr 6, 2020 at 2:50 PM Alan Lord <alanslists at gmail.com> wrote:
>
>> I need to use vtws_query but when I include parenthesis like this I get
>> an error:
>>
>> $query = "SELECT id, name, status, assigned_user_id
>> FROM LSModule
>> WHERE (status = 'Active' OR status = 'Development')
>> AND tgt_module = '".$moduleName."';";
>>
>>
>>
>> > Mon Apr 6 09:08:59 2020,529 [28641] DEBUG VT - Syntax Error on line 1:
>> token '(' Unexpected PARENOPEN((), expected one of: COLUMNNAME
>>
>> If I remove the parenthesis the query runs but I am not then sure if the
>> result as actually what I want, e.g. how are the OR and AND clauses
>> interpreted?
>>
>> Cheers
>>
>> Al
>>
>> _______________________________________________
>> http://www.vtiger.com/
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20200406/9739dc74/attachment.html>
More information about the vtigercrm-developers
mailing list