Issues with ODBC driver

Database
Enthusiast

Issues with ODBC driver

Hello,

 

So I have been trying to populate some tables.  I have written a stored procedure to populate them.  It works if I enter them into Teradata SQL Express query editor window.  I can click on the green arrow button to run the query, and the system creates the stored procedure just fine.  I can run it then.  Here is the full code:

 

CREATE PROCEDURE testdb.sp1 () MODIFIES SQL DATA
BEGIN
    DECLARE i BIGINT;
    SET i = 10;
    WHILE (i < 100) DO
       INSERT INTO testdb.table_1 (x) VALUES (i) ;
       SET i = i + 10;
   END WHILE;

END;

 

While OK, this is a manual process.  I prefer to connect to Teradata via its own ODBC driver and create the stored procedure at certain scheduled times.  This gives me some flexibility for things I want to do later on.

 

However, the ODBC driver fails to run the same exact code.  It gives me a generic error saying "(-3706)Syntax error: Invalid  SQL Statement."   This is not an issue of privileges, or stored procedures existing, or anything like that.  I have checked things and repeated the process dozens of times by now.  It just seems like an error in the ODBC driver itself in that it cannot parse out the SQL code block properly.

 

Can anyone confirm this if they can connect using the ODBC driver? 

Is there a way to make this work?

What tools are available to connect to Teradata via ODBC?

 

2 REPLIES
Teradata Employee

Re: Issues with ODBC driver

Works fine for me.

What client software and which version of TD ODBC driver?

Are you passing the full multi-line stored procedure definition as a single request string?

Teradata Employee

Re: Issues with ODBC driver

Hi,

 

Use ASCII character set in driver while compiling the stored procedure.