All Forums Database
rupert160 131 posts Joined 09/10
17 Aug 2012

What are the differences between EXECUTE and EXECUTE IMMEDITATE, is I can’t see any difference in the supplied documentation...

Properties of EXECUTE, EXECUTE IMMEDIATE and dbc.SysExecSql are:

  • All can be called multiple times in a statement.
  • None can be used to return a result set
  • EXECUTE & EXECUTE IMMEDIATE are ANSI 2008 compliant.



Fred 1096 posts Joined 08/04
17 Aug 2012

EXECUTE IMMEDIATE is the ANSI equivalent of Teradata "CALL dbc.SysExecSQL()". [The argument for either is a character string that contains a SQL statement.]

EXECUTE requires separate PREPARE statement, and allows parameter values to be passed (USING). [The argument for EXECUTE is a "prepared SQL statement" object.]

All three statement types can be used multiple times in one stored procedure.

rupert160 131 posts Joined 09/10
17 Aug 2012

Perfect Fred, - thank you for that clarification regarding argument lists.

You must sign in to leave a comment.