Results 1 to 3 of 3

Thread: Brianscript as graph parameter in DBQuery

  1. #1
    Contributor
    Join Date
    Apr 2011
    Location
    Copenhagen
    Posts
    144

    Default Brianscript as graph parameter in DBQuery

    I am trying to use a parameter i have written as brainscript in i DBQuery to find the first day of the previous month.
    str(dateAdjust(date(date().str().left(8)+"01","CCY Y-MM-DD"),-1,"months")).replace("-","")


    I get the following error:
    WARN: OCI Error 1741: ORA-01741: illegal zero-length identifier

    Error Code: brain.node.OciUtils.cpp.83


    The string i get with the code works if i type the parameter as text.
    Is it that you cant use brainscript parameters as inputs in DBqueries?

    Br
    Thomas
    Last edited by ThomasT; 04-19-2016 at 01:48 PM.

  2. #2
    Larry Tolleson ltolleson's Avatar
    Join Date
    Nov 2006
    Location
    Dallas-Fort Worth
    Posts
    189

    Default

    You can use Parameters in your DBQuery node, but the code needs to be SQL not BrainScript.

    My recommendation would be to query the data you need using the DBQuery node, then use a filter node to apply the date logic you have coded above. One error in the code above. You have an extra space in the "CCYY-MM-DD" format.

  3. #3
    Contributor
    Join Date
    Apr 2011
    Location
    Copenhagen
    Posts
    144

    Default

    Thank you Larry.

    The space in the code is actually not there, seems to appear only in this forum :-)
    I will do as you suggest..

    Cheers!
    Thomas

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •