Calling Macro from .Net Provider


Calling Macro from .Net Provider


I'm new to TeraData and need to call a Macro from C# using the .Net Provider.

I wasn't able to find any sample code, and not sure what the correct way to do this.

I don't want toe send "exec macroName(param1)" from my code, I would like to have something similar to the way i call procedures.

Can you please point me in the right direction?

Tags (2)
Teradata Employee

Re: Calling Macro from .Net Provider

There is only one way:  

1- Set the TdCommand.Text = "Exec MacroName(?)" and Set the TdCommand.CommandType = CommandType.Text;

2- Add a TdParameter to the TdCommand.Parameters collection

3- Invoke TdCommand.ExecuteReader or TdCommand.ExecuteNonQuery

Executing a Macro is identical to executing a DML statement (Select or Update/Insert/Delete). The ADO.NET specification does not have a separate CommandType for Macro (vs. StoredProcedure or Text).