SAP Knowledge Base Article - Public

3652574 - Structure not recognized in SQL views or transformation flows in SAP Datasphere

Symptom

  • When developing SQL views or Transformation Flows of type SQL Script in SAP Datasphere, the copied structure from a different is not correctly recognized, leading to error messages.
  • Warning: "We are unable to derive the return statement completely from the script. Please review the list of columns and their data types in the side panel."
  • Error: "sql syntax error: incorrect syntax near", SQL State: HY000.

Environment

  • SAP Datasphere
  • SQL views
  • Transformation Flows

Reproducing the Issue

  1. Start creating a new SQL Script view.
  2. Copy and paste SQL Script from an existing and working view (ensure it is not overly simple).
  3. Click "Validate."

Cause

  • Due to technical limitations, SAP Datasphere cannot automatically derive the return structure for certain SQL scripts. This limitation is documented behavior.
  • Possible that once the error occurs, the SQL view becomes corrupted, and even deleting all code does not resolve the issue. A new SQL view must be created.

Resolution

  1. Manually review the list of columns in the side panel under "Model Properties."
  2. Use the "Edit" option to add or remove columns or modify column names and data types as necessary.
  3. Ensure that the context of the original SQL script is replicated in the new SQL view.
  4. Avoid validating the SQL script prematurely during development to minimize the risk of corruption.
  5. Refer to the SAP documentation for best practices on managing SQL scripts: SAP Datasphere SQL Script Best Practices

See Also

Keywords

SQL views, transformation flows, return structure, SAP Datasphere, SQL script validation, error code 257, SQL State HY000, manual column editing, SQL script limitations, SAP Datasphere troubleshooting, Table functions, Warning: We are unable to derive the return statement completely from the script. Please review the list of columns and their data types in the side panel, Error: sql syntax error: incorrect syntax near , KBA , DS-MD-VIW , Views , Problem

Product

SAP Datasphere all versions