SYSEXECSQL

Database
Enthusiast

SYSEXECSQL

How can we pass a string (length >64KB) in DBC.SYSEXECSQL?

I tried creating the string as CLOB and passed it in sysexecsql. It failed.

3 REPLIES
Teradata Employee

Re: SYSEXECSQL

SQL string literals are limited in length to a maximum of 31000 bytes, according to the Teradata Database Reference / SQL Data Types and Literals.

What is your goal? For example, are you trying to load data from a file into a CLOB? You may want to consider creating a Java program, using the Teradata JDBC Driver. Your application can call the PreparedStatement setCharacterStream method to insert a CLOB value up to the maximum supported length of 2GB.

Sample programs illustrating how to use the Teradata JDBC Driver to insert LOB values are available here on Developer Exchange:

http://developer.teradata.com/doc/connectivity/jdbc/reference/current/samplePrograms.html

Enthusiast

Re: SYSEXECSQL

 I need to pass a SQL statement dynamically through SYSEXECSQL. This SQL statement contains more than 64K characters (as the table used in this SQL contains around 1600 columns).

Teradata Employee

Re: SYSEXECSQL

Have you considered using a Java Stored Procedure instead?

With a Java Stored Procedure, all the SQL statements are "dynamic", and the SQL request text can be up to approximately 1MB in size.