Data360 Analyze

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

Here are some useful links where you can find more information:

Product Announcements  Product Documentation  Ideas Portal

Discussions

Members

Resources

Events

 View Only
  • 1.  DB Execute Binding with another teradata query

    Posted 02-13-2017 14:46

    I'm trying to use results from a DB Query node to pull results from Teradata using the DB Execute node.

    Results from DB Query include 500K records with column name Cust_ID.

    Within the DB Execute I have the following:

    DbInterface "cli"

    paremeter 1 as query - "Select Cust_ID From Table A Where Cust_ID= :Cust_ID"

    General - "sqlSelect(1,"{{^query^}}",'Cust_ID')

    I am getting the following error:

    Length 0 is not allowed for CHAR, VARCHAR, BYTE, VARBYTE column.

     



  • 2.  RE: DB Execute Binding with another teradata query

    Employee
    Posted 02-13-2017 16:43

    Do any of the input rows have NULL for a vale in the Cust_ID field?



  • 3.  RE: DB Execute Binding with another teradata query

    Posted 02-13-2017 20:55

    The Cust_ID field does not contain any null values.



  • 4.  RE: DB Execute Binding with another teradata query

    Posted 02-14-2017 09:40

    Dear Kevin,

    Might there be any empty strings ("")?  I'm wondering if that might be the problem as well.

    I'm presuming that your input data has 1 or more records.

    Hope that helps,

    Rocco



  • 5.  RE: DB Execute Binding with another teradata query

    Posted 02-14-2017 09:53

    There are no empty strings.  I even attempted the same bind with only one row of input and got the same error message.

    For smaller results I was able to use a an Agg node and  filter node and create a query using an "in" statement which worked fine, however using "=" with Teradata cli interface has not worked at all no matter what I do.  Many of the binds have over 1M of input

    This is something I'm going to have to use a lot to compete my process. 



  • 6.  RE: DB Execute Binding with another teradata query

    Posted 02-15-2017 14:33

    Dear Kevin,

    I have done some research on Teradata parameterized queries, and I noticed that there is a syntax difference between the format you provided and the format on Teradata's website.  What if you change the SqlQuery to the following:

    sqlSelect(1,"Select Cust_ID From Table A Where Cust_ID= '?Cust_ID'",'Cust_ID')

    Does that get you a little further along?

    I am presuming that the customer ID is a string.

    Hope that helps,

    Rocco



  • 7.  RE: DB Execute Binding with another teradata query

    Posted 02-16-2017 08:55

    I updated the node and received the following error:

    Position out of bounds: 0/0

    Line:2 BrainScript: sqlSelect(1,"Select service_receiver_customer_id From TELCO_UNREG_RETAIL_VIEWS.VCTB804_RECURRING_CHARGE_RATE Where service_receiver_customer_id = '?Service_receiver_customer_id'",'SERVICE_RECEIVER_CUSTOMER_ID')

    Operator: sqlSelect



  • 8.  RE: DB Execute Binding with another teradata query

    Employee
    Posted 02-16-2017 10:14

    Capitalization and spelling may affect the resutls.

    sqlSelect(1,"Select service_receiver_customer_id From TELCO_UNREG_RETAIL_VIEWS.VCTB804_RECURRING_CHARGE_RATE Where service_receiver_customer_id =

    '?SERVICE_RECEIVER_CUSTOMER_ID'",'SERVICE_RECEIVER_CUSTOMER_ID')



  • 9.  RE: DB Execute Binding with another teradata query

    Posted 02-16-2017 13:29

    I attempted again with the updates and received the same error.  I have searched the forums for related questions and came across a few that did not have a resolution.  Is this even possible with Teradata?



  • 10.  RE: DB Execute Binding with another teradata query

    Employee
    Posted 02-17-2017 07:12

    Try the colon again, instead of the question mark.

    This worked for me when I ran it just now:

    query="select system_cd table where and system_cd = :sys "
    sqlSelect(1,query,sys)

    =====

    Some of the troubles you are having may be due to Teradata version. The database I was successful with was version 15.10.02.06



  • 11.  RE: DB Execute Binding with another teradata query

    Employee
    Posted 02-17-2017 07:14

    The other problem might be that you have some odd type of data stored in the database.

    You might try wrapping the field with a CAST() statement to force it into a string.