LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  Issues with DB Execute Node using ODBC and Teradata

    Employee
    Posted 04-05-2016 17:58

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: residnt

    Hello There,

    I'm running into issues utilizing the DB execute node with the ODBC driver and teradata. I was originally using the cli interface but then discovered that with that interface the queries couldn't be case insensitive and was causing issues so I turned to the ODBC driver. I am passing the query into the DB execute from a filter node however I get this error "WARN: Bind name in sql statement is empty. Col: 52". I'm not sure how to proceed from this point. I've tried the JDBC execute but it doesn't seem like I can pass the query into that node as it keeps throwing errors when I try.

    Need help
    Jason


  • 2.  RE: Issues with DB Execute Node using ODBC and Teradata

    Employee
    Posted 04-06-2016 04:10

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: lnason

    HI Jason - Can you pass along an example of the type of query you are trying to run and the script that you have inside of your Db Execute node?

    Thanks,
    Luke


  • 3.  RE: Issues with DB Execute Node using ODBC and Teradata

    Employee
    Posted 04-06-2016 07:49

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: residnt

    Sure, the query itself if rather simple and does execute fine with the DB Query node. Basically what I'm doing is pulling in a directory of sql files and reading them in and passing them 1 by 1 into the DB execute node. The queries can be complex or rather simple like this one

    SELECT DD.Event_Date
    ,   DD.Metric_ID
    ,   DD.Master_Ttl_Name
    ,   CASE WHEN DD.Ttl_Name = D.Ttl_Name THEN 'Current Year'
                       WHEN DD.Ttl_Name = D.P1_Ttl_Name THEN 'Prior Year'
                       WHEN DD.Ttl_Name = D.P2_Ttl_Name THEN 'Prior 2 Year'
        END AS Series_Name
    ,   DM.Metric_Name
    ,   DD.Data_Value
    FROM DB.DASH DD
    INNER JOIN DB.DASH_M DM
        ON DD.Metric_ID = DM.Metric_ID
    INNER JOIN DB.REF R
        ON DD.Ttl_Name = R.Ttl_Name
    INNER JOIN DB.USER D
        ON R.Franchise_Code = D.Franchise_Code
    WHERE 1=1
        AND DD.Metric_ID IN(1,2)
        AND D.Franchise_Code = 'XXX'
        AND DD.Master_Ttl_Name = CASE WHEN Series_Name = 'Current Year' THEN D.Ttl_Name
                                                                    WHEN Series_Name = 'Prior Year' THEN D.P1_Ttl_Name
                                                                    WHEN Series_Name = 'Prior 2 Year' THEN D.P2_Ttl_Name END
        AND DD.Platform_Code = 'Con'
    The carriage return is being removed through a filter node as that was causing some issues. In the DB execute node the query is being call with this
    sqlSelect (1, 'Query')

    Which as mentioned all worked fine with the cli interface, but that interface was causing issues with the case in the query so instead of changing 42 queries decided to go with the ODBC driver which now is throwing the "WARN: Bind name in sql statement is empty. Col: 52" error

    Thanks
    Jason


  • 4.  RE: Issues with DB Execute Node using ODBC and Teradata

    Employee
    Posted 04-06-2016 10:29

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: residnt

    Actually I have solved this now. Basically the issue was in the sql file we had comments that had ":" inside of the comments. For some reason Lavastorm was evaluating the comments and trying to bind something to it. But it looks like I have it figured out now and can use the ODBC drivers to get what I need.

    Jason