Forum Discussion

raultellez17's avatar
raultellez17
Frequent Visitor
8 years ago

How to add an IN PARAMETER Type TimeStamps in Stored Procedures calls?

I'm having problems calling a stored procedures from script, the error ocurred exactly when I try to add an in parameter type DBtimestamp.

 

this is the code:


var SProc;
SProc = ADO.CreateADOStoredProc();
CnnString = ProjectSuite.Variables.connectionString;
SProc.ConnectionString = CnnString;
SProc.ProcedureName = "SPRCOBJ.ASOLINGTER";


// Adding an in parameter:
SProc.Parameters.AddParameter();
SProc.Parameters.Items(0).name = "AUVI";
SProc.Parameters.Items(0).DataType = ftFixedChar;
SProc.Parameters.Items(0).Size = 5;
SProc.Parameters.Items(0).Value = "19709";
.
.
.
.
/* This is the problem */
// Adding an in parameter:
SProc.Parameters.AddParameter();
SProc.Parameters.Items(55).name = "TFHVGM";
SProc.Parameters.Items(55).DataType = adDBTime; //The error occurred exactly in this line of code.
//SProc.Parameters.Items(2).Size = 26;
SProc.Parameters.Items(55).Value = "2017-01-05-08.36.44.311000";
.
.
.
.
// Running the procedure
SProc.ExecProc();

 

 

 

Please I need help!!

2 Replies

  • Marsha_R's avatar
    Marsha_R
    Champion Level 3

    What error did you get?  The exact message will help us help you.

    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      The error message would help, for sure... but question: You are apparently assigning a full date and time to the parameter. Shouldn't you be using adDBTimeStamp instead? I'm not sure if that would cause your error, but it seems odd to be using a time only datatype when you are passing in a full date time