problem with inserting a casted interval literal into a teradata 13.0 database using ODBCtest
I am trying to execute this query:
INSERT INTO SEN.Interval_Day_Minute_Table VALUES('NegativeIntervalDay', CAST(INTERVAL -'200 5' DAY TO HOUR AS INTERVAL DAY (4) TO MINUTE))
into a teradata database using ODBCtest, and I get the following error:
SQLExecDirect:
In: Statementhandle = 0x000000000053C270, StatementText = "INSERT INTO SEN.Interval_Day_Minute_Table VALUES('...", Statementlength = 142
Return: SQL_ERROR=-1
stmt: szSqlState = "37000", *pfNativeError = -3706, szErrorMsg = "[Teradata][ODBC Teradata Driver][Teradata Database] Syntax error: Invalid INTERVAL Literal. "
The table was created with:
CREATE TABLE SEN.Interval_Day_Minute_Table(
KeyColumn CHAR (开发者_开发技巧255) CHARACTER SET UNICODE,
Column1 INTERVAL DAY (4) TO MINUTE)
I'm new to Teradata, but as far as I can tell, I'm using the correct syntax.
the problem was that the 'hours' portion of the string had to be two digits, so -'200 05' rather than -'200 5'.
whoops
精彩评论