Welcome to the Alteryx Knowledge Base

Error SQLExecute: [Simba][Hardy] (80) Syntax or semantic analysis error thrown in server while executing query. LENGTH() only takes STRING/CHAR/VARCHAR/BINARY types as first argument, got INT
user

Created/Edited - 5/8/2026 by Henriette Haigh | Alteryx

Summary
User is trying to use LENGTH to determine the length of a value and getting an error.
Issue

User is trying to use LENGTH to determine the length of a value and getting an error such as: 
 

Browse In-DB (12)    Error SQLExecute: [Simba][Hardy] (80) Syntax or semantic analysis error thrown in server while executing query. Error message from server: Error while compiling statement: FAILED: SemanticException [Error 10014]: Line 1:51 Wrong arguments 'DateField':  LENGTH() only takes STRING/CHAR/VARCHAR/BINARY types as first argument, got TIMESTAMP
Browse In-DB (15)    Error SQLExecute: [Simba][Hardy] (80) Syntax or semantic analysis error thrown in server while executing query. Error message from server: Error while compiling statement: FAILED: SemanticException [Error 10014]: Line 1:51 Wrong arguments 'NumberField':  LENGTH() only takes STRING/CHAR/VARCHAR/BINARY types as first argument, got SHORT
Browse In-DB (15)    Error SQLExecute: [Simba][Hardy] (80) Syntax or semantic analysis error thrown in server while executing query. Error message from server: Error while compiling statement: FAILED: SemanticException [Error 10014]: Line 1:51 Wrong arguments 'NumberField':  LENGTH() only takes STRING/CHAR/VARCHAR/BINARY types as first argument, got LONG
Browse In-DB (15)    Error SQLExecute: [Simba][Hardy] (80) Syntax or semantic analysis error thrown in server while executing query. Error message from server: Error while compiling statement: FAILED: SemanticException [Error 10014]: Line 1:51 Wrong arguments 'NumberField':  LENGTH() only takes STRING/CHAR/VARCHAR/BINARY types as first argument, got INT

 

Prerequisites
  • Alteryx Designer
    • All versions
  • Hive
Cause
Length can only be determined for certain data types: STRING/CHAR/VARCHAR/BINARY. The column is not the right data type.
Resolution
Change the data type by using CAST: length(CAST (`FieldName` as string))

Was this article helpful?