Error in Procedure: Query Failed. Refer to result column in History for details.

Database
New Member

Error in Procedure: Query Failed. Refer to result column in History for details.

Guys,

could you assist me in finding the mistake?

BEGIN TRANSACTION;

DECLARE MAX_DATE DATE;

SET MAX_DATE = (SELECT MAX(V_MONTH) FROM DB_TEMP.HISTORIAL_DATA);

SELECT * FROM DB_TEMP.HISTORIAL_DATA WHERE V_MONTH = MAX_DATE;

END TRANSACTION;

Thanks.

3 REPLIES
Teradata Employee

Re: Error in Procedure: Query Failed. Refer to result column in History for details.

Double-click on the history and look at the actual error message.

I presume this is a portion of the stored procedure?

You can't use a SELECT within a SET. Use SELECT INTO syntax instead.

Enthusiast

Re: Error in Procedure: Query Failed. Refer to result column in History for details.

Fred - What do you mean by use SELECT INTO syntax instead.

Im facing similar issue when executing Minus/EXCEPT ALL

Select

Col1,Col2,Col3

From Table1 where <condition>

Except All

Select

Col1,Col2,Col3

From Table2

Teradata Employee

Re: Error in Procedure: Query Failed. Refer to result column in History for details.

In the earlier post, instead of the SET with a subquery:

SELECT MAX(V_MONTH) INTO :MAX_DATE FROM DB_TEMP.HISTORIAL_DATA;

I'm not clear on how your question is a "similar issue". Can you provide more information as to the actual error you are seeing?