Skip to Content
avatar image
Former Member

Data Services sql() statement in script truncates the result after +- 500 characters

I am pushing down a sql statement to our Teradata database, but the result is a long character string.

If I pass the variable eg.

$GV_RESULT = sql('DB name', 'select FIELD1 from ...')

it returns only the first 500 characters (don't know exact size, but thereabouts). The actual size it should be returning is more like 10000 characters.

The variable $GV_RESULT is sufficient in length.

Is this a feature or am I missing something?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Oct 30, 2017 at 12:51 PM

    RT*M. SAP Data Services Reference Guide, section 6.3.139 sql:
    Runs a SQL operation against tables in the specified database.

    Return value varchar(1020)
    Returns the first 1020 characters from the query's output. Typically, if <sql_command> is a SELECT statement, the return value is the first row value of the first column. If <sql_command> is not a SELECT statement, the return value is typically NULL. You must remember this if you assign the value returned to a variable.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 30, 2017 at 12:59 PM

    Ah apologies, I do see this in manual. However then I actually want to change the question to, how can I return a variable that is larger than 1020. Is there no way to do this via a script?

    I have tried the parameter and variable passing from a Dataflow, but I have additional issue there. Also logged specific question around that.

    Add comment
    10|10000 characters needed characters exceeded