Thanks very much Kyle! It worked! As I could debug, the problem arised
because of a non-closed bracket in an IF expression from another function.
This seems consistent with your explanation that an error in a function
returned an error in another one. Perhaps because the IF statement was not
resolved.
Anyway your hint helped a lot!
Many thanks and regards
Ricardo
On Tuesday, November 24, 2015 at 10:30:31 PM UTC-3, Kyle wrote:
>
> I think one error in a {sql, javascript, groovy} function causes an error
> in all functions in the same language.
>
> The "previous commands I ran from the Browse tab" part is perplexing but
> here is what I would do for debugging:
>
> 1) test a non-javascript function to see if it works.
> 2)
> comment out all the javascript functions
> check if a new simple function works.
> if it works, uncomment the javascript functions one by one to find the one
> with the error.
>
>
> hope this helps.
>
> On Tuesday, November 24, 2015 at 5:03:46 PM UTC-8, Ricardo A. Pasquini
> wrote:
>>
>> Dear all,
>> Hope you can help me with an error message that appears when executing
>> functions from the Functions' Manager in Studio.
>> In the last days I have written several functions in Javascript that I
>> was executing nicely from Studio, but suddently it stopped working.
>> No matter which Function I execute, I am obtaining exactly the same "Bad
>> Request error". The error message is showing some previous commands I ran
>> from the Browse tab, with no reference at all to the actual Function.
>> In order to show the problem, I wrote the simplest function as an
>> example:
>>
>>
>>
>>
>> <https://lh3.googleusercontent.com/-XdR1UpohV3o/VlUHIg7HA6I/AAAAAAAABQE/r3VABtccXSA/s1600/error400b.JPG>
>>
>> Here is the detail of the error, which include some previous querys I ran
>> from the Browse tab.
>>
>> {
>> "errors": [
>> {
>> "code": 400,
>> "reason": "Bad request",
>> "content": "ScriptManager: error <eval>:58:7 Expected ; but
>> found yearmonth\r\nselect yearmonth.substring(0, 4), yearmonth.right(2)
>> from yearmonth\r\n ^ in <eval> at line number 58 at column number
>> 7.\nFunction randomedges(nombreclase,nombreclaseedges):\n\n 53: \n 54:
>> //selection of months\n 55: var text=\"insert into yearmonth from select
>> from (select from (select distinct(createdat1.format('yyyy-MM')) as
>> yearmonth from Rolein) order by yearmonth)\";\n 56: var
>> yearmonth=g.command(\"sql\",text);\n 57: \n 58: >>> select
>> yearmonth.substring(0, 4), yearmonth.right(2) from yearmonth\n 59: \n 60:
>> g.command(\"sql\",\"UPDATE yearmonth SET year=yearmonth.substring(0,
>> 4)\")\n 61: g.command(\"sql\",\"UPDATE yearmonth SET
>> month=yearmonth.right(2)\")\n 62: \n 63: }\n"
>> }
>> ]
>> }
>>
>>
>> If the problem is somewhat related with the ScriptManager, is there a way
>> to reset it in someway? I have already restarted my browser, also tried by
>> restarting the server, but the problem remains.
>> Thanks in advance,
>> Ricardo
>>
>
--
---
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 [email protected].
For more options, visit https://groups.google.com/d/optout.