The below function won't build for me at the two statements below attempting to add parameters to a dynamic stored procedure call. It doesn't like the 2nd parameter in each statement. I just cannot find the correct syntax using Teradata. I usually call these in BTEQ like call sp_MISRE_ChkClaimCount('Marc', 10, v_return_code);" My procedure uses 3 parameters: (IN v_pWho VARCHAR(20), IN v_i_run_job_id INT, OUT v_return_code INT))
Error: "Too many arguments to 'Public MustOverride Function Add(value As Object) As Integer'."
looks like dbCommand (from .NET Data Provider for Teradata - Teradata.Client.Provider) can only support 1 parameter. Any ideas how to fix. This worked fine in SQLServer using VS 2003 and SqlClient.SqlCommand.
-- EXAMPLE CODE 'Vars declarations '.NET Data Provider for Teradata - Teradata.Client.Provider Dim cn As DbConnection Dim cmd As DbCommand Dim dtr, dtr1 As DbDataReader Dim strSQL As String Dim cmdSelect As DbCommand Dim cnString As String Dim pf As DbProviderFactory = DbProviderFactories.GetFactory("Teradata.Client.Provider")
' Function Code Private Function RunExecRoutines() As Boolean Try cnString = "Data Source=" & Server.Text & ";User ID=" & UserName.Text & ";Password=" + Password.Text cn = pf.CreateConnection cn.ConnectionString = cnString cn.Open() Catch ex As Exception sqlCnError = ("Error: Could not establish database connection") End Try
Thanks Shaw, I am still confused though. I tried your suggestion as shown in code at the bottom of this thread by passing 3 parameters as per the code snippet you recommended. However, where exactly do you assign the parameters to be used? i.e. UNameRoutine is = 'Marc' (the logon to the application) etc. My sProc is defined like this REPLACE PROCEDURE sp_MISRE_Pivot ( IN v_pWho VARCHAR(20), IN v_i_run_job_id INT, OUT v_return_code INT)
Also when I run the below as is, I get the message 'Teradata.Client.Provider.TdException: [Teradata Database  Stored Procedure 'DEV_DATA_DIMS.DEV_DATA_V.sp_MISRE_Pivot' does not exist at Teradata.Client.Provider.TdCommand.ExecuteNonQuery'. My sProc exists on DEV_DATA_V but it attaches the default DEV_DATA_DIMS onto it first. When I log into Queryman with no default database set, it will logon to DEV_DATA_DIMS, maybe this is it but how can i change that (i didn't set up the databases).
I've gotten a bit further in that i have the sProc running but the default database it picks up (DEV_DATA_DIMS) when running a sProc is causing issue. The sProc resides on DEV_DATA_V, I have madea copy on DEV_DATA_DIMS until i resolve the issue there. Any idea how this is being picked up as I am not setting it or can you advise how I can get it to choose the database i want it to?
note: (it's not doing this on normal DML or Select Statements).
which is fine but the name could and will in my case exceed 30 charaters. I have used the tools-modify user-default database tool instead. I don't think this will have any issue in dev. thanks for the help.