We recommend switching to the latest versions of Edge, Firefox, Chrome or Safari. Using Internet Explorer will result in a loss of website functionality.

DbExecute Node Error

Comments

7 comments

  • Avatar
    Adrian Williams

    I think you need to perform your processing to construct the query to be sent to DB prior to using the sqlSelect() function in the script. 

    For example, if a static SQL expression is as follows:

    The type of table can be parameterized by supplying the key in an input field:

     

    The DB Execute node script is configured as follows to incorporate the key binding into a string-valued expression that can then be used in the sqlSelect() function. 

    0
    Comment actions Permalink
  • Avatar
    Michael Waxman

    Hello Adrian:

    I am now getting the following error:  Syntax error: expected something between the beginning of the request and the integer '980025754'.  I have attached the node I am trying to run. The data in the static node is an representation of the output from another query that leads into the DbExecute node Thank you for your assistance.

     

     

     

    0
    Comment actions Permalink
  • Avatar
    Adrian Williams

    Hi Michael,

    can you try attaching the data flow again as there was nothing attached to your post. It is a two-step approach - you have to choose the file first and then click the Attach File button before clicking on the Submit button.

    0
    Comment actions Permalink
  • Avatar
    Michael Waxman

    Hi Adrian:

    File is now attached.  Thank you

     

     

    Attached files

    Lavastorm Community.brg

     

    0
    Comment actions Permalink
  • Avatar
    Adrian Williams

    The reason you are getting the above error is that there is effectively no SQL query statement being sent to the DB. The current code is only inserting the value of the BAN as the query.

    Looking at the original error message in your first post, the query needs to be something like the following:

     

    sqlQuery = strcat("SELECT * FROM EDWCCDVIEWS.CRDT_APP WHERE b.acct_nbr = ", BAN.str().trim())

    sqlSelect(1,sqlQuery)

     

    0
    Comment actions Permalink
  • Avatar
    Michael Waxman

    Hi Adrian:

    I am still running into issue.  To level set, I have attached a DB execute node that runs successfully when connected to an Oracle(OCI) DBInterface.  When using the same node(different server)  connected to an Teradata (CLI) DBInterface I receive the following error.  How should I configure the bind and sql statement when connecting to an teradata server.

    Bind name in teradata sql statements must not begin with a digit. Col: 126 select acct_nbr, curr_crdt_sts_cd, curr_crdt_sts_rsn_cd, crdt_sts_rsn_desc from ECDW_EDWCCDVIEWS.CRDT_APP where acct_nbr = :1

     

     

    Attached files

    Lavastorm Community_2.brg

     

    0
    Comment actions Permalink
  • Avatar
    Adrian Williams

    I'm not familiar with the details of the Teradata syntax but the issue in the query may be the =:1 

    This forum post indicates that perhaps using a alphanumeric name in the binding instead of a numeric value of 1 may help.

    https://support.infogix.com/hc/en-us/community/posts/360028736814-DB-Execute-Binding-with-another-teradata-query

     

    0
    Comment actions Permalink

Please sign in to leave a comment.